return 0;
}
public final BufferedImage filter(BufferedImage src, BufferedImage dst) {
ColorModel srcCM = src.getColorModel();
if (srcCM instanceof IndexColorModel) {
// awt.220=Source should not have IndexColorModel
throw new IllegalArgumentException(Messages.getString("awt.220")); //$NON-NLS-1$
}
// Check if the number of scaling factors matches the number of bands
int nComponents = srcCM.getNumComponents();
boolean skipAlpha;
if (srcCM.hasAlpha()) {
if (scaleFactors.length == 1 || scaleFactors.length == nComponents-1) {
skipAlpha = true;
} else if (scaleFactors.length == nComponents) {
skipAlpha = false;
} else {
// awt.21E=Number of scaling constants is not equal to the number of bands
throw new IllegalArgumentException(Messages.getString("awt.21E")); //$NON-NLS-1$
}
} else if (scaleFactors.length == 1 || scaleFactors.length == nComponents) {
skipAlpha = false;
} else {
// awt.21E=Number of scaling constants is not equal to the number of bands
throw new IllegalArgumentException(Messages.getString("awt.21E")); //$NON-NLS-1$
}
BufferedImage finalDst = null;
if (dst == null) {
dst = createCompatibleDestImage(src, srcCM);
} else if (!srcCM.equals(dst.getColorModel())) {
// Treat BufferedImage.TYPE_INT_RGB and BufferedImage.TYPE_INT_ARGB as same
if (
!((src.getType() == BufferedImage.TYPE_INT_RGB ||
src.getType() == BufferedImage.TYPE_INT_ARGB) &&
(dst.getType() == BufferedImage.TYPE_INT_RGB ||