|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sourceforge.javaocr.ocr.AbstractLinearImage
public abstract class AbstractLinearImage
abstract base class encapsulating image functionality for images represented by linear arrays. This class is stateful in regard to filtering, and thus not thread safe. Those optimisations aim to reduce method invocations to be performant on davlik (android) where direct field access if more performant than going through getter
| Field Summary | |
|---|---|
protected int |
arrayHeight
Height of the image, in pixels. |
protected int |
arrayWidth
Width of the image, in pixels. |
protected float |
aspectRatio
Aspect ratio of the image ( width/height). |
(package private) int |
border
|
protected int |
currentIndex
actual position being processed |
protected int |
height
actual image height |
protected int |
originX
X-origin inside array |
protected int |
originY
Y-origin inside array |
(package private) int |
step
|
protected int |
width
actual image width |
| Constructor Summary | |
|---|---|
protected |
AbstractLinearImage(int arrayWidth,
int arrayHeight)
construct image over while linear array with specified arrayWidth and arrayHeight |
protected |
AbstractLinearImage(int arrayWidth,
int arrayHeight,
int originX,
int originY,
int width,
int height)
construct image over subset of image in linear array |
| Method Summary | |
|---|---|
Image |
column(int x)
full column out of image |
void |
copy(Image dst)
copy image content to destination. |
void |
flip(Image dst)
copy image content to destination with coordinate flip. |
abstract int |
get()
retrieve current pixel empty |
int |
get(int x,
int y)
Get the empty of a pixel at a specific x,y position. |
int |
getArrayHeight()
|
int |
getArrayWidth()
|
float |
getAspectRatio()
aspect ration of this image TODO: do we actually need this? |
int |
getHeight()
|
int |
getOriginX()
|
int |
getOriginY()
|
int |
getWidth()
|
boolean |
hasNext()
whether next pixel is available |
boolean |
horizontalSpanEquals(int y,
int from,
int to,
int value)
whether given span equals to specific empty |
void |
iterateH(int y)
convenience method to initialize iterator over whole image row |
void |
iterateH(int y,
int from,
int to)
initialize iterator over part of row |
void |
iterateV(int x)
convenience method to initialize iterator over whole image column |
void |
iterateV(int x,
int from,
int to)
initialize iterator over part of column |
int |
next()
advance and retrieve next available pixel |
void |
next(int pixel)
advance to next and store pixel at current position |
abstract void |
put(int value)
save pixel to current position |
void |
put(int x,
int y,
int value)
store pixel empty. |
Image |
row(int y)
full row out of image |
protected void |
setCurrentIndex(int x,
int y)
|
String |
toString()
|
boolean |
verticalSpanEquals(int x,
int from,
int to,
int value)
whether vertical line is empty between specified points |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface net.sourceforge.javaocr.Image |
|---|
chisel |
| Field Detail |
|---|
protected final int arrayWidth
protected final int arrayHeight
protected final int originX
protected final int originY
protected final int width
protected final int height
protected int currentIndex
protected final float aspectRatio
width/height).
int step
int border
| Constructor Detail |
|---|
protected AbstractLinearImage(int arrayWidth,
int arrayHeight)
arrayWidth - image arrayWidtharrayHeight - image arrayHeight
protected AbstractLinearImage(int arrayWidth,
int arrayHeight,
int originX,
int originY,
int width,
int height)
arrayWidth - full image arrayWidtharrayHeight - full image arrayHeightoriginX - X-origin of subimageoriginY - Y-origin of subimagewidth - subimage arrayWidthheight - subimage arrayHeight| Method Detail |
|---|
public abstract int get()
get in interface Imagepublic abstract void put(int value)
put in interface Imagevalue -
public int get(int x,
int y)
x,y position.
get in interface Imagex - The pixel's x position.y - The pixel's y position.
protected void setCurrentIndex(int x,
int y)
public void put(int x,
int y,
int value)
put in interface Imagex - y - value - public int getArrayHeight()
public int getArrayWidth()
public float getAspectRatio()
Image
getAspectRatio in interface Imagepublic int getHeight()
getHeight in interface Imagepublic int getWidth()
getWidth in interface Imagepublic int getOriginX()
getOriginX in interface Imagepublic int getOriginY()
getOriginY in interface Image
public boolean horizontalSpanEquals(int y,
int from,
int to,
int value)
horizontalSpanEquals in interface Imagey - Y emptyfrom - inclusive fromto - inclusive tovalue - empty to be mathced
public boolean verticalSpanEquals(int x,
int from,
int to,
int value)
Image
verticalSpanEquals in interface Imagex - X Valuefrom - inclusive fromto - inclusive tovalue - valye to be matched
public void iterateV(int x,
int from,
int to)
Image
iterateV in interface Image
public void iterateH(int y,
int from,
int to)
Image
iterateH in interface Imagefrom - from positionto - to positionpublic void iterateH(int y)
Image
iterateH in interface Imagepublic void iterateV(int x)
Image
iterateV in interface Imagepublic boolean hasNext()
Image
hasNext in interface Imagepublic int next()
Image
next in interface Imagepublic void next(int pixel)
next in interface Imagepixel - public void copy(Image dst)
copy in interface Imagedst - public void flip(Image dst)
flip in interface Imagedst - public String toString()
toString in class Objectpublic Image row(int y)
Image
row in interface Imagey - coordinate
public Image column(int x)
Image
column in interface Imagex - coordinate
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||