|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.zxing.LuminanceSource
public abstract class LuminanceSource
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.
Constructor Summary | ||
---|---|---|
protected |
LuminanceSource(int width,
int height)
|
Method Summary | ||
---|---|---|
LuminanceSource |
crop(int left,
int top,
int width,
int height)
Returns a new object with cropped image data. |
|
int |
getHeight()
|
|
abstract byte[] |
getMatrix()
Fetches luminance data for the underlying bitmap. |
|
abstract byte[] |
getRow(int y,
byte[] row)
Fetches one row of luminance data from the underlying platform's bitmap. |
|
int |
getWidth()
|
|
boolean |
isCropSupported()
|
|
boolean |
isRotateSupported()
|
|
LuminanceSource |
rotateCounterClockwise()
Returns a new object with rotated image data. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected LuminanceSource(int width, int height)
Method Detail |
---|
public abstract byte[] getRow(int y, byte[] row)
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.
public abstract byte[] getMatrix()
public final int getWidth()
public final int getHeight()
public boolean isCropSupported()
public LuminanceSource crop(int left, int top, int width, int height)
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.
public boolean isRotateSupported()
public LuminanceSource rotateCounterClockwise()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal