Package com.google.code.appengine.awt

Examples of com.google.code.appengine.awt.Rectangle


            if (!src1.sorted || !src2.sorted ||
               src1.getRectCount() <= MAX_SIMPLE || src2.getRectCount() <= MAX_SIMPLE)
            {
                simpleUnion(src1, src2, dst);
            } else {
                Rectangle bounds1 = src1.getBounds();
                Rectangle bounds2 = src2.getBounds();
                Rectangle bounds3 = bounds1.intersection(bounds2);

                if (bounds3.width < 0 || bounds3.height < 0) {
                    if (bounds1.y + bounds1.height < bounds2.y) {
                        dst.setRect(addVerRegion(src1.rect, src2.rect), false);
                    } else
View Full Code Here


            if (!src1.sorted || !src2.sorted ||
               src1.getRectCount() <= MAX_SIMPLE || src2.getRectCount() <= MAX_SIMPLE)
            {
                simpleSubtract(src1, src2, dst);
            } else {
                Rectangle bounds1 = src1.getBounds();
                Rectangle bounds2 = src2.getBounds();
                Rectangle bounds3 = bounds1.intersection(bounds2);

                if (bounds3.width > 0 && bounds3.height > 0) {
                    subtractRegions(src1.rect, src2.rect, dst, bounds1.height + 2, bounds2.height + 2);
                } else {
                    dst.setRect(src1.rect, true);
View Full Code Here

        ba.addDataBufferListener(db, this);
        ColorSpace cs = cm.getColorSpace();
        transparency = cm.getTransparency();
        width = raster.getWidth();
        height = raster.getHeight();
        addDirtyRegion(new Rectangle(0, 0, width, height));

        // For the moment we can build natively only images which have
        // sRGB, Linear_RGB, Linear_Gray Color Space and type different
        // from BufferedImage.TYPE_CUSTOM
        if(cs == LUTColorConverter.sRGB_CS){
View Full Code Here

                WritableRaster dstR = dstSurf.getRaster();

                transformedBlit(srcCM, srcR, 0, 0, dstCM, dstR, dstX, dstY, w, h,
                        sysxform, comp, bgcolor, clip);
               
                Rectangle dirtyReg = JavaBlitter.getBounds2D(sysxform, new Rectangle(dstX, dstY, w, h)).getBounds();
                Rectangle bounds = new Rectangle(dstSurf.getWidth(), dstSurf.getHeight()).getBounds();
                dstSurf.addDirtyRegion(bounds.intersection(dirtyReg));

        }
    }
View Full Code Here

                srcSurf.getColorModel(), srcSurf.getRaster(), dstX, dstY,
                dstSurf.getWidth(), dstSurf.getHeight(),
                dstSurf.getColorModel(), dstSurf.getRaster(),
                width, height, comp, bgcolor, clip);

        dstSurf.addDirtyRegion(new Rectangle(dstX, dstY, width, height));

    }
View Full Code Here

    private void transformedBlit(ColorModel srcCM, Raster srcR, int srcX, int srcY,
            ColorModel dstCM, WritableRaster dstR, int dstX, int dstY,
            int width, int height, AffineTransform at, Composite comp,
            Color bgcolor,MultiRectArea clip) {

        Rectangle srcBounds = new Rectangle(srcX, srcY, width, height);
        Rectangle dstBlitBounds = new Rectangle(dstX, dstY, width, height);

        Rectangle transSrcBounds = getBounds2D(at, srcBounds).getBounds();
        Rectangle transDstBlitBounds = getBounds2D(at, dstBlitBounds).getBounds();

        int translateX = transDstBlitBounds.x - transSrcBounds.x;
        int translateY = transDstBlitBounds.y - transSrcBounds.y;

        AffineTransform inv = null;
        try {
             inv = at.createInverse();
        } catch (NoninvertibleTransformException e) {
            return;
        }

        double[] m = new double[6];
        inv.getMatrix(m);

        int clipRects[];
        if(clip != null) {
            clipRects = clip.rect;
        } else {
            clipRects = new int[]{5, 0, 0, dstR.getWidth(), dstR.getHeight()};
        }

        int compType = 0;
        int srcConstAlpha = 0;
        int rule = 0;
        int bgRGB = bgcolor == null ? 0 : bgcolor.getRGB();
        int srcRGB = 0, dstRGB = 0;
        Object srcVal = null, dstVal = null;
        if(comp instanceof AlphaComposite){
            compType = AlphaCompositeMode;
            AlphaComposite ac = (AlphaComposite) comp;
            rule = ac.getRule();
            srcConstAlpha = (int)(ac.getAlpha() * 255 + 0.5f);
        }else if(comp instanceof XORComposite){
            compType = XORMode;
            XORComposite xor = (XORComposite) comp;
            bgRGB = xor.getXORColor().getRGB();
        }

        for(int i = 1; i < clipRects[0]; i += 4){
            Rectangle dstBounds = new Rectangle(clipRects[i], clipRects[i + 1], 0, 0);
            dstBounds.add(clipRects[i + 2] + 1, clipRects[i + 1]);
            dstBounds.add(clipRects[i + 2] + 1, clipRects[i + 3] + 1);
            dstBounds.add(clipRects[i], clipRects[i + 3] + 1);

            Rectangle bounds = dstBounds.intersection(transDstBlitBounds);

            int minSrcX = srcBounds.x;
            int minSrcY = srcBounds.y;
            int maxSrcX = minSrcX + srcBounds.width;
            int maxSrcY = minSrcY + srcBounds.height;
View Full Code Here

            }
        }
       
        ba.releaseData(db);
        if (imageSurf != null) {
            imageSurf.addDirtyRegion(new Rectangle(x, y, w, h));
        }

        imageUpdate(ImageObserver.SOMEBITS);
    }
View Full Code Here

            }
        }

        ba.releaseData(db);
        if (imageSurf != null) {
            imageSurf.addDirtyRegion(new Rectangle(x, y, w, h));
        }

        imageUpdate(ImageObserver.SOMEBITS);
    }
View Full Code Here

    private Rectangle bounds = null;

    public BufferedImageGraphics2D(BufferedImage bi) {
        super();
        this.bi = bi;
        this.bounds = new Rectangle(0, 0, bi.getWidth(), bi.getHeight());
        clip(bounds);
        dstSurf = Surface.getImageSurface(bi);
        blitter = JavaBlitter.getInstance();
    }
View Full Code Here

        double minY = 0;
        double maxX = 0;
        double maxY = 0;

        for (int i = 0; i < this.getNumGlyphs(); i++) {
            Rectangle glyphBounds = this.getGlyphPixelBounds(i, frc, 0, 0);
            xm = glyphBounds.getMinX();
            ym = glyphBounds.getMinY();
            xM = glyphBounds.getMaxX();
            yM = glyphBounds.getMaxY();

            if (i == 0) {
                minX = xm;
                minY = ym;
                maxX = xM;
                maxY = yM;
            }

            if (minX > xm) {
                minX = xm;
            }
            if (minY > ym) {
                minY = ym;
            }
            if (maxX < xM) {
                maxX = xM;
            }
            if (maxY < yM) {
                maxY = yM;
            }
        }
        return new Rectangle((int)(minX + x), (int)(minY + y), (int)(maxX - minX), (int)(maxY - minY));

    }
View Full Code Here

TOP

Related Classes of com.google.code.appengine.awt.Rectangle

Copyright © 2018 www.massapicom. 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.