// byte colorMaps only
return null;
}
// Check source compatibility.
SampleModel sourceSM = source.getSampleModel();
if(sourceSM.getDataType() != DataBuffer.TYPE_BYTE) {
// byte source images only
return null;
} else if(sourceSM.getNumBands() != colorMap.getNumBands()) {
// band counts must match
return null;
}
// Get ImageLayout from RenderingHints if any.
ImageLayout layoutHint = RIFUtil.getImageLayoutHint(hints);
// Calculate the final ImageLayout.
ImageLayout layout =
MlibOrderedDitherOpImage.layoutHelper(layoutHint,
source, colorMap);
// Check for source and destination compatibility. The ColorModel
// is suppressed in the second test because it will be an
// IndexColorModel which would cause the test to fail.
SampleModel destSM = layout.getSampleModel(null);
if (!MediaLibAccessor.isMediaLibCompatible(args) ||
(!MediaLibAccessor.isMediaLibCompatible(destSM, null) &&
!ImageUtil.isBinary(destSM))) {
return null;
}