\ZxingBinaryBitmap

This class is the core bitmap class used by ZXing to represent 1 bit data. Reader objects accept a BinaryBitmap and attempt to decode it.

Summary

Methods
Properties
Constants
__construct()
getWidth()
getHeight()
getBlackRow()
getBlackMatrix()
isCropSupported()
crop()
isRotateSupported()
rotateCounterClockwise()
rotateCounterClockwise45()
toString()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$binarizer
$matrix
N/A

Properties

$binarizer

$binarizer : 

Type

$matrix

$matrix : 

Type

Methods

__construct()

__construct(  $binarizer) 

Parameters

$binarizer

getWidth()

getWidth() : \Zxing\The

Returns

\Zxing\The —

width of the bitmap.

getHeight()

getHeight() : \Zxing\The

Returns

\Zxing\The —

height of the bitmap.

getBlackRow()

getBlackRow(  $y,   $row) : \Zxing\The

Converts one row of luminance data to 1 bit data. May actually do the conversion, or return cached data. Callers should assume this method is expensive and call it as seldom as possible.

This method is intended for decoding 1D barcodes and may choose to apply sharpening.

Parameters

$y
$row

Throws

\Zxing\NotFoundException

if row can't be binarized

Returns

\Zxing\The —

array of bits for this row (true means black).

getBlackMatrix()

getBlackMatrix() : \Zxing\The

Converts a 2D array of luminance data to 1 bit. As above, assume this method is expensive and do not call it repeatedly. This method is intended for decoding 2D barcodes and may or may not apply sharpening. Therefore, a row from this matrix may not be identical to one fetched using getBlackRow(), so don't mix and match between them.

Throws

\Zxing\NotFoundException

if image can't be binarized to make a matrix

Returns

\Zxing\The —

2D array of bits for the image (true means black).

isCropSupported()

isCropSupported() : \Zxing\Whether

Returns

\Zxing\Whether —

this bitmap can be cropped.

crop()

crop(  $left,   $top,   $width,   $height) : \Zxing\A

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.

Parameters

$left
$top
$width
$height

Returns

\Zxing\A —

cropped version of this object.

isRotateSupported()

isRotateSupported() : \Zxing\Whether

Returns

\Zxing\Whether —

this bitmap supports counter-clockwise rotation.

rotateCounterClockwise()

rotateCounterClockwise() : \Zxing\A

Returns a new object with rotated image data by 90 degrees counterclockwise.

Only callable if \Zxing#isRotateSupported() is true.

Returns

\Zxing\A —

rotated version of this object.

rotateCounterClockwise45()

rotateCounterClockwise45() : \Zxing\A

Returns a new object with rotated image data by 45 degrees counterclockwise.

Only callable if \Zxing#isRotateSupported() is true.

Returns

\Zxing\A —

rotated version of this object.

toString()

toString()