The Encog Project

org.encog.util.downsample
Class SimpleIntensityDownsample

java.lang.Object
  extended by org.encog.util.downsample.SimpleIntensityDownsample
All Implemented Interfaces:
Downsample

public class SimpleIntensityDownsample
extends java.lang.Object
implements Downsample

Downsample an image using a simple intensity scale. Color information is discarded.

Author:
jheaton

Constructor Summary
SimpleIntensityDownsample(java.awt.Image image)
          Construct the downsample utility for the specified image.
 
Method Summary
 double[] downSample(int height, int width)
          Called to downsample the image and store it in the down sample component.
 void findBounds()
          This method is called to automatically crop the image so that whitespace is removed.
 int getDownSampleBottom()
           
 int getDownSampleLeft()
           
 int getDownSampleRight()
           
 int getDownSampleTop()
           
 java.awt.Image getImage()
           
 int getImageHeight()
           
 int getImageWidth()
           
 int[] getPixelMap()
           
 double getRatioX()
           
 double getRatioY()
           
 void processImage(java.awt.Image image)
          Process the image and prepare it to be downsampled.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleIntensityDownsample

public SimpleIntensityDownsample(java.awt.Image image)
Construct the downsample utility for the specified image.

Parameters:
image - The image to downsample.
Method Detail

downSample

public double[] downSample(int height,
                           int width)
Called to downsample the image and store it in the down sample component.

Specified by:
downSample in interface Downsample
Parameters:
height - The height to downsample to.
width - THe width to downsample to.
Returns:
The downsampled image.

findBounds

public void findBounds()
This method is called to automatically crop the image so that whitespace is removed.

Specified by:
findBounds in interface Downsample

getDownSampleBottom

public int getDownSampleBottom()
Specified by:
getDownSampleBottom in interface Downsample
Returns:
the downSampleBottom

getDownSampleLeft

public int getDownSampleLeft()
Specified by:
getDownSampleLeft in interface Downsample
Returns:
the downSampleLeft

getDownSampleRight

public int getDownSampleRight()
Specified by:
getDownSampleRight in interface Downsample
Returns:
the downSampleRight

getDownSampleTop

public int getDownSampleTop()
Specified by:
getDownSampleTop in interface Downsample
Returns:
the downSampleTop

getImage

public java.awt.Image getImage()
Specified by:
getImage in interface Downsample
Returns:
the image

getImageHeight

public int getImageHeight()
Specified by:
getImageHeight in interface Downsample
Returns:
the imageHeight

getImageWidth

public int getImageWidth()
Specified by:
getImageWidth in interface Downsample
Returns:
the imageWidth

getPixelMap

public int[] getPixelMap()
Specified by:
getPixelMap in interface Downsample
Returns:
the pixelMap

getRatioX

public double getRatioX()
Specified by:
getRatioX in interface Downsample
Returns:
the ratioX

getRatioY

public double getRatioY()
Specified by:
getRatioY in interface Downsample
Returns:
the ratioY

processImage

public void processImage(java.awt.Image image)
Process the image and prepare it to be downsampled.

Specified by:
processImage in interface Downsample
Parameters:
image - The image to downsample.

The Encog Project