\Zxing\Qrcode\DetectorAlignmentPatternFinder

<p>This class attempts to find alignment patterns in a QR Code. Alignment patterns look like finder patterns but are smaller and appear at regular intervals throughout the image.</p>

At the moment this only looks for the bottom-right alignment pattern.

This is mostly a simplified copy of {@link FinderPatternFinder}. It is copied, pasted and stripped down here for maximum performance but does unfortunately duplicate some code.

This class is thread-safe but not reentrant. Each thread must allocate its own object.

Summary

Methods
Properties
Constants
__construct()
find()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
foundPatternCross()
handlePossibleCenter()
centerFromEnd()
crossCheckVertical()
$image
$possibleCenters
$startX
$startY
$width
$height
$moduleSize
$crossCheckStateCount
$resultPointCallback
N/A

Properties

$image

$image

$possibleCenters

$possibleCenters

$startX

$startX

$startY

$startY

$width

$width

$height

$height

$moduleSize

$moduleSize

$crossCheckStateCount

$crossCheckStateCount

$resultPointCallback

$resultPointCallback

Methods

__construct()

__construct(mixed  $image, mixed  $startX, mixed  $startY, mixed  $width, mixed  $height, mixed  $moduleSize, mixed  $resultPointCallback) : mixed

<p>Creates a finder that will look in a portion of the whole image.</p>

Parameters

mixed $image
mixed $startX
mixed $startY
mixed $width
mixed $height
mixed $moduleSize
mixed $resultPointCallback

Returns

mixed —

find()

find() : mixed

<p>This method attempts to find the bottom-right alignment pattern in the image. It is a bit messy since it's pretty performance-critical and so is written to be fast foremost.</p>

Throws

\Zxing\NotFoundException

if not found

Returns

mixed —

foundPatternCross()

foundPatternCross(mixed  $stateCount) : true

Parameters

mixed $stateCount

Returns

true —

iff the proportions of the counts is close enough to the 1/1/1 ratios used by alignment patterns to be considered a match

handlePossibleCenter()

handlePossibleCenter(mixed  $stateCount, mixed  $i, mixed  $j) : mixed

<p>This is called when a horizontal scan finds a possible alignment pattern. It will cross check with a vertical scan, and if successful, will see if this pattern had been found on a previous horizontal scan. If so, we consider it confirmed and conclude we have found the alignment pattern.</p>

Parameters

mixed $stateCount
mixed $i
mixed $j

Returns

mixed —

centerFromEnd()

centerFromEnd(mixed  $stateCount, mixed  $end) : mixed

Given a count of black/white/black pixels just seen and an end position, figures the location of the center of this black/white/black run.

Parameters

mixed $stateCount
mixed $end

Returns

mixed —

crossCheckVertical()

crossCheckVertical(mixed  $startI, mixed  $centerJ, mixed  $maxCount, mixed  $originalStateCountTotal) : \Zxing\Qrcode\Detector\vertical

<p>After a horizontal scan finds a potential alignment pattern, this method "cross-checks" by scanning down vertically through the center of the possible alignment pattern to see if the same proportion is detected.</p>

Parameters

mixed $startI
mixed $centerJ
mixed $maxCount
mixed $originalStateCountTotal

Returns

\Zxing\Qrcode\Detector\vertical —

center of alignment pattern, or {@link Float#NaN} if not found