The purpose of this class hierarchy is to abstract different bitmap implementations across platforms into a standard interface for requesting greyscale luminance values. The interface only provides immutable methods; therefore crop and rotation create copies. This is to ensure that one Reader does not modify the original luminance source and leave it in an unknown state for other Readers in the chain. Más...
Métodos públicos | |
LuminanceSource | crop (int left, int top, int width, int height) |
Returns a new object with cropped image data. Implementations may keep a reference to the original data rather than a copy. Only callable if isCropSupported() is true. | |
final int | getHeight () |
abstract byte[] | getMatrix () |
Fetches luminance data for the underlying bitmap. Values should be fetched using: int luminance = array[y * width + x] & 0xff;. | |
abstract byte[] | getRow (int y, byte[] row) |
Fetches one row of luminance data from the underlying platform's bitmap. Values range from 0 (black) to 255 (white). Because Java does not have an unsigned byte type, callers will have to bitwise and with 0xff for each value. It is preferable for implementations of this method to only fetch this row rather than the whole image, since no 2D Readers may be installed and getMatrix() may never be called. | |
final int | getWidth () |
boolean | isCropSupported () |
boolean | isRotateSupported () |
LuminanceSource | rotateCounterClockwise () |
Returns a new object with rotated image data. Only callable if isRotateSupported() is true. | |
Métodos protegidos | |
LuminanceSource (int width, int height) | |
Atributos privados | |
final int | height |
final int | width |
The purpose of this class hierarchy is to abstract different bitmap implementations across platforms into a standard interface for requesting greyscale luminance values. The interface only provides immutable methods; therefore crop and rotation create copies. This is to ensure that one Reader does not modify the original luminance source and leave it in an unknown state for other Readers in the chain.
Definición en la línea 40 del archivo LuminanceSource.java.
edu.uoc.ocr.LuminanceSource.LuminanceSource | ( | int | width, |
int | height | ||
) | [protected] |
Definición en la línea 45 del archivo LuminanceSource.java.
LuminanceSource edu.uoc.ocr.LuminanceSource.crop | ( | int | left, |
int | top, | ||
int | width, | ||
int | height | ||
) |
Returns a new object with cropped image data. Implementations may keep a reference to the original data rather than a copy. Only callable if isCropSupported() is true.
left | The left coordinate, 0 <= left < getWidth(). |
top | The top coordinate, 0 <= top <= getHeight(). |
width | The width of the rectangle to crop. |
height | The height of the rectangle to crop. |
Reimplementado en edu.uoc.ocr.PlanarYUVLuminanceSource.
Definición en la línea 115 del archivo LuminanceSource.java.
final int edu.uoc.ocr.LuminanceSource.getHeight | ( | ) |
Definición en la línea 89 del archivo LuminanceSource.java.
abstract byte [] edu.uoc.ocr.LuminanceSource.getMatrix | ( | ) | [pure virtual] |
Fetches luminance data for the underlying bitmap. Values should be fetched using: int luminance = array[y * width + x] & 0xff;.
Implementado en edu.uoc.ocr.PlanarYUVLuminanceSource.
abstract byte [] edu.uoc.ocr.LuminanceSource.getRow | ( | int | y, |
byte[] | row | ||
) | [pure virtual] |
Fetches one row of luminance data from the underlying platform's bitmap. Values range from 0 (black) to 255 (white). Because Java does not have an unsigned byte type, callers will have to bitwise and with 0xff for each value. It is preferable for implementations of this method to only fetch this row rather than the whole image, since no 2D Readers may be installed and getMatrix() may never be called.
y | The row to fetch, 0 <= y < getHeight(). |
row | An optional preallocated array. If null or too small, it will be ignored. Always use the returned object, and ignore the .length of the array. |
Implementado en edu.uoc.ocr.PlanarYUVLuminanceSource.
final int edu.uoc.ocr.LuminanceSource.getWidth | ( | ) |
Definición en la línea 82 del archivo LuminanceSource.java.
boolean edu.uoc.ocr.LuminanceSource.isCropSupported | ( | ) |
Reimplementado en edu.uoc.ocr.PlanarYUVLuminanceSource.
Definición en la línea 96 del archivo LuminanceSource.java.
boolean edu.uoc.ocr.LuminanceSource.isRotateSupported | ( | ) |
Definición en la línea 123 del archivo LuminanceSource.java.
Returns a new object with rotated image data. Only callable if isRotateSupported() is true.
Definición en la línea 133 del archivo LuminanceSource.java.
final int edu.uoc.ocr.LuminanceSource.height [private] |
Definición en la línea 43 del archivo LuminanceSource.java.
final int edu.uoc.ocr.LuminanceSource.width [private] |
Definición en la línea 42 del archivo LuminanceSource.java.