Package net.sourceforge.jiu.ops
Class ImagesToImageOperation
java.lang.Object
net.sourceforge.jiu.ops.Operation
net.sourceforge.jiu.ops.ImagesToImageOperation
An operation that takes several input images and produces one output image.
- Since:
- 0.11.0
- Author:
- Marco Schmidt
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConstructs 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
Modifier and TypeMethodDescriptionvoid
Adds an image to the end of the internal list of input images.void
Checks if all images have the same resolution as given by their getWidth and getHeight methods.void
ensureOutputImageResolution
(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.getInputImage
(int index) Returns the input image stored in this object.int
Return the number of input images currently stored in this operation.Returns the output image stored in this object.void
setOutputImage
(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 Details
-
inputImages
-
outputImage
-
-
Constructor Details
-
ImagesToImageOperation
public ImagesToImageOperation()Constructs a new ImagesToImageOperation and initializes input images and output image to null. -
ImagesToImageOperation
Constructs a new ImagesToImageOperation and initializes input images and output image to the arguments.
-
-
Method Details
-
addInputImage
Adds an image to the end of the internal list of input images. -
ensureImagesHaveSameResolution
Checks 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
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. 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
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
Returns the output image stored in this object.- Returns:
- output image, possibly
null
-
setOutputImage
Sets the output image stored in this object to the argument. Argument can benull
.- Parameters:
out
- the new output image of this object
-