jjil.algorithm
Class GaussHoriz

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

public class GaussHoriz
extends PipelineStage

Computes a horizontal Gaussian blur for an input gray image. The sigma value for the operator is set in the constructor or setSigma. All calculations are done in integer (per CLDC 1.0) and the sigma value is specified as multiplied by 10.0. The minimum value for the unmultiplied sigma is 0.1; the maximum value is about 10.0. Larger sigma values give an operator which is more blurred.

Hungarian prefix is 'gshz'.

Author:
webb

Constructor Summary
GaussHoriz(int cSigma)
          Creates a new instance of GaussHoriz
 
Method Summary
 int getSigma()
          Returns the current value of sigma.
 void push(Image image)
          Apply the Gaussian horizontally to the input input image.
 void setSigma(int cSigma)
          sets a new value for sigma.
 java.lang.String toString()
          returns a string describing this Gaussian blur.
 
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

GaussHoriz

public GaussHoriz(int cSigma)
           throws Error
Creates a new instance of GaussHoriz

Parameters:
cSigma - the sigma value for the operator, which is the sigma in the Gaussian distribution multipied by 10.0 and converted to integer.
Throws:
Error - is sigma is out of range.
Method Detail

push

public void push(Image image)
          throws Error
Apply the Gaussian horizontally to the input input image. The sigma value for the operator is set in the class constructor. We handle the borders of the image a little carefully to avoid creating spurious edges at them. The image value at the border is reflected so that image(0,-1), for example, is made equal to image(0,1).

Specified by:
push in class PipelineStage
Parameters:
image - the input Gray8Image
Throws:
Error - if image is not a Gray8Image

getSigma

public int getSigma()
Returns the current value of sigma.

Returns:
the sigma value

setSigma

public void setSigma(int cSigma)
              throws Error
sets a new value for sigma. Sigma controls the frequency of edges that the operator responds to. A small sigma value gives less blur.

Parameters:
cSigma - the new sigma value
Throws:
Error - if cSigma is out of range -- less than or equal to 1 or greater than the number of coefficients we're precomputed.

toString

public java.lang.String toString()
returns a string describing this Gaussian blur.

Overrides:
toString in class java.lang.Object
Returns:
a string describing the Gaussian blur.