Package java.awt.image

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


        // 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

        // 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

                // 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

        }

        // 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

        int bitDepth = metadata.IHDR_bitDepth;
        for (int row = minY + yOffset; row < minY + height; row += ySkip) {
            Rectangle rect = new Rectangle(minX, row, width, 1);
            Raster ras = image.getData(rect);
            if (sourceBands != null) {
                ras = ras.createChild(minX, row, width, 1, minX, row,
                                      sourceBands);
            }

            ras.getPixels(minX, row, width, 1, samples);
View Full Code Here

/* 456 */     int endX = XToTileX(bounds.x + bounds.width - 1);
/* 457 */     int endY = YToTileY(bounds.y + bounds.height - 1);
/*     */
/* 461 */     if ((startX == endX) && (startY == endY)) {
/* 462 */       Raster tile = getTile(startX, startY);
/* 463 */       return tile.createChild(bounds.x, bounds.y, bounds.width, bounds.height, bounds.x, bounds.y, null);
/*     */     }
/*     */
/* 469 */     if (!imageBounds.contains(bounds)) {
/* 470 */       Rectangle xsect = bounds.intersection(imageBounds);
/* 471 */       startX = XToTileX(xsect.x);
View Full Code Here

        int bitDepth = metadata.IHDR_bitDepth;
        for (int row = minY + yOffset; row < minY + height; row += ySkip) {
            Rectangle rect = new Rectangle(minX, row, width, 1);
            Raster ras = image.getData(rect);
            if (sourceBands != null) {
                ras = ras.createChild(minX, row, width, 1, minX, row,
                                      sourceBands);
            }

            ras.getPixels(minX, row, width, 1, samples);
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.