// org.apache.flex.forks.batik.test.gvt.ImageDisplay.printImage
// ("Padded Image", ri,
// new Rectangle(ri.getMinX()+22,ri.getMinY()+38,5,5));
CachableRed cr = convertSourceCS(ri);
Shape devShape = srcAt.createTransformedShape(aoi);
Rectangle2D devRect = devShape.getBounds2D();
r = devRect;
r = new Rectangle2D.Double(Math.floor(r.getX()-kx),
Math.floor(r.getY()-ky),
Math.ceil (r.getX()+r.getWidth())-
Math.floor(r.getX())+(kw-1),
Math.ceil (r.getY()+r.getHeight())-
Math.floor(r.getY())+(kh-1));
if (!r.getBounds().equals(cr.getBounds())) {
if (edgeMode == PadMode.WRAP)
throw new IllegalArgumentException
("edgeMode=\"wrap\" is not supported by ConvolveMatrix.");
cr = new PadRed(cr, r.getBounds(), edgeMode, rh);
}
// org.apache.flex.forks.batik.test.gvt.ImageDisplay.printImage
// ("Padded Image", cr,
// new Rectangle(cr.getMinX()+23,cr.getMinY()+39,5,5));
if (bias != 0.0)
throw new IllegalArgumentException
("Only bias equal to zero is supported in ConvolveMatrix.");
BufferedImageOp op = new ConvolveOp(kernel,
ConvolveOp.EDGE_NO_OP,
rh);
ColorModel cm = cr.getColorModel();
// OK this is a bit of a cheat. We Pull the DataBuffer out of
// The read-only raster that getData gives us. And use it to
// build a WritableRaster. This avoids a copy of the data.
Raster rr = cr.getData();
WritableRaster wr = GraphicsUtil.makeRasterWritable(rr, 0, 0);
// Here we update the translate to account for the phase shift
// (if any) introduced by setting targetX, targetY in SVG.
int phaseShiftX = target.x - kernel.getXOrigin();