colorConvertOp.filter(s, d);
}
} else {
//For the floating point data types, convert via CIEXYZ color space.
//Do it pixel-by-pixel (slow!).
ColorSpace srcColorSpace = srcParam.getColorModel().getColorSpace();
ColorSpace dstColorSpace = dstParam.getColorModel().getColorSpace();
boolean srcFloat = srcParam.isFloat();
float srcMinValue = srcParam.getMinValue();
float srcRange = srcParam.getRange();
boolean dstFloat = dstParam.isFloat();
float dstMinValue = dstParam.getMinValue();
float dstRange = dstParam.getRange();
int rectYMax = destRect.y + destRect.height;
int rectXMax = destRect.x + destRect.width;
int numComponents = srcColorSpace.getNumComponents();
float[] srcPixel = new float[numComponents];
float[] xyzPixel;
float[] dstPixel;
for (int y = destRect.y; y < rectYMax; y++) {
for (int x = destRect.x; x < rectXMax; x++) {
srcPixel = src.getPixel(x, y, srcPixel);
if (!srcFloat) {
// Normalize the source samples.
for (int i = 0; i < numComponents; i++) {
srcPixel[i] = (srcPixel[i] - srcMinValue)/srcRange;
}
}
// Convert src to dst via CIEXYZ.
synchronized (CMM.class) {
xyzPixel = srcColorSpace.toCIEXYZ(srcPixel);
dstPixel = dstColorSpace.fromCIEXYZ(xyzPixel);
}
if (!dstFloat) {
// Scale the destination samples.
for (int i = 0; i < numComponents; i++) {