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 Vector`
`inputImages`
`private PixelImage`
`outputImage`

## 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

Modifier and Type
Method
Description
`void`
`addInputImage(PixelImage in)`
Adds an image to the end of the internal list of input images.
`void`
`ensureImagesHaveSameResolution()`
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.
`PixelImage`
`getInputImage(int index)`
Returns the input image stored in this object.
`int`
`getNumInputImages()`
Return the number of input images currently stored in this operation.
`PixelImage`
`getOutputImage()`
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`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### inputImages

private Vector inputImages

### outputImage

private PixelImage outputImage

## Constructor Details

### 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 Details

### addInputImage

public void addInputImage(PixelImage in)
Adds an image to the end of the internal list of input images.

### ensureImagesHaveSameResolution

public void ensureImagesHaveSameResolution() throws WrongParameterException
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

public void ensureOutputImageResolution(int width, int height) throws WrongParameterException
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 have
  `height` - 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 be `null`.

Parameters:
  `out` - the new output image of this object