srcBounds = src.getBounds();
}
// If necessary, clip the ROI to the effective source bounds.
if(!srcBounds.contains(srcROI.getBounds())) {
srcROI = srcROI.intersect(new ROIShape(srcBounds));
}
// Retrieve the scale factors and translation values.
double sx = pb.getDoubleParameter(0);
double sy = pb.getDoubleParameter(1);
// Create an equivalent transform.
AffineTransform transform =
new AffineTransform(sx, 0.0, 0.0, sy, 0, 0);
// Create the scaled ROI.
ROI dstROI = srcROI.transform(transform);
// Retrieve the destination bounds.
Rectangle dstBounds = op.getBounds();
// If necessary, clip the warped ROI to the destination bounds.
if(!dstBounds.contains(dstROI.getBounds())) {
dstROI = dstROI.intersect(new ROIShape(dstBounds));
}
// Return the warped and possibly clipped ROI.
return dstROI;
} else {