Package javax.media.jai

Examples of javax.media.jai.ImageLayout.unsetValid()


    // a the possibility to expand the color model.
    if (strategy != ViewType.PHOTOGRAPHIC)
      targetHints.add(ImageUtilities.DONT_REPLACE_INDEX_COLOR_MODEL);
    else {
      targetHints.add(ImageUtilities.REPLACE_INDEX_COLOR_MODEL);
      layout.unsetValid(ImageLayout.COLOR_MODEL_MASK);
      layout.unsetValid(ImageLayout.SAMPLE_MODEL_MASK);
    }
 
    // /////////////////////////////////////////////////////////////////////
    //
View Full Code Here


    if (strategy != ViewType.PHOTOGRAPHIC)
      targetHints.add(ImageUtilities.DONT_REPLACE_INDEX_COLOR_MODEL);
    else {
      targetHints.add(ImageUtilities.REPLACE_INDEX_COLOR_MODEL);
      layout.unsetValid(ImageLayout.COLOR_MODEL_MASK);
      layout.unsetValid(ImageLayout.SAMPLE_MODEL_MASK);
    }
 
    // /////////////////////////////////////////////////////////////////////
    //
    // Creating final grid coverage.
View Full Code Here

         * Boolean.TRUE is not enough to force the operators to do an expansion. If we explicitly
         * provide an ImageLayout built with the source image where the CM and the SM are valid.
         * those will be employed overriding a the possibility to expand the color model.
         */
        if (ViewType.PHOTOGRAPHIC.equals(processingView)) {
            layout.unsetValid(ImageLayout.COLOR_MODEL_MASK | ImageLayout.SAMPLE_MODEL_MASK);
        }
        targetHints.put(JAI.KEY_IMAGE_LAYOUT, layout);

        ////////////////////////////////////////////////////////////////////////////////////////
        ////                                                                                ////
View Full Code Here

        ImageLayout layout = null;
        // Check on the ImageLayout
        if (layoutOld != null) {
            layout = (ImageLayout) layoutOld.clone();
            // Unset the previous dimension parameters
            layout.unsetValid(ImageLayout.MIN_X_MASK);
            layout.unsetValid(ImageLayout.MIN_Y_MASK);
            layout.unsetValid(ImageLayout.WIDTH_MASK);
            layout.unsetValid(ImageLayout.HEIGHT_MASK);
        } else {
            // Create a new one
View Full Code Here

        // Check on the ImageLayout
        if (layoutOld != null) {
            layout = (ImageLayout) layoutOld.clone();
            // Unset the previous dimension parameters
            layout.unsetValid(ImageLayout.MIN_X_MASK);
            layout.unsetValid(ImageLayout.MIN_Y_MASK);
            layout.unsetValid(ImageLayout.WIDTH_MASK);
            layout.unsetValid(ImageLayout.HEIGHT_MASK);
        } else {
            // Create a new one
            layout = new ImageLayout2();
View Full Code Here

        if (layoutOld != null) {
            layout = (ImageLayout) layoutOld.clone();
            // Unset the previous dimension parameters
            layout.unsetValid(ImageLayout.MIN_X_MASK);
            layout.unsetValid(ImageLayout.MIN_Y_MASK);
            layout.unsetValid(ImageLayout.WIDTH_MASK);
            layout.unsetValid(ImageLayout.HEIGHT_MASK);
        } else {
            // Create a new one
            layout = new ImageLayout2();
        }
View Full Code Here

            layout = (ImageLayout) layoutOld.clone();
            // Unset the previous dimension parameters
            layout.unsetValid(ImageLayout.MIN_X_MASK);
            layout.unsetValid(ImageLayout.MIN_Y_MASK);
            layout.unsetValid(ImageLayout.WIDTH_MASK);
            layout.unsetValid(ImageLayout.HEIGHT_MASK);
        } else {
            // Create a new one
            layout = new ImageLayout2();
        }
View Full Code Here

        // /////////////////////////////////////////////////////////////////////
        if (needToTile) {

            // tiling the original image by providing a suitable layout
            final ImageLayout layout = getImageLayout(image);
            layout.unsetValid(ImageLayout.COLOR_MODEL_MASK | ImageLayout.SAMPLE_MODEL_MASK);

            // changing parameters related to the tiling
            final RenderingHints hints = new RenderingHints(JAI.KEY_IMAGE_LAYOUT, layout);

            // reading the image
View Full Code Here

                RenderedImage image = coverage.getRenderedImage();
                if (forceTransparent) {
                    ImageWorker iw = new ImageWorker(image);
                    iw.forceComponentColorModel();
                    final ImageLayout tempLayout = new ImageLayout(image);
                    tempLayout.unsetValid(ImageLayout.COLOR_MODEL_MASK).unsetValid(
                            ImageLayout.SAMPLE_MODEL_MASK);
                    RenderedImage alpha = ConstantDescriptor.create(
                            Float.valueOf(image.getWidth()), Float.valueOf(image.getHeight()),
                            new Byte[] { Byte.valueOf((byte) 255) }, new RenderingHints(
                                    JAI.KEY_IMAGE_LAYOUT, tempLayout));
View Full Code Here

        }
    }

    private RenderedImage addAlphaChannel(RenderedImage image) {
        final ImageLayout tempLayout= new ImageLayout(image);
        tempLayout.unsetValid(ImageLayout.COLOR_MODEL_MASK).unsetValid(ImageLayout.SAMPLE_MODEL_MASK);                   
        RenderedImage alpha = ConstantDescriptor.create(
                Float.valueOf( image.getWidth()),
                Float.valueOf(image.getHeight()),
                new Byte[] { Byte.valueOf((byte) 255) },
                new RenderingHints(JAI.KEY_IMAGE_LAYOUT,tempLayout));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.