Package java.awt.image

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


     int endY = YToTileY(bounds.y + bounds.height - 1);
     Raster tile;

     if ((startX == endX) && (startY == endY)) {
         tile = getTile(startX, startY);
         return tile.createChild(bounds.x, bounds.y,
                                 bounds.width, bounds.height,
                                 bounds.x, bounds.y, null);
     } else {
         // Create a WritableRaster of the desired size
         SampleModel sm =
View Full Code Here


            int numBands = ras.getNumBands() - 1;
            int[] bandList = new int[numBands];
            for (int i = 0; i < numBands; i++) {
                bandList[i] = i;
            }
            ras = ras.createChild(0, 0,
                                  ras.getWidth(), ras.getHeight(),
                                  0, 0,
                                  bandList);
        }
View Full Code Here

        // If the bounds are contained in a single tile, return a child
        // of that tile's Raster.
        if ((startX == endX) && (startY == endY)) {
            Raster tile = getTile(startX, startY);
            return tile.createChild(bounds.x, bounds.y,
                                    bounds.width, bounds.height,
                                    bounds.x, bounds.y, null);
        } else {
            // Recalculate the tile limits if the data bounds are not a
            // subset of the image bounds.
View Full Code Here

        Raster tile = getSourceImage(0).getTile(tileX, tileY);

        if(areDataCopied) {
            // Copy the data as there is no concrete ColorModel for
            // a SinglePixelPackedSampleModel with numBands < 3.
            tile = tile.createChild(tile.getMinX(), tile.getMinY(),
                                    tile.getWidth(), tile.getHeight(),
                                    tile.getMinX(), tile.getMinY(),
                                    bandIndices);
            WritableRaster raster = createTile(tileX, tileY);
            raster.setRect(tile);
View Full Code Here

            raster.setRect(tile);

            return raster;
        } else {
            // Simply return a child of the corresponding source tile.
            return tile.createChild(tile.getMinX(), tile.getMinY(),
                                    tile.getWidth(), tile.getHeight(),
                                    tile.getMinX(), tile.getMinY(),
                                    bandIndices);
        }
    }
View Full Code Here

        }

        // For sub-banded image return appropriate band subset.
        Raster r = (Raster)tiles[tileX - minTileX][tileY - minTileY];

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

                // Ensure that the source tile doesn't lie outside the
                // destination tile.
                if(!dstRect.contains(srcRect)) {
                    srcRect = dstRect.intersection(srcRect);
                    srcTile =
                        srcTile.createChild(srcTile.getMinX(),
                                            srcTile.getMinY(),
                                            srcRect.width,
                                            srcRect.height,
                                            srcRect.x,
                                            srcRect.y,
View Full Code Here

        // Save a reference to the source Raster.
        Raster source = sources[0];

        // Ensure the source Raster has the same bounds as the destination.
        if(!destRect.equals(source.getBounds())) {
            source = source.createChild(destRect.x, destRect.y,
                                        destRect.width, destRect.height,
                                        destRect.x, destRect.y,
                                        null);
        }
View Full Code Here

            Raster s = src;
            if (s.getMinX() != destRect.x ||
                s.getMinY() != destRect.y ||
                s.getWidth() != destRect.width ||
                s.getHeight() != destRect.height) {
                s = s.createChild(destRect.x, destRect.y,
                                  destRect.width, destRect.height,
                                  destRect.x, destRect.y, null);
            }
            WritableRaster d = dest;
            if (d.getMinX() != destRect.x ||
View Full Code Here

        int yt0 = getYTile(rect.y);
        int yt1 = getYTile(rect.y+rect.height-1);

        if ((xt0 == xt1) && (yt0 == yt1)) {
            Raster r = getTile(xt0, yt0);
            return r.createChild(rect.x, rect.y, rect.width, rect.height,
                                 rect.x, rect.y, null);
        }
        // rect crosses tile boundries...
        return super.getData(rect);
    }
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.