/** * Sets every samples in the given image to the given value. This method is typically used for * clearing an image content. * * @param image The image to fill. * @param value The value to to given to every samples. */ public static void fill(final WritableRenderedImage image, final Number value) { int y = image.getMinTileY(); for (int ny = image.getNumYTiles(); --ny >= 0; ) { int x = image.getMinTileX(); for (int nx = image.getNumXTiles(); --nx >= 0; ) { final WritableRaster raster = image.getWritableTile(x, y); try { fill(raster.getDataBuffer(), value); } finally { image.releaseWritableTile(x, y); } } } }
/** * Sets every samples in the given image to the given value. This method is typically used * for clearing an image content. * * @param image The image to fill. * @param value The value to be given to every samples. */ public static void fill(final WritableRenderedImage image, final Number value) { int y = image.getMinTileY(); for (int ny = image.getNumYTiles(); --ny >= 0; y++) { int x = image.getMinTileX(); for (int nx = image.getNumXTiles(); --nx >= 0; x++) { final WritableRaster raster = image.getWritableTile(x, y); try { fill(raster.getDataBuffer(), value); } finally { image.releaseWritableTile(x, y); } } } }
/** * Sets every samples in the given image to the given value. This method is typically used * for clearing an image content. * * @param image The image to fill. * @param value The value to to given to every samples. */ public static void fill(final WritableRenderedImage image, final Number value) { int y = image.getMinTileY(); for (int ny = image.getNumYTiles(); --ny >= 0;) { int x = image.getMinTileX(); for (int nx = image.getNumXTiles(); --nx >= 0;) { final WritableRaster raster = image.getWritableTile(x, y); try { fill(raster.getDataBuffer(), value); } finally { image.releaseWritableTile(x, y); } } } }
|| renderedImage.getNumXTiles() != writableRI.getNumXTiles() || renderedImage.getNumYTiles() != writableRI.getNumYTiles() || renderedImage.getTileGridXOffset() != writableRI.getTileGridXOffset()
final int tileHeight = image.getTileHeight(); final int minTileY = image.getMinTileY(); final int maxTileY = image.getNumXTiles() + minTileY - 1; // inclusive. while (!stack.isEmpty()) { final int y = stack.removeLast() + ymin;
|| renderedImage.getHeight() != writableRI.getHeight() || rimtx != wrimtx || rimty != wrimty || renderedImage.getNumXTiles() != writableRI.getNumXTiles() || renderedImage.getNumYTiles() != writableRI.getNumYTiles()) throw new IllegalArgumentException("rendered image and writable rendered image dimensions are not conform"+renderedImage+writableRI);