jjil.algorithm
Class GrayRectStretch

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

public class GrayRectStretch
extends PipelineStage

Pipeline stage stretches an image to a larger rectangular size with bilinear interpolation. For more information on this and other image warps, see George Wolberg's excellent book, "Digital Image Warping", Wiley-IEEE Computer Society Press, 1990.

Author:
webb

Constructor Summary
GrayRectStretch(int cWidth, int cHeight)
          Creates a new instance of GrayRectStretch.
 
Method Summary
 int getHeight()
          Gets current target height
 int getWidth()
          Gets current target width
 void push(Image image)
          Bilinear interpolation to stretch image to (cWidth, cHeight).
 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

GrayRectStretch

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

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
Bilinear interpolation to stretch image to (cWidth, cHeight). Does this in two passes, for more efficient computation.

Specified by:
push in class PipelineStage
Parameters:
image - the input image
Throws:
Error - if input image is not gray 8 bits, or the input image size is larger than the target size. This class does not do subsampling, only interpolation.

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.