@Override
protected void computeRect(Raster[] sources, WritableRaster dest, Rectangle destRect) {
RasterFormatTag[] formatTags = getFormatTags();
RasterAccessor s = new RasterAccessor(sources[0], destRect, formatTags[0], getSourceImage(0).getColorModel());
RasterAccessor d = new RasterAccessor(dest, destRect, formatTags[1], getColorModel());
switch (d.getDataType()) {
case 0:
computeRectByte(s, d, oldValue.byteValue(), newValue.byteValue());
break;
case 1:
case 2:
computeRectShort(s, d, oldValue.shortValue(), newValue.shortValue());
break;
case 3:
computeRectInt(s, d, oldValue.intValue(), newValue.intValue());
break;
case 4:
computeRectFloat(s, d, oldValue.floatValue(), newValue.floatValue());
break;
case 5:
computeRectDouble(s, d, oldValue.doubleValue(), newValue.doubleValue());
break;
}
d.copyDataToRaster();
}