static RGBImage rgbContrastAndBrightness(RGBImage img, float scaleFactor, float offset) { BufferedImage i = cloneBufferedImage(img.getBufferedImage()); new RescaleOp(scaleFactor, offset, null).filter(i, i); ret new RGBImage(i); } static RGBImage rgbContrastAndBrightness(float scaleFactor, float offset, RGBImage img) { ret rgbContrastAndBrightness(img, scaleFactor, offset); } static RGBImage rgbContrastAndBrightness(float scaleFactor, float offset, BufferedImage img) { BufferedImage i = cloneBufferedImage(img); new RescaleOp(scaleFactor, offset, null).filter(i, i); ret new RGBImage(i); }