AffineTransform at = rc.getTransform();
// For high quality output we should really apply a Gaussian
// Blur when we are scaling the image down significantly this
// helps to prevent aliasing in the result image.
CachableRed cr = getSource();
if ( ! aoiR.intersects(cr.getBounds()) )
return null;
if (at.isIdentity()) {
// System.out.println("Using as is");
return cr;
}
if ((at.getScaleX() == 1.0) && (at.getScaleY() == 1.0) &&
(at.getShearX() == 0.0) && (at.getShearY() == 0.0)) {
int xloc = (int)(cr.getMinX()+at.getTranslateX());
int yloc = (int)(cr.getMinY()+at.getTranslateY());
double dx = xloc - (cr.getMinX()+at.getTranslateX());
double dy = yloc - (cr.getMinY()+at.getTranslateY());
if (((dx > -0.0001) && (dx < 0.0001)) &&
((dy > -0.0001) && (dy < 0.0001))) {
// System.out.println("Using TranslateRed");
return new TranslateRed(cr, xloc, yloc);
}