Package java.awt.image

Examples of java.awt.image.ComponentColorModel.createCompatibleSampleModel()


       
        // Forcing the colormodel with noAlpha
        final ColorModel colorModel = new ComponentColorModel(
                ColorSpace.getInstance(requestedBands == 3 ? ColorSpace.CS_sRGB : ColorSpace.CS_GRAY),
                false, false, Transparency.OPAQUE, DataBuffer.TYPE_BYTE);
        SampleModel sm = colorModel.createCompatibleSampleModel(image.getWidth(), image.getHeight());
        layout.setSampleModel(sm);
       
        // Forcing the output format to remove the alpha Band
        image = FormatDescriptor.create(image, DataBuffer.TYPE_BYTE, hints);
    }
View Full Code Here


    }
   
    ComponentColorModel ccm = new ComponentColorModel(cs, nBits, hasAlpha, false, hasAlpha ? Transparency.TRANSLUCENT : Transparency.OPAQUE,
        ccmTransferType);
    ImageTypeSpecifier ccmDesc = new ImageTypeSpecifier(ccm, ccm.createCompatibleSampleModel(1, 1));
   
    if (noDirectCM)
      return Arrays.asList(ccmDesc);
   
    return Arrays.asList(
View Full Code Here

            ColorModel cm =
                new ComponentColorModel(cs, bitsPerSample, false, false,
                                        Transparency.OPAQUE,
                                        DataBuffer.TYPE_BYTE);           
            return new ImageTypeSpecifier(cm,
                                          cm.createCompatibleSampleModel(1, 1));
        }

        // Compute bits per pixel.
        int totalBits = 0;
        for (int i = 0; i < bitsPerSample.length; i++) {
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.