Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
net.sourceforge.jiu.ops.Operation
net.sourceforge.jiu.ops.ImageToImageOperation
net.sourceforge.jiu.color.Invert
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.
Field Summary |
Fields inherited from class net.sourceforge.jiu.ops.ImageToImageOperation | |
canInAndOutBeEqual , inputImage , outputImage |
Fields inherited from class net.sourceforge.jiu.ops.Operation | |
abort , progressListeners |
Method Summary | |
static PixelImage |
|
private void |
|
void |
|
private void |
|
private void |
Methods inherited from class net.sourceforge.jiu.ops.ImageToImageOperation | |
canInputAndOutputBeEqual , ensureImagesHaveSameResolution , ensureInputImageIsAvailable , ensureOutputImageResolution , getInputImage , getOutputImage , setCanInputAndOutputBeEqual , setInputImage , setOutputImage |
Methods inherited from class net.sourceforge.jiu.ops.Operation | |
addProgressListener , addProgressListeners , getAbort , process , removeProgressListener , setAbort , setProgress , setProgress |
public static PixelImage invert(PixelImage inputImage) throws OperationFailedException
Helper method to return an inverted image from the argument image.
- Parameters:
inputImage
- image to be inverted
- Returns:
- new image object with inverted image
- Throws:
OperationFailedException
- on operation errors
private void prepare(PixelImage in) throws MissingParameterException, WrongParameterException
public void process() throws MissingParameterException, WrongParameterException
Inverts the input image, reusing an output image if one has been specified. For paletted images, inverts the palette. For all other types, subtracts each sample of each channel from the maximum value of that channel.
- Throws:
MissingParameterException
- if the input image is missingWrongParameterException
- if any of the specified image parameters are unsupported or of the wrong width or height