}
}
public void doTransform(ByteInterleavedRaster input, ByteInterleavedRaster output) {
if (cmsTransform != null) {
ByteInterleavedRaster ri = normalizeRaster(input);
ByteInterleavedRaster ro;
int outBands = output.getNumBands();
if (!input.getBounds().equals(output.getBounds())) {
int[] offsets = outBands == 1 ? new int[] {0} : new int[] {0, 1, 2};
SampleModel sm = new PixelInterleavedSampleModel(DataBuffer.TYPE_BYTE,
ri.getWidth(), ri.getHeight(),
outBands, outBands * ri.getWidth(),
offsets);
ro = new ByteInterleavedRaster(sm, new Point(ri.getMinX(), ri.getMinY()));
} else
ro = normalizeRaster(output);
int pixels = outBands == 1 ? ro.getDataStorage().length : ro.getDataStorage().length / outBands;
cmsDoTransform(cmsTransform.handle, ri.getDataStorage(), ro.getDataStorage(), pixels);
if (ro != output)
Functions.copyData(output, ro);
}
}