Package net.sourceforge.jiu.ops
Class ImagesToImageOperation
- java.lang.Object
-
- net.sourceforge.jiu.ops.Operation
-
- net.sourceforge.jiu.ops.ImagesToImageOperation
-
public abstract class ImagesToImageOperation extends Operation
An operation that takes several input images and produces one output image.- Since:
- 0.11.0
- Author:
- Marco Schmidt
-
-
Field Summary
Fields Modifier and Type Field Description private VectorinputImagesprivate PixelImageoutputImage
-
Constructor Summary
Constructors Constructor Description ImagesToImageOperation()Constructs a new ImagesToImageOperation and initializes input images and output image to null.ImagesToImageOperation(Vector in, PixelImage out)Constructs a new ImagesToImageOperation and initializes input images and output image to the arguments.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddInputImage(PixelImage in)Adds an image to the end of the internal list of input images.voidensureImagesHaveSameResolution()Checks if all images have the same resolution as given by their getWidth and getHeight methods.voidensureOutputImageResolution(int width, int height)If an output image has been specified this method will compare its resolution with the argument resolution and throw an exception if the resolutions differ.PixelImagegetInputImage(int index)Returns the input image stored in this object.intgetNumInputImages()Return the number of input images currently stored in this operation.PixelImagegetOutputImage()Returns the output image stored in this object.voidsetOutputImage(PixelImage out)Sets the output image stored in this object to the argument.-
Methods inherited from class net.sourceforge.jiu.ops.Operation
addProgressListener, addProgressListeners, getAbort, process, removeProgressListener, setAbort, setProgress, setProgress
-
-
-
-
Field Detail
-
inputImages
private Vector inputImages
-
outputImage
private PixelImage outputImage
-
-
Constructor Detail
-
ImagesToImageOperation
public ImagesToImageOperation()
Constructs a new ImagesToImageOperation and initializes input images and output image to null.
-
ImagesToImageOperation
public ImagesToImageOperation(Vector in, PixelImage out)
Constructs a new ImagesToImageOperation and initializes input images and output image to the arguments.
-
-
Method Detail
-
addInputImage
public void addInputImage(PixelImage in)
Adds an image to the end of the internal list of input images.
-
ensureImagesHaveSameResolution
public void ensureImagesHaveSameResolution() throws WrongParameterExceptionChecks if all images have the same resolution as given by their getWidth and getHeight methods. This method will not complain if input and / or output images are not available.- Throws:
WrongParameterException- if input and output images exist and their resolutions differ
-
ensureOutputImageResolution
public void ensureOutputImageResolution(int width, int height) throws WrongParameterExceptionIf an output image has been specified this method will compare its resolution with the argument resolution and throw an exception if the resolutions differ. If no output image has been specified nothing happens.- Parameters:
width- the horizontal pixel resolution that the output image must haveheight- the vertical pixel resolution that the output image must have- Throws:
WrongParameterException- if the resolutions differ
-
getInputImage
public PixelImage getInputImage(int index)
Returns the input image stored in this object.- Returns:
- input image, possibly
null
-
getNumInputImages
public int getNumInputImages()
Return the number of input images currently stored in this operation.- Returns:
- number of images
-
getOutputImage
public PixelImage getOutputImage()
Returns the output image stored in this object.- Returns:
- output image, possibly
null
-
setOutputImage
public void setOutputImage(PixelImage out)
Sets the output image stored in this object to the argument. Argument can benull.- Parameters:
out- the new output image of this object
-
-