public final class BinaryBitmap extends Object
| Constructor and Description |
|---|
BinaryBitmap(Binarizer
|
| Modifier and Type | Method and Description |
|---|---|
BinaryBitmap |
crop(int left, int top, int width, int height)
Returns a new object with cropped image data.
|
BitMatrix |
getBlackMatrix()
Converts a 2D array of luminance data to 1 bit.
|
BitArray |
getBlackRow(int y, BitArray
Converts one row of luminance data to 1 bit data.
|
int |
getHeight()
|
int |
getWidth()
|
boolean |
isCropSupported()
|
boolean |
isRotateSupported()
|
BinaryBitmap |
rotateCounterClockwise()
Returns a new object with rotated image data by 90 degrees counterclockwise.
|
BinaryBitmap |
rotateCounterClockwise45()
Returns a new object with rotated image data by 45 degrees counterclockwise.
|
String |
toString()
|
public BinaryBitmap(Binarizerbinarizer)
public int getWidth()
public int getHeight()
public BitArraygetBlackRow(int y, BitArray row) throws NotFoundException
y - The row to fetch, which must be in [0, bitmap height)
row - An optional preallocated array. If null or too small, it will be ignored. If used, the Binarizer will call BitArray.clear(). Always use the returned object.
NotFoundException - if row can't be binarized
public BitMatrixgetBlackMatrix() throws NotFoundException
NotFoundException - if image can't be binarized to make a matrix
public boolean isCropSupported()
public BinaryBitmapcrop(int left, int top, int width, int height)
left - The left coordinate, which must be in [0,getWidth())
top - The top coordinate, which must be in [0,getHeight())
width - The width of the rectangle to crop.
height - The height of the rectangle to crop.
public boolean isRotateSupported()
public BinaryBitmaprotateCounterClockwise()
isRotateSupported() is true.
public BinaryBitmaprotateCounterClockwise45()
isRotateSupported() is true.
public StringtoString()