\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()
isCropSupported()
crop()
isRotateSupported()
rotateCounterClockwise()
rotateCounterClockwise45()
toString()
getBlackMatrix()
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(\Zxing\Binarizer  $binarizer) 

Parameters

\Zxing\Binarizer $binarizer

getWidth()

getWidth() : integer

Returns

integer —

The width of the bitmap.

getHeight()

getHeight() : integer

Returns

integer —

The height of the bitmap.

getBlackRow()

getBlackRow(  $y,   $row) : array

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

array —

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

isCropSupported()

isCropSupported() : boolean

Returns

boolean —

Whether this bitmap can be cropped.

crop()

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

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\BinaryBitmap

A cropped version of this object.

isRotateSupported()

isRotateSupported() : \Zxing\Whether

Returns

\Zxing\Whether —

this bitmap supports counter-clockwise rotation.

rotateCounterClockwise()

rotateCounterClockwise() : \Zxing\BinaryBitmap

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

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

Returns

\Zxing\BinaryBitmap

A rotated version of this object.

rotateCounterClockwise45()

rotateCounterClockwise45() : \Zxing\BinaryBitmap

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

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

Returns

\Zxing\BinaryBitmap

A rotated version of this object.

toString()

toString() 

getBlackMatrix()

getBlackMatrix() : \Zxing\Common\BitMatrix

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\Common\BitMatrix

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