Examples of createCompatibleWritableRaster()


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

                    cm = colorspace.createColorModel( bpc );
                }
            }

            LOG.debug("ColorModel: " + cm.toString());
            WritableRaster raster = cm.createCompatibleWritableRaster( width, height );
            DataBufferByte buffer = (DataBufferByte)raster.getDataBuffer();
            byte[] bufferData = buffer.getData();

            System.arraycopy( array, 0,bufferData, 0,
                    (array.length<bufferData.length?array.length: bufferData.length) );
View Full Code Here

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

            GraphicsConfiguration gc = getGraphicsConfiguration();
            if (gc == null) {
                return null;
            }
            ColorModel cm = gc.getColorModel(Transparency.OPAQUE);
            WritableRaster wr = cm.createCompatibleWritableRaster(width, height);
            Image image = new BufferedImage(cm, wr, cm.isAlphaPremultiplied(), null);
            fillImageBackground(image, width, height);
            return image;
        } finally {
            toolkit.unlockAWT();
View Full Code Here

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

    public static final WritableRaster createRaster(int width, int height) {
        final ColorSpace cs = ColorSpace.getInstance(ColorSpace.CS_GRAY);
        final int[] nBits = {8};
        final ComponentColorModel cm = new ComponentColorModel(cs, nBits,
            false, true, Transparency.OPAQUE, DataBuffer.TYPE_BYTE);
        return cm.createCompatibleWritableRaster(width, height);
    }

    /**
     * Create a raster for the given at a given font-size.
     *
 
View Full Code Here

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

        int rasterWidth = Math.max(1, ceiling(width));
        int rasterHeight = Math.max(1, ceiling(height));

        // create raster
        WritableRaster raster = cm.createCompatibleWritableRaster(rasterWidth, rasterHeight);
        BufferedImage image = new BufferedImage(cm, raster, false, null);

        Graphics2D graphics = image.createGraphics();
        graphics.transform(xform); // device transform (i.e. DPI)
        drawer.drawTilingPattern(graphics, pattern, colorSpace, color);
View Full Code Here

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

    private BufferedImage createRGBBufferedImage(ColorSpace cs, byte[] rgb, int width, int height)
    {
        // create a RGB color model
        ColorModel cm = new ComponentColorModel(cs, false, false, Transparency.OPAQUE, DataBuffer.TYPE_BYTE);
        // create the target raster
        WritableRaster writeableRaster = cm.createCompatibleWritableRaster(width, height);
        // get the data buffer of the raster
        DataBufferByte buffer = (DataBufferByte)writeableRaster.getDataBuffer();
        byte[] bufferData = buffer.getData();
        // copy all the converted data to the raster buffer
        System.arraycopy( rgb, 0,bufferData, 0,rgb.length );
View Full Code Here

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

            (cs, 32, 0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000,
             false, DataBuffer.TYPE_INT);

        // Create a raster for the turbulence pattern
        WritableRaster wr, twr;
        wr = cm.createCompatibleWritableRaster(rasterRect.width,
                                               rasterRect.height);
        twr = wr.createWritableTranslatedChild(rasterRect.x,
                                               rasterRect.y);

        // Create a TurbulencePatternGenerator that will do the job
View Full Code Here

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

         */
        if (hasMask())
        {
            byte[] map = new byte[] { (byte) 0x00, (byte) 0xff };
            IndexColorModel cm = new IndexColorModel(1, map.length, map, map, map, Transparency.OPAQUE);
            raster = cm.createCompatibleWritableRaster(cols, rows);
            bufferData = ((DataBufferByte) raster.getDataBuffer()).getData();

            byte[] array = ((DataBufferByte) image.getData().getDataBuffer()).getData();
            System.arraycopy(array, 0, bufferData, 0,
                    (array.length < bufferData.length ? array.length : bufferData.length));
View Full Code Here

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

                        if(jpegRGBToYCbCr) {
                            WritableRaster wRas = null;
                            if(src instanceof WritableRaster) {
                                wRas = (WritableRaster)src;
                            } else {
                                wRas = src.createCompatibleWritableRaster();
                                wRas.setRect(src);
                            }

                            if (wRas.getMinX() != 0 || wRas.getMinY() != 0) {
                                wRas =
View Full Code Here

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

     *
     * @return A <code>Graphics2D</code> object.
     */
    private Graphics2D getBogusGraphics2D(boolean shouldCopyState) {
        Raster r =  tiledImage.getTile(tileXMinimum, tileYMinimum);
        WritableRaster wr = r.createCompatibleWritableRaster(1, 1);
        BufferedImage bi =
            new BufferedImage(colorModel, wr,
                              colorModel.isAlphaPremultiplied(), properties);

        Graphics2D bogusG2D = bi.createGraphics();
View Full Code Here

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

        Raster r = pc.getRaster(x, y, w, h);
        WritableRaster wr;
        if(r instanceof WritableRaster){
            wr = (WritableRaster) r;
        }else{
            wr = r.createCompatibleWritableRaster();
            wr.setRect(r);
        }
        Surface srcSurf = new ImageSurface(pc.getColorModel(), wr);
        blitter.blit(0, 0, srcSurf, x, y, dstSurf, w, h,
                composite, null, mra);
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.