net.sourceforge.javaocr.ocr
Class PixelImage

java.lang.Object
  extended by net.sourceforge.javaocr.ocr.AbstractLinearImage
      extended by net.sourceforge.javaocr.ocr.PixelImage
All Implemented Interfaces:
Image

public class PixelImage
extends AbstractLinearImage

contains pixel representation of an image

Author:
Ronald B. Cemer, Konstantin Pribluda

Field Summary
 int[] pixels
          An array of pixels.
 
Fields inherited from class net.sourceforge.javaocr.ocr.AbstractLinearImage
arrayHeight, arrayWidth, aspectRatio, border, currentIndex, height, originX, originY, step, width
 
Constructor Summary
PixelImage(int[] pixels, int width, int height)
          Construct a new PixelImage object from an array of pixels.
PixelImage(int[] pixels, int width, int height, int originX, int originY, int boxW, int boxH)
           
PixelImage(int width, int height)
          create empty pixel image
 
Method Summary
 Image chisel(int fromX, int fromY, int width, int height)
          chisel out sub-image out of original one.
 int get()
          retrieve current pixel empty
 void put(int value)
          save pixel to current position
 String toString()
           
 
Methods inherited from class net.sourceforge.javaocr.ocr.AbstractLinearImage
column, copy, flip, get, getArrayHeight, getArrayWidth, getAspectRatio, getHeight, getOriginX, getOriginY, getWidth, hasNext, horizontalSpanEquals, iterateH, iterateH, iterateV, iterateV, next, next, put, row, setCurrentIndex, verticalSpanEquals
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

pixels

public final int[] pixels
An array of pixels. we make no assumption about components here

Constructor Detail

PixelImage

public PixelImage(int width,
                  int height)
create empty pixel image

Parameters:
height -
width -

PixelImage

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

Parameters:
pixels - An array of pixels.
width - Width of the image, in pixels.
height - Height of the image, in pixels.

PixelImage

public PixelImage(int[] pixels,
                  int width,
                  int height,
                  int originX,
                  int originY,
                  int boxW,
                  int boxH)
Method Detail

get

public int get()
Description copied from class: AbstractLinearImage
retrieve current pixel empty

Specified by:
get in interface Image
Specified by:
get in class AbstractLinearImage
Returns:
current pixel empty

put

public void put(int value)
Description copied from class: AbstractLinearImage
save pixel to current position

Specified by:
put in interface Image
Specified by:
put in class AbstractLinearImage

chisel

public Image chisel(int fromX,
                    int fromY,
                    int width,
                    int height)
Description copied from interface: Image
chisel out sub-image out of original one. be careful with dimensions - no internal checks are done. Operation works in place and no data is copied.

Parameters:
fromX - subimage origin X
fromY - subimage origin Y
width - subimage width
height - subimage height
Returns:
image region as image

toString

public String toString()
Overrides:
toString in class AbstractLinearImage


Copyright © -2012. All Rights Reserved.