public class Invert extends ImageToImageOperation
IntegerImage.getMaxSample(int).
For paletted images, just the palette is treated that way.
Supported image types: IntegerImage.
Input and output image can be the same object.
Invert invert = new Invert(); invert.setInputImage(image); invert.addProgressListener(listener); // this is optional invert.process(); PixelImage invertedImage = invert.getOutputImage();The other method is by sing the static convenience method
PixelImage invertedImage = Invert.invert(someImage);You will have to catch the potential exceptions in both cases.
| Constructor and Description |
|---|
Invert() |
| Modifier and Type | Method and Description |
|---|---|
static PixelImage |
invert(PixelImage inputImage)
Helper method to return an inverted image from the argument image.
|
private void |
prepare(PixelImage in) |
void |
process()
Inverts the input image, reusing an output image if one has been specified.
|
private void |
process(IntegerImage in) |
private void |
process(Paletted8Image in) |
canInputAndOutputBeEqual, ensureImagesHaveSameResolution, ensureInputImageIsAvailable, ensureOutputImageResolution, getInputImage, getOutputImage, setCanInputAndOutputBeEqual, setInputImage, setOutputImageaddProgressListener, addProgressListeners, getAbort, removeProgressListener, setAbort, setProgress, setProgresspublic static PixelImage invert(PixelImage inputImage) throws OperationFailedException
inputImage - image to be invertedOperationFailedException - on operation errorsprivate void prepare(PixelImage in) throws MissingParameterException, WrongParameterException
private void process(Paletted8Image in)
private void process(IntegerImage in)
public void process()
throws MissingParameterException,
WrongParameterException
process in class OperationMissingParameterException - if the input image is missingWrongParameterException - if any of the specified image parameters are unsupported or of the wrong width or height