\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

$matrix

$matrix

Methods

__construct()

__construct(\Zxing\Binarizer  $binarizer) : mixed

Parameters

\Zxing\Binarizer $binarizer

Returns

mixed —

getWidth()

getWidth() : int

Returns

int —

The width of the bitmap.

getHeight()

getHeight() : int

Returns

int —

The height of the bitmap.

getBlackRow()

getBlackRow(mixed  $y, mixed  $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

mixed $y
mixed $row

Throws

\Zxing\NotFoundException

if row can't be binarized

Returns

array —

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

isCropSupported()

isCropSupported() : bool

Returns

bool —

Whether this bitmap can be cropped.

crop()

crop(mixed  $left, mixed  $top, mixed  $width, mixed  $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

mixed $left
mixed $top
mixed $width
mixed $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 {@link #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 {@link #isRotateSupported()} is true.

Returns

\Zxing\BinaryBitmap —

A rotated version of this object.

toString()

toString() : mixed

Returns

mixed —

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).