jjil.algorithm
Class RgbStretch

java.lang.Object
  extended by jjil.core.PipelineStage
      extended by jjil.algorithm.RgbStretch

public class RgbStretch
extends PipelineStage

Stretches a color (RgbImage) to a given size. Each band is shrunk independently. The output image must be greater than or equal to the size of the input.

Author:
webb

Constructor Summary
RgbStretch(int cWidth, int cHeight)
          Creates a new instance of RgbStretch.
 
Method Summary
 int getHeight()
          Gets current target height
 int getWidth()
          Gets current target width
 void push(Image image)
          Process an image.
 void setHeight(int cHeight)
          Changes target height
 void setWidth(int cWidth)
          Changes target width
 java.lang.String toString()
          Return a string describing the stretching operation.
 
Methods inherited from class jjil.core.PipelineStage
getFront, isEmpty
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RgbStretch

public RgbStretch(int cWidth,
                  int cHeight)
           throws Error
Creates a new instance of RgbStretch.

Parameters:
cWidth - new image width
cHeight - new image height
Throws:
Error - if either is less than or equal to zero.
Method Detail

getHeight

public int getHeight()
Gets current target height

Returns:
current height

getWidth

public int getWidth()
Gets current target width

Returns:
current width

push

public void push(Image image)
          throws Error
Process an image.

Specified by:
push in class PipelineStage
Parameters:
image - the input RgbImage.
Throws:
Error - if the input is not an RgbImage, or is smaller than the target image either horizontally or vertically.

setHeight

public void setHeight(int cHeight)
               throws Error
Changes target height

Parameters:
cHeight - the new target height.
Throws:
Error - if height is not positive

setWidth

public void setWidth(int cWidth)
              throws Error
Changes target width

Parameters:
cWidth - the new target width.
Throws:
Error - if height is not positive

toString

public java.lang.String toString()
Return a string describing the stretching operation.

Overrides:
toString in class java.lang.Object
Returns:
the string describing the stretching operation.