|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface MonochromeBitmapSource
Encapsulates a generic black-and-white bitmap -- a collection of pixels in two dimensions.
This unifies many possible representations, like AWT's BufferedImage
.
Method Summary | |
---|---|
void |
estimateBlackPoint(BlackPointEstimationMethod method,
int argument)
Estimates black point according to the given method, which is optionally parameterized by a single int argument. |
BitArray |
getBlackColumn(int x,
BitArray column,
int startY,
int getHeight)
Entirely analogous to getBlackRow(int, BitArray, int, int) but gets a column. |
BitArray |
getBlackDiagonal(int x,
int y,
int dx,
int dy,
BitArray diagonal,
int size)
|
BitArray |
getBlackRow(int y,
BitArray row,
int startX,
int getWidth)
Returns an entire row of black/white pixels as an array of bits, where "true" means "black". |
int |
getHeight()
|
BlackPointEstimationMethod |
getLastEstimationMethod()
|
int |
getLuminance(int x,
int y)
Retrieves the luminance at the pixel x,y in the bitmap. |
int[] |
getLuminanceColumn(int x,
int[] column)
The same as getLuminanceRow(), but for columns. |
int[] |
getLuminanceRow(int y,
int[] row)
This is the main mechanism for retrieving luminance data. |
int |
getWidth()
|
boolean |
isBlack(int x,
int y)
|
boolean |
isRotateSupported()
|
MonochromeBitmapSource |
rotateCounterClockwise()
Optional operation which returns an implementation based on the same underlying image, but which behaves as if the underlying image had been rotated 90 degrees counterclockwise. |
Method Detail |
---|
boolean isBlack(int x, int y)
x
- horizontal offset, from left, of the pixely
- vertical offset, from top, of the pixel
BitArray getBlackRow(int y, BitArray row, int startX, int getWidth)
Returns an entire row of black/white pixels as an array of bits, where "true" means "black". This is a sort of "bulk get" operation intended to enable efficient access in certain situations.
y
- vertical offset, from top, of the row of pixelsrow
- if not null, BitArray
to write pixels into. If null, a new BitArray
is allocated and returned.startX
- horizontal offset, from left, from which to start getting pixelsgetWidth
- number of pixels to get from the row
BitArray
representing the (subset of the) row of pixels. If row parameter
was not null, it is returned.BitArray getBlackColumn(int x, BitArray column, int startY, int getHeight)
getBlackRow(int, BitArray, int, int)
but gets a column.
BitArray getBlackDiagonal(int x, int y, int dx, int dy, BitArray diagonal, int size)
int getHeight()
int getWidth()
void estimateBlackPoint(BlackPointEstimationMethod method, int argument) throws ReaderException
Estimates black point according to the given method, which is optionally parameterized by
a single int argument. For BlackPointEstimationMethod.ROW_SAMPLING
, this
specifies the row to sample.
The estimated value will be used in subsequent computations that rely on an estimated black point.
method
- black point estimation methodargument
- method-specific argument
ReaderException
BlackPointEstimationMethod getLastEstimationMethod()
BlackPointEstimationMethod
representing last sampling method usedMonochromeBitmapSource rotateCounterClockwise()
Optional operation which returns an implementation based on the same underlying
image, but which behaves as if the underlying image had been rotated 90 degrees
counterclockwise. This is useful in the context of 1D barcodes and the
DecodeHintType.TRY_HARDER
decode hint, and is only intended to be
used in non-resource-constrained environments. Hence, implementations
of this class which are only used in resource-constrained mobile environments
don't have a need to implement this.
java.lang.IllegalArgumentException
- if not supportedboolean isRotateSupported()
rotateCounterClockwise()
int getLuminance(int x, int y)
x
- The x coordinate in the image.y
- The y coordinate in the image.
int[] getLuminanceRow(int y, int[] row)
y
- The row to fetchrow
- The array to write luminance values into. It is strongly suggested that you
allocate this yourself, making sure row.length >= getWidth(), and reuse the same
array on subsequent calls for performance. If you pass null, you will be flogged,
but then I will take pity on you and allocate a sufficient array internally.
int[] getLuminanceColumn(int x, int[] column)
x
- The column to fetchcolumn
- The array to write luminance values into. See above.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |