public WritableRaster createCompatibleDestRaster(Raster src) { return icm.createCompatibleWritableRaster(src.getWidth(), src.getHeight()) .createWritableTranslatedChild(src.getMinX(), src.getMinY()); }
/** * Makes sure the image starts at 0,0, all images coming from files do but the ones coming from * a JAI chain might not * * @param image * @return */ static final RenderedImage realignImage(RenderedImage image) { if (image.getMinX() > 0 || image.getMinY() > 0) { return new BufferedImage( image.getColorModel(), ((WritableRaster) image.getData()).createWritableTranslatedChild(0, 0), image.getColorModel().isAlphaPremultiplied(), null); } else { return image; } } }
image.getColorModel(), ((WritableRaster) image.getData()) .createWritableTranslatedChild(0, 0), image.getColorModel().isAlphaPremultiplied(), null);
this.colorModel .createCompatibleWritableRaster(w, h) .createWritableTranslatedChild(minx, miny);
private static void fillRasterFloat(WritableRaster wr, int w, int h, float[] values) { WritableRaster child = wr.createWritableTranslatedChild(0, 0); for (int y = 0; y < h; y++) { for (int x = 0; x < w; x++) { child.setPixel(x, y, values); } } }
private static void fillRasterDouble(WritableRaster wr, int w, int h, double[] values) { WritableRaster child = wr.createWritableTranslatedChild(0, 0); for (int y = 0; y < h; y++) { for (int x = 0; x < w; x++) { child.setPixel(x, y, values); } } }
private static void fillRasterDouble(WritableRaster wr, int w, int h, double[] values) { WritableRaster child = wr.createWritableTranslatedChild(0, 0); for (int y = 0; y < h; y++) { for (int x = 0; x < w; x++) { child.setPixel(x, y, values); } } }
private static void fillRasterInt(WritableRaster wr, int w, int h, int[] values) { WritableRaster child = wr.createWritableTranslatedChild(0, 0); for (int y = 0; y < h; y++) { for (int x = 0; x < w; x++) { child.setPixel(x, y, values); } } }
private static void fillRasterDouble(WritableRaster wr, int w, int h, double[] values) { WritableRaster child = wr.createWritableTranslatedChild(0, 0); for (int y = 0; y < h; y++) { for (int x = 0; x < w; x++) { child.setPixel(x, y, values); } } }
private static void fillRasterFloat(WritableRaster wr, int w, int h, float[] values) { WritableRaster child = wr.createWritableTranslatedChild(0, 0); for (int y = 0; y < h; y++) { for (int x = 0; x < w; x++) { child.setPixel(x, y, values); } } }
private static void fillRasterInt(WritableRaster wr, int w, int h, int[] values) { WritableRaster child = wr.createWritableTranslatedChild(0, 0); for (int y = 0; y < h; y++) { for (int x = 0; x < w; x++) { child.setPixel(x, y, values); } } }
private static void fillRasterFloat(WritableRaster wr, int w, int h, float[] values) { WritableRaster child = wr.createWritableTranslatedChild(0, 0); for (int y = 0; y < h; y++) { for (int x = 0; x < w; x++) { child.setPixel(x, y, values); } } }
private static void fillRasterDouble(WritableRaster wr, int w, int h, double[] values) { WritableRaster child = wr.createWritableTranslatedChild(0, 0); for (int y = 0; y < h; y++) { for (int x = 0; x < w; x++) { child.setPixel(x, y, values); } } }
private static void fillRasterInt(WritableRaster wr, int w, int h, int[] values) { WritableRaster child = wr.createWritableTranslatedChild(0, 0); for (int y = 0; y < h; y++) { for (int x = 0; x < w; x++) { child.setPixel(x, y, values); } } }
private static void fillRasterFloat(WritableRaster wr, int w, int h, float[] values) { WritableRaster child = wr.createWritableTranslatedChild(0, 0); for (int y = 0; y < h; y++) { for (int x = 0; x < w; x++) { child.setPixel(x, y, values); } } }
public WritableRaster copyData(WritableRaster wr){ CachableRed src = (CachableRed)getSources().get(0); wr = src.copyData(wr); GraphicsUtil.coerceData(wr, src.getColorModel(), false); WritableRaster srcWR = wr.createWritableTranslatedChild(0,0); operation.filter(srcWR, srcWR); return wr; } }
public WritableRaster copyData(WritableRaster wr){ CachableRed src = (CachableRed)getSources().get(0); wr = src.copyData(wr); GraphicsUtil.coerceData(wr, src.getColorModel(), false); WritableRaster srcWR = wr.createWritableTranslatedChild(0,0); operation.filter(srcWR, srcWR); return wr; } }
public WritableRaster copyData(WritableRaster wr){ CachableRed src = (CachableRed)getSources().get(0); wr = src.copyData(wr); GraphicsUtil.coerceData(wr, src.getColorModel(), false); WritableRaster srcWR = wr.createWritableTranslatedChild(0,0); operation.filter(srcWR, srcWR); return wr; } }
public WritableRaster copyData(WritableRaster wr) { WritableRaster wr2 = wr.createWritableTranslatedChild (wr.getMinX()-deltaX, wr.getMinY()-deltaY); getSource().copyData(wr2); return wr; } }
public WritableRaster copyData(WritableRaster wr) { WritableRaster wr2 = wr.createWritableTranslatedChild (wr.getMinX()-deltaX, wr.getMinY()-deltaY); getSource().copyData(wr2); return wr; } }