Package java.awt.image

Examples of java.awt.image.WritableRaster.createWritableTranslatedChild()


    private static void constructBitmaps(RenderedImage red, byte[] bitmaps, byte[] softMask) {
        WritableRaster wr = (WritableRaster)red.getData();
        ColorModel cm = red.getColorModel();
        BufferedImage bi = new BufferedImage
            (cm, wr.createWritableTranslatedChild(0, 0),
             cm.isAlphaPremultiplied(), null);
        int width = red.getWidth();
        int height = red.getHeight();
        int [] tmpMap = new int[width];
        int idx = 0;
View Full Code Here


            } else {
                java.awt.Graphics2D g2d = null;
                if (false) {
                    BufferedImage tmpBI = new BufferedImage
                        (workingOffScreen.getColorModel(),
                         copyRaster.createWritableTranslatedChild(0, 0),
                         workingOffScreen.isAlphaPremultiplied(), null);
                    g2d = GraphicsUtil.createGraphics(tmpBI);
                    g2d.translate(-copyRaster.getMinX(),
                                  -copyRaster.getMinY());
                }
View Full Code Here

        if (imageInfo != null) {
            resourceContext.getPDFResources().addXObject(imageInfo);
        } else {
            Raster r = pctx.getRaster(devX, devY, devW, devH);
            WritableRaster wr = (WritableRaster)r;
            wr = wr.createWritableTranslatedChild(0, 0);

            ColorModel pcm = pctx.getColorModel();
            BufferedImage bi = new BufferedImage
                (pcm, wr, pcm.isAlphaPremultiplied(), null);
            final byte[] rgb  = new byte[devW * devH * 3];
 
View Full Code Here

                                wRas.setRect(src);
                            }

                            if (wRas.getMinX() != 0 || wRas.getMinY() != 0) {
                                wRas =
                                    wRas.createWritableTranslatedChild(0, 0);
                            }
                            BufferedImage bi =
                                new BufferedImage(colorModel, wRas,
                                                  false, null);
                            jpegEncoder.encode(bi);
View Full Code Here

                                wRas.setRect(src);
                            }

                            if (wRas.getMinX() != 0 || wRas.getMinY() != 0) {
                                wRas =
                                    wRas.createWritableTranslatedChild(0, 0);
                            }
                            BufferedImage bi =
                                new BufferedImage(colorModel, wRas,
                                                  false, null);
                            jpegEncoder.encode(bi);
View Full Code Here

            for(int tileX = minTileX; tileX <= maxTileX; tileX++) {
                int tileMinX = tiledImage.tileXToX(tileX);

                // Get the WritableRaster of the current tile
                WritableRaster wr = tiledImage.getWritableTile(tileX, tileY);
                wr = wr.createWritableTranslatedChild(0, 0);

                // Create an equivalent BufferedImage
                BufferedImage bi =
                    new BufferedImage(colorModel, wr,
                                      colorModel.isAlphaPremultiplied(),
View Full Code Here

        while( list.hasNext() )
        {
            ImageOperation op = (ImageOperation) list.next();
            WritableRaster r = op.apply( src );
            System.out.println( "In Bounds: " + r.getBounds() );
            src = r.createWritableTranslatedChild( 0, 0 );
        }
        ColorModel cm = image.getColorModel();
        System.out.println( "Out Bounds: " + src.getBounds() );
        BufferedImage newImage = new BufferedImage( cm, src, true, new Hashtable() );
        // Not sure what this should really be --------------^^^^^
View Full Code Here

/*     */     else {
/* 178 */       wRas = Raster.createWritableRaster(ras.getSampleModel(), ras.getDataBuffer(), new Point(ras.getSampleModelTranslateX(), ras.getSampleModelTranslateY()));
/*     */     }
/*     */
/* 182 */     if ((wRas.getMinX() != 0) || (wRas.getMinY() != 0)) {
/* 183 */       wRas = wRas.createWritableTranslatedChild(0, 0);
/*     */     }
/*     */
/* 187 */     com.sun.image.codec.jpeg.JPEGEncodeParam j2dEP = null;
/*     */     BufferedImage bi;
/* 188 */     if ((colorModel instanceof IndexColorModel))
View Full Code Here

/*  373 */       int tileMinY = this.tiledImage.tileYToY(tileY);
/*  374 */       for (int tileX = minTileX; tileX <= maxTileX; tileX++) {
/*  375 */         int tileMinX = this.tiledImage.tileXToX(tileX);
/*      */
/*  378 */         WritableRaster wr = this.tiledImage.getWritableTile(tileX, tileY);
/*  379 */         wr = wr.createWritableTranslatedChild(0, 0);
/*      */
/*  382 */         BufferedImage bi = new BufferedImage(this.colorModel, wr, this.colorModel.isAlphaPremultiplied(), this.properties);
/*      */
/*  388 */         Graphics2D g2d = bi.createGraphics();
/*      */
View Full Code Here

        // it fails to properly divide out the Alpha (it always does
        // the affine on premultiplied data). We help it out by
        // premultiplying for it.
        srcCM = GraphicsUtil.coerceData(srcWR, srcCM, true);
        srcBI = new BufferedImage(srcCM,
                                  srcWR.createWritableTranslatedChild(0,0),
                                  srcCM.isAlphaPremultiplied(), null);

        myBI = new BufferedImage(myCM,wr.createWritableTranslatedChild(0,0),
                                 myCM.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.