Package java.awt.image

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


        } else {
            ccm = new ComponentColorModel(
                cSpace, false, false, Transparency.OPAQUE, dataType);
        }
        SampleModel sm = ccm.createCompatibleSampleModel(WIDTH, HEIGHT);
        WritableRaster raster = ccm.createCompatibleWritableRaster(WIDTH,
                                                                   HEIGHT);
        DataBuffer data = raster.getDataBuffer();
        fillCCM(data, sm, cSpace);
        return new BufferedImage(ccm, raster, false, null);
    }
View Full Code Here


/*     */     else
/*     */     {
/* 176 */       throw new IOException("Unsupported options in file");
/*     */     }
/*     */
/* 179 */     WritableRaster r = cm.createCompatibleWritableRaster(this.xSize, this.ySize);
/* 180 */     BufferedImage bi = new BufferedImage(cm, r, false, null);
/*     */
/* 183 */     byte[] image = ((DataBufferByte)r.getDataBuffer()).getData();
/* 184 */     for (short z = 0; z < this.zSize; z = (short)(z + 1)) {
/* 185 */       for (int y = this.ySize - 1; y >= 0; y--) {
View Full Code Here

                ComponentColorModel cm =
                    new ComponentColorModel(cs, false, false,
                                            Transparency.OPAQUE,
                                            DataBuffer.TYPE_FLOAT);
                WritableRaster raster =
                    cm.createCompatibleWritableRaster(env.getWidth(),
                                                      env.getHeight());
                img = new BufferedImage(cm, raster, false, null);
            }
            env.setTestImage(img);
        }
View Full Code Here

        colors  = new ScaledColorSpace(0, 1, minimum, maximum);

        final int transparency = Transparency.OPAQUE;
        final int datatype     = DataBuffer.TYPE_FLOAT;
        final ColorModel model = new ComponentColorModel(colors, false, false, transparency, datatype);
        final WritableRaster data = model.createCompatibleWritableRaster(200,200);
        final BufferedImage image = new BufferedImage(model, data, false, null);
        final int width  = data.getWidth();
        final int height = data.getHeight();
        for (int x=width; --x>=0;) {
            for (int y=height; --y>=0;) {
View Full Code Here

    @Override
    protected BufferedImage createImage(int width, int height) {
        ColorSpace gsColorSpace = ColorSpace.getInstance(ColorSpace.CS_GRAY);
        ComponentColorModel ccm = new ComponentColorModel(gsColorSpace, true, false, Transparency.TRANSLUCENT,
            DataBuffer.TYPE_BYTE);
        WritableRaster raster = ccm.createCompatibleWritableRaster(width, height);

        return new BufferedImage(ccm, raster, ccm.isAlphaPremultiplied(), null);
    }
}
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.