public final WritableRaster filter(Raster src, WritableRaster dst) {
if (conversionSequence.length < 2) {
throw new IllegalArgumentException(Messages.getString("awt.25D")); //$NON-NLS-1$
}
ICC_Profile srcPf = null, dstPf = null; // unused if isICC is false
int nSrcColorComps, nDstColorComps;
Object first = conversionSequence[0];
Object last = conversionSequence[conversionSequence.length - 1];
// Get the number of input/output color components
if (isICC) {
srcPf = (ICC_Profile) first;
dstPf = (ICC_Profile) last;
nSrcColorComps = srcPf.getNumComponents();
nDstColorComps = dstPf.getNumComponents();
} else {
if (first instanceof ICC_Profile) {
srcPf = (ICC_Profile) first;
nSrcColorComps = srcPf.getNumComponents();
} else {
nSrcColorComps = ((ColorSpace) first).getNumComponents();
}
if (last instanceof ICC_Profile) {