Package java.awt.image

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


    public static WritableRaster copyRaster(Raster ras, int minX, int minY) {
        WritableRaster newSrcWR;
        WritableRaster ret = Raster.createWritableRaster
            (ras.getSampleModel(),
             new Point(0,0));
        ret = ret.createWritableChild
            (ras.getMinX()-ras.getSampleModelTranslateX(),
             ras.getMinY()-ras.getSampleModelTranslateY(),
             ras.getWidth(), ras.getHeight(),
             minX, minY, null);
View Full Code Here


                                                    int minX, int minY) {
        WritableRaster ret = Raster.createWritableRaster
            (ras.getSampleModel(),
             ras.getDataBuffer(),
             new Point(0,0));
        ret = ret.createWritableChild
            (ras.getMinX()-ras.getSampleModelTranslateX(),
             ras.getMinY()-ras.getSampleModelTranslateY(),
             ras.getWidth(), ras.getHeight(),
             minX, minY, null);
        return ret;
View Full Code Here

     */
    public static WritableRaster copyRaster(Raster ras, int minX, int minY) {
        WritableRaster ret = Raster.createWritableRaster
            (ras.getSampleModel(),
             new Point(0,0));
        ret = ret.createWritableChild
            (ras.getMinX()-ras.getSampleModelTranslateX(),
             ras.getMinY()-ras.getSampleModelTranslateY(),
             ras.getWidth(), ras.getHeight(),
             minX, minY, null);

View Full Code Here

                                                    int minX, int minY) {
        WritableRaster ret = Raster.createWritableRaster
            (ras.getSampleModel(),
             ras.getDataBuffer(),
             new Point(0,0));
        ret = ret.createWritableChild
            (ras.getMinX()-ras.getSampleModelTranslateX(),
             ras.getMinY()-ras.getSampleModelTranslateY(),
             ras.getWidth(), ras.getHeight(),
             minX, minY, null);
        return ret;
View Full Code Here

            // image tile, the tile dimensions might differ from the
            // image dimensions.
            if (wRas.getMinX() != 0 || wRas.getMinY() != 0 ||
                wRas.getWidth() != im.getWidth() ||
                wRas.getHeight() != im.getHeight())
                wRas = wRas.createWritableChild(wRas.getMinX(),
                                                wRas.getMinY(),
                                                im.getWidth(),
                                                im.getHeight(),
                                                0, 0,
                                                null);
View Full Code Here

            WritableRaster d = dest;
            if (d.getMinX() != destRect.x ||
                d.getMinY() != destRect.y ||
                d.getWidth() != destRect.width ||
                d.getHeight() != destRect.height) {
                d = d.createWritableChild(destRect.x, destRect.y,
                                           destRect.width, destRect.height,
                                          destRect.x, destRect.y, null);
            }

            // Perform the color conversion on the (possible child) Rasters.
View Full Code Here

                                // the requested tile is completely within "src".
                                if (tileRect.equals(tile.getBounds()))
                                    src.copyData(tile);
                                else
                                    src.copyData(
                                        tile.createWritableChild(rect.x, rect.y,
                                                                 rect.width,
                                                                 rect.height,
                                                                 rect.x,
                                                                 rect.y,
                                                                 null));
View Full Code Here

        }

        // For sub-banded image return appropriate band subset.
        WritableRaster wr = tiles[tileX - minTileX][tileY - minTileY];

        return wr.createWritableChild(wr.getMinX(), wr.getMinY(),
                                      wr.getWidth(), wr.getHeight(),
                                      wr.getMinX(), wr.getMinY(),
                                      bandList);
    }
View Full Code Here

        int px = minX - raster.getSampleModelTranslateX();
        int py = minY - raster.getSampleModelTranslateY();
        if (px != 0 || py != 0 || width != wRaster.getWidth() ||
            height != wRaster.getHeight()) {
            wRaster =
                wRaster.createWritableChild(px,
                                            py,
                                            width,
                                            height,
                                            0, 0,
                                            null);
View Full Code Here

                                                    null);
                }

                // Translate wRaster to start at (0, 0) and to contain
                // only the relevent portion of the tile
                wRaster = wRaster.createWritableChild(tileRect.x, tileRect.y,
                                                      tileRect.width,
                                                      tileRect.height,
                                                      0, 0,
                                                      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.