/** * Performs a contrast enhancement operation on the input image. Note that not all the contrast * enhancement operations have been implemented in a way that is generic enough o handle all * data types. * * @param inputImage the input {@link RenderedImage} to work on. * @param hints {@link Hints} to control the contrast enhancement process. * @return a {@link RenderedImage} on which a contrast enhancement has been performed. */ private RenderedImage performContrastEnhancement(ImageWorker inputWorker, final Hints hints) { inputWorker.setRenderingHints(hints); if (contrastEnhancementMethod != null) { RenderedImage inputImage = inputWorker.getRenderedImage(); assert inputImage.getSampleModel().getNumBands() == 1 : inputImage; ContrastEnhancementType ceType = ContrastEnhancementType.getType(contrastEnhancementMethod); return ceType.process(inputWorker, hints, contrastEnhancementMethod.getParameters()); } return inputWorker.getRenderedImage(); }