net.sourceforge.javaocr.ocr
Class ByteImage

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

public class ByteImage
extends AbstractLinearImage

image backed by byte array


Field Summary
(package private)  byte[] image
           
 
Fields inherited from class net.sourceforge.javaocr.ocr.AbstractLinearImage
arrayHeight, arrayWidth, aspectRatio, border, currentIndex, height, originX, originY, step, width
 
Constructor Summary
ByteImage(byte[] image, int width, int height)
           
ByteImage(byte[] image, int arrayWidth, int arrayHeight, int originX, int originY, int width, int height)
           
ByteImage(int width, int height)
           
 
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

image

byte[] image
Constructor Detail

ByteImage

public ByteImage(int width,
                 int height)

ByteImage

public ByteImage(byte[] image,
                 int width,
                 int height)

ByteImage

public ByteImage(byte[] image,
                 int arrayWidth,
                 int arrayHeight,
                 int originX,
                 int originY,
                 int width,
                 int height)
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.