AffineTransform transform =
(AffineTransform)args.getObjectParameter(0);
Interpolation interp = (Interpolation)args.getObjectParameter(1);
double[] backgroundValues = (double[])args.getObjectParameter(2);
RenderedImage source = args.getRenderedSource(0);
if (!MediaLibAccessor.isMediaLibCompatible(args, layout) ||
!MediaLibAccessor.hasSameNumBands(args, layout) ||
// Medialib cannot deal with source image having tiles with any
// dimension greater than or equal to 32768
source.getTileWidth() >= 32768 ||
source.getTileHeight() >= 32768) {
return null;
}
SampleModel sm = source.getSampleModel();
boolean isBilevel = (sm instanceof MultiPixelPackedSampleModel) &&
(sm.getSampleSize(0) == 1) &&
(sm.getDataType() == DataBuffer.TYPE_BYTE ||
sm.getDataType() == DataBuffer.TYPE_USHORT ||
sm.getDataType() == DataBuffer.TYPE_INT);