net.sourceforge.javaocr.scanner
Class PixelImage

java.lang.Object
  extended by net.sourceforge.javaocr.scanner.PixelImage

Deprecated. no need for double functionality

public class PixelImage
extends Object

Class to contain a pixel representation of an image.

Author:
Ronald B. Cemer

Field Summary
 float aspectRatio
          Deprecated. Aspect ratio of the image (arrayWidth/arrayHeight).
protected static float[] FILTER_FIR_COEFFS
          Deprecated.  
 int height
          Deprecated. Height of the image, in pixels.
private static Logger LOG
          Deprecated.  
 int npix
          Deprecated. Total number of pixels in the image (arrayWidth*arrayHeight).
 int[] pixels
          Deprecated. An array of pixels.
 int width
          Deprecated. Width of the image, in pixels.
 
Constructor Summary
PixelImage(Image image)
          Deprecated. Construct a new PixelImage object from an Image.
PixelImage(int[] pixels, int width, int height)
          Deprecated. Construct a new PixelImage object from an array of pixels.
 
Method Summary
 void filter()
          Deprecated.  
 void filter(int[] pixels, int width, int height)
          Deprecated.  
 int getPixel(int x, int y)
          Deprecated. Get the value of a pixel at a specific x,y position.
 int getPixelIndex(int x, int y)
          Deprecated. Get the index of a pixel at a specific x,y position.
 int[] grayScaleToRGB(int[] pixels)
          Deprecated.  
private static int rgbToGrayScale(int pix)
          Deprecated.  
 Image rgbToImage(int[] rgbPixels, int width, int height, Component comp)
          Deprecated.  
 void toGrayScale(boolean normalize)
          Deprecated. Convert all pixels to grayscale from RGB or RGBA.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FILTER_FIR_COEFFS

protected static final float[] FILTER_FIR_COEFFS
Deprecated. 

pixels

public final int[] pixels
Deprecated. 
An array of pixels. This can be in RGBA or grayscale. By default, it is RGBA, but if the toGrayScale() method has been called, each pixel will be in the range of 0-255 grayscale.


width

public final int width
Deprecated. 
Width of the image, in pixels.


height

public final int height
Deprecated. 
Height of the image, in pixels.


npix

public final int npix
Deprecated. 
Total number of pixels in the image (arrayWidth*arrayHeight).


aspectRatio

public final float aspectRatio
Deprecated. 
Aspect ratio of the image (arrayWidth/arrayHeight).


LOG

private static final Logger LOG
Deprecated. 
Constructor Detail

PixelImage

public PixelImage(int[] pixels,
                  int width,
                  int height)
Deprecated. 
Construct a new PixelImage object from an array of pixels.

Parameters:
pixels - An array of pixels. This can be in RGBA or grayscale. By default, it is RGBA, but if the toGrayScale() method has been called, each pixel will be in the range of 0-255 grayscale.
width - Width of the image, in pixels.
height - Height of the image, in pixels.

PixelImage

public PixelImage(Image image)
Deprecated. 
Construct a new PixelImage object from an Image.

Parameters:
image - An Image from which to get the pixels. The image must be fully loaded. Use a MediaTracker to ensure this, if necessary.
Method Detail

rgbToImage

public Image rgbToImage(int[] rgbPixels,
                        int width,
                        int height,
                        Component comp)
Deprecated. 

getPixelIndex

public final int getPixelIndex(int x,
                               int y)
Deprecated. 
Get the index of a pixel at a specific x,y position.

Parameters:
x - The pixel's x position.
y - The pixel's y position.
Returns:
The pixel index (the index into the pixels array) of the pixel.

getPixel

public final int getPixel(int x,
                          int y)
Deprecated. 
Get the value of a pixel at a specific x,y position.

Parameters:
x - The pixel's x position.
y - The pixel's y position.
Returns:
The value of the pixel.

rgbToGrayScale

private static int rgbToGrayScale(int pix)
Deprecated. 

toGrayScale

public final void toGrayScale(boolean normalize)
Deprecated. 
Convert all pixels to grayscale from RGB or RGBA. Do not call this method if the pixels are not currently RGB or RGBA.

Parameters:
normalize - true to normalize the image after converting to grayscale, such that the darkest pixel in the image is all black and the lightest pixel in the image is all white.

grayScaleToRGB

public final int[] grayScaleToRGB(int[] pixels)
Deprecated. 

filter

public final void filter()
Deprecated. 

filter

public final void filter(int[] pixels,
                         int width,
                         int height)
Deprecated. 


Copyright © -2012. All Rights Reserved.