\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 [FinderPatternFinder](../classes/Zxing.Qrcode.Detector.FinderPatternFinder.html). 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 : 

Type

$possibleCenters

$possibleCenters : 

Type

$startX

$startX : 

Type

$startY

$startY : 

Type

$width

$width : 

Type

$height

$height : 

Type

$moduleSize

$moduleSize : 

Type

$crossCheckStateCount

$crossCheckStateCount : 

Type

$resultPointCallback

$resultPointCallback : 

Type

Methods

__construct()

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

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

Parameters

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

find()

find() : \Zxing\Qrcode\Detector\{@link

<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

\Zxing\Qrcode\Detector\{@link —

AlignmentPattern} if found

foundPatternCross()

foundPatternCross(  $stateCount) : true

Parameters

$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(  $stateCount,   $i,   $j) : \Zxing\Qrcode\Detector\{@link

<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

$stateCount
$i
$j

Returns

\Zxing\Qrcode\Detector\{@link —

AlignmentPattern} if we have found the same pattern twice, or null if not

centerFromEnd()

centerFromEnd(  $stateCount,   $end) 

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

$stateCount
$end

crossCheckVertical()

crossCheckVertical(  $startI,   $centerJ,   $maxCount,   $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

$startI
$centerJ
$maxCount
$originalStateCountTotal

Returns

\Zxing\Qrcode\Detector\vertical —

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