Files
php-qrcode/classes/chillerlan-QRCode-Detector-AlignmentPatternFinder.html
T

884 lines
45 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Documentation</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<base href="../">
<link rel="icon" type="image/png" sizes="32x32" href="images/favicon-32x32.png"/>
<link rel="icon" type="image/png" sizes="16x16" href="images/favicon-16x16.png"/>
<link rel="icon" href="images/favicon.ico"/>
<link rel="apple-touch-icon" href="images/apple-touch-icon.png"/>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/base.css">
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@100;200;300;400;600;700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@400;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="css/template.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.0/css/all.min.css" integrity="sha256-ybRkN9dBjhcS2qrW1z+hfCxq+1aBdwyQM5wlQoQVt/0=" crossorigin="anonymous" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/themes/prism-okaidia.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.css">
<script src="https://cdn.jsdelivr.net/npm/fuse.js@3.4.6"></script>
<script src="https://cdn.jsdelivr.net/npm/css-vars-ponyfill@2"></script>
<script src="js/template.js"></script>
<script src="js/search.js"></script>
<script defer src="js/searchIndex.js"></script>
</head>
<body id="top">
<header class="phpdocumentor-header phpdocumentor-section">
<h1 class="phpdocumentor-title"><a href="" class="phpdocumentor-title__link">Documentation</a></h1>
<input class="phpdocumentor-header__menu-button" type="checkbox" id="menu-button" name="menu-button" />
<label class="phpdocumentor-header__menu-icon" for="menu-button">
<i class="fas fa-bars"></i>
</label>
<section data-search-form class="phpdocumentor-search">
<label>
<span class="visually-hidden">Search for</span>
<svg class="phpdocumentor-search__icon" width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="7.5" cy="7.5" r="6.5" stroke="currentColor" stroke-width="2"/>
<line x1="12.4892" y1="12.2727" x2="19.1559" y2="18.9393" stroke="currentColor" stroke-width="3"/>
</svg>
<input type="search" class="phpdocumentor-field phpdocumentor-search__field" placeholder="Loading .." disabled />
</label>
</section>
<nav class="phpdocumentor-topnav">
<ul class="phpdocumentor-topnav__menu">
<li class="phpdocumentor-topnav__menu-item -menu">
<a href="https://php-qrcode.readthedocs.io">
<span>
User Manual
</span>
</a>
</li>
<li class="phpdocumentor-topnav__menu-item -social">
<a href="https://github.com/chillerlan/php-qrcode">
<span>
<i class="fab fa-github"></i>
</span>
</a>
</li>
<li class="phpdocumentor-topnav__menu-item -social">
<a href="https://github.com/chillerlan/php-qrcode/discussions">
<span>
<i class="fas fa-envelope-open-text"></i>
</span>
</a>
</li>
</ul>
</nav>
</header>
<main class="phpdocumentor">
<div class="phpdocumentor-section">
<input class="phpdocumentor-sidebar__menu-button" type="checkbox" id="sidebar-button" name="sidebar-button" />
<label class="phpdocumentor-sidebar__menu-icon" for="sidebar-button">
Menu
</label>
<aside class="phpdocumentor-column -three phpdocumentor-sidebar">
<section class="phpdocumentor-sidebar__category -namespaces">
<h2 class="phpdocumentor-sidebar__category-header">Namespaces</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="namespaces/chillerlan.html" class="">chillerlan</a>
</h4>
<ul class="phpdocumentor-list">
<li>
<a href="namespaces/chillerlan-qrcode.html" class="">QRCode</a>
</li>
<li>
<a href="namespaces/chillerlan-qrcodetest.html" class="">QRCodeTest</a>
</li>
</ul>
</section>
<section class="phpdocumentor-sidebar__category -packages">
<h2 class="phpdocumentor-sidebar__category-header">Packages</h2>
<h4 class="phpdocumentor-sidebar__root-namespace">
<a href="packages/Application.html" class="">Application</a>
</h4>
</section>
<section class="phpdocumentor-sidebar__category -reports">
<h2 class="phpdocumentor-sidebar__category-header">Reports</h2>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/deprecated.html">Deprecated</a></h3>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/errors.html">Errors</a></h3>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/markers.html">Markers</a></h3>
</section>
<section class="phpdocumentor-sidebar__category -indices">
<h2 class="phpdocumentor-sidebar__category-header">Indices</h2>
<h3 class="phpdocumentor-sidebar__root-package"><a href="indices/files.html">Files</a></h3>
</section>
</aside>
<div class="phpdocumentor-column -nine phpdocumentor-content">
<section>
<ul class="phpdocumentor-breadcrumbs">
<li class="phpdocumentor-breadcrumb"><a href="namespaces/chillerlan.html">chillerlan</a></li>
<li class="phpdocumentor-breadcrumb"><a href="namespaces/chillerlan-qrcode.html">QRCode</a></li>
<li class="phpdocumentor-breadcrumb"><a href="namespaces/chillerlan-qrcode-detector.html">Detector</a></li>
</ul>
<article class="phpdocumentor-element -class">
<h2 class="phpdocumentor-content__title">
AlignmentPatternFinder
<div class="phpdocumentor-element__package">
in package
<ul class="phpdocumentor-breadcrumbs">
<li class="phpdocumentor-breadcrumb"><a href="packages/Application.html">Application</a></li>
</ul>
</div>
</h2>
<div class="phpdocumentor-label-line">
<div class="phpdocumentor-label phpdocumentor-label--success"><span>Final</span><span>Yes</span></div>
</div>
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/Detector/AlignmentPatternFinder.php"><a href="files/src-detector-alignmentpatternfinder.html"><abbr title="src/Detector/AlignmentPatternFinder.php">AlignmentPatternFinder.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">32</span>
</aside>
<p class="phpdocumentor-summary">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>
<section class="phpdocumentor-description"><p>At the moment this only looks for the bottom-right alignment pattern.</p>
<p>This is mostly a simplified copy of FinderPatternFinder. It is copied,
pasted and stripped down here for maximum performance but does unfortunately duplicate
some code.</p>
<p>This class is thread-safe but not reentrant. Each thread must allocate its own object.</p>
</section>
<h5 class="phpdocumentor-tag-list__heading" id="tags">
Tags
<a href="classes/chillerlan-QRCode-Detector-AlignmentPatternFinder.html#tags" class="headerlink"><i class="fas fa-link"></i></a>
</h5>
<dl class="phpdocumentor-tag-list">
<dt class="phpdocumentor-tag-list__entry">
<span class="phpdocumentor-tag__name">author</span>
</dt>
<dd class="phpdocumentor-tag-list__definition">
<section class="phpdocumentor-description"><p>Sean Owen</p>
</section>
</dd>
</dl>
<h3 id="toc">
Table of Contents
<a href="classes/chillerlan-QRCode-Detector-AlignmentPatternFinder.html#toc" class="headerlink"><i class="fas fa-link"></i></a>
</h3>
<h4 id="toc-properties">
Properties
<a href="classes/chillerlan-QRCode-Detector-AlignmentPatternFinder.html#toc-properties" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<dl class="phpdocumentor-table-of-contents">
<dt class="phpdocumentor-table-of-contents__entry -property -private">
<a class="" href="classes/chillerlan-QRCode-Detector-AlignmentPatternFinder.html#property_matrix">$matrix</a>
<span>
&nbsp;: <a href="classes/chillerlan-QRCode-Decoder-BitMatrix.html"><abbr title="\chillerlan\QRCode\Decoder\BitMatrix">BitMatrix</abbr></a> </span>
</dt>
<dt class="phpdocumentor-table-of-contents__entry -property -private">
<a class="" href="classes/chillerlan-QRCode-Detector-AlignmentPatternFinder.html#property_moduleSize">$moduleSize</a>
<span>
&nbsp;: float </span>
</dt>
<dt class="phpdocumentor-table-of-contents__entry -property -private">
<a class="" href="classes/chillerlan-QRCode-Detector-AlignmentPatternFinder.html#property_possibleCenters">$possibleCenters</a>
<span>
&nbsp;: array&lt;string|int, <a href="classes/chillerlan-QRCode-Detector-AlignmentPattern.html"><abbr title="\chillerlan\QRCode\Detector\AlignmentPattern">AlignmentPattern</abbr></a>&gt; </span>
</dt>
</dl>
<h4 id="toc-methods">
Methods
<a href="classes/chillerlan-QRCode-Detector-AlignmentPatternFinder.html#toc-methods" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<dl class="phpdocumentor-table-of-contents">
<dt class="phpdocumentor-table-of-contents__entry -method -public">
<a class="" href="classes/chillerlan-QRCode-Detector-AlignmentPatternFinder.html#method___construct">__construct()</a>
<span>
&nbsp;: mixed </span>
</dt>
<dd>Creates a finder that will look in a portion of the whole image.</dd>
<dt class="phpdocumentor-table-of-contents__entry -method -public">
<a class="" href="classes/chillerlan-QRCode-Detector-AlignmentPatternFinder.html#method_find">find()</a>
<span>
&nbsp;: <a href="classes/chillerlan-QRCode-Detector-AlignmentPattern.html"><abbr title="\chillerlan\QRCode\Detector\AlignmentPattern">AlignmentPattern</abbr></a>|null </span>
</dt>
<dd>This method attempts to find the bottom-right alignment pattern in the image. It is a bit messy since
it&#039;s pretty performance-critical and so is written to be fast foremost.</dd>
<dt class="phpdocumentor-table-of-contents__entry -method -private">
<a class="" href="classes/chillerlan-QRCode-Detector-AlignmentPatternFinder.html#method_centerFromEnd">centerFromEnd()</a>
<span>
&nbsp;: float </span>
</dt>
<dd>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.</dd>
<dt class="phpdocumentor-table-of-contents__entry -method -private">
<a class="" href="classes/chillerlan-QRCode-Detector-AlignmentPatternFinder.html#method_crossCheckVertical">crossCheckVertical()</a>
<span>
&nbsp;: float|null </span>
</dt>
<dd>After a horizontal scan finds a potential alignment pattern, this method
&quot;cross-checks&quot; by scanning down vertically through the center of the possible
alignment pattern to see if the same proportion is detected.</dd>
<dt class="phpdocumentor-table-of-contents__entry -method -private">
<a class="" href="classes/chillerlan-QRCode-Detector-AlignmentPatternFinder.html#method_foundPatternCross">foundPatternCross()</a>
<span>
&nbsp;: bool </span>
</dt>
<dt class="phpdocumentor-table-of-contents__entry -method -private">
<a class="" href="classes/chillerlan-QRCode-Detector-AlignmentPatternFinder.html#method_handlePossibleCenter">handlePossibleCenter()</a>
<span>
&nbsp;: <a href="classes/chillerlan-QRCode-Detector-AlignmentPattern.html"><abbr title="\chillerlan\QRCode\Detector\AlignmentPattern">AlignmentPattern</abbr></a>|null </span>
</dt>
<dd>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.</dd>
</dl>
<section class="phpdocumentor-properties">
<h3 class="phpdocumentor-elements__header" id="properties">
Properties
<a href="classes/chillerlan-QRCode-Detector-AlignmentPatternFinder.html#properties" class="headerlink"><i class="fas fa-link"></i></a>
</h3>
<article
class="
phpdocumentor-element
-property
-private
"
>
<h4 class="phpdocumentor-element__name" id="property_matrix">
$matrix
<a href="classes/chillerlan-QRCode-Detector-AlignmentPatternFinder.html#property_matrix" class="headerlink"><i class="fas fa-link"></i></a>
<span class="phpdocumentor-element__modifiers">
</span>
</h4>
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/Detector/AlignmentPatternFinder.php"><a href="files/src-detector-alignmentpatternfinder.html"><abbr title="src/Detector/AlignmentPatternFinder.php">AlignmentPatternFinder.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">34</span>
</aside>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">private</span>
<span class="phpdocumentor-signature__type"><a href="classes/chillerlan-QRCode-Decoder-BitMatrix.html"><abbr title="\chillerlan\QRCode\Decoder\BitMatrix">BitMatrix</abbr></a></span>
<span class="phpdocumentor-signature__name">$matrix</span>
</code>
</article>
<article
class="
phpdocumentor-element
-property
-private
"
>
<h4 class="phpdocumentor-element__name" id="property_moduleSize">
$moduleSize
<a href="classes/chillerlan-QRCode-Detector-AlignmentPatternFinder.html#property_moduleSize" class="headerlink"><i class="fas fa-link"></i></a>
<span class="phpdocumentor-element__modifiers">
</span>
</h4>
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/Detector/AlignmentPatternFinder.php"><a href="files/src-detector-alignmentpatternfinder.html"><abbr title="src/Detector/AlignmentPatternFinder.php">AlignmentPatternFinder.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">35</span>
</aside>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">private</span>
<span class="phpdocumentor-signature__type">float</span>
<span class="phpdocumentor-signature__name">$moduleSize</span>
</code>
</article>
<article
class="
phpdocumentor-element
-property
-private
"
>
<h4 class="phpdocumentor-element__name" id="property_possibleCenters">
$possibleCenters
<a href="classes/chillerlan-QRCode-Detector-AlignmentPatternFinder.html#property_possibleCenters" class="headerlink"><i class="fas fa-link"></i></a>
<span class="phpdocumentor-element__modifiers">
</span>
</h4>
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/Detector/AlignmentPatternFinder.php"><a href="files/src-detector-alignmentpatternfinder.html"><abbr title="src/Detector/AlignmentPatternFinder.php">AlignmentPatternFinder.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">37</span>
</aside>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">private</span>
<span class="phpdocumentor-signature__type">array&lt;string|int, <a href="classes/chillerlan-QRCode-Detector-AlignmentPattern.html"><abbr title="\chillerlan\QRCode\Detector\AlignmentPattern">AlignmentPattern</abbr></a>&gt;</span>
<span class="phpdocumentor-signature__name">$possibleCenters</span>
</code>
</article>
</section>
<section class="phpdocumentor-methods">
<h3 class="phpdocumentor-elements__header" id="methods">
Methods
<a href="classes/chillerlan-QRCode-Detector-AlignmentPatternFinder.html#methods" class="headerlink"><i class="fas fa-link"></i></a>
</h3>
<article
class="phpdocumentor-element
-method
-public
"
>
<h4 class="phpdocumentor-element__name" id="method___construct">
__construct()
<a href="classes/chillerlan-QRCode-Detector-AlignmentPatternFinder.html#method___construct" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/Detector/AlignmentPatternFinder.php"><a href="files/src-detector-alignmentpatternfinder.html"><abbr title="src/Detector/AlignmentPatternFinder.php">AlignmentPatternFinder.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">45</span>
</aside>
<p class="phpdocumentor-summary">Creates a finder that will look in a portion of the whole image.</p>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">public</span>
<span class="phpdocumentor-signature__name">__construct</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__type"><a href="classes/chillerlan-QRCode-Decoder-BitMatrix.html"><abbr title="\chillerlan\QRCode\Decoder\BitMatrix">BitMatrix</abbr></a>&nbsp;</span><span class="phpdocumentor-signature__argument__name">$matrix</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__type">float&nbsp;</span><span class="phpdocumentor-signature__argument__name">$moduleSize</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">mixed</span></code>
<div class="phpdocumentor-label-line">
</div>
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
<dl class="phpdocumentor-argument-list">
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-argument-list__argument__name">$matrix</span>
: <span class="phpdocumentor-argument-list__argument__type"><a href="classes/chillerlan-QRCode-Decoder-BitMatrix.html"><abbr title="\chillerlan\QRCode\Decoder\BitMatrix">BitMatrix</abbr></a></span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
<section class="phpdocumentor-description"><p>image to search</p>
</section>
</dd>
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-argument-list__argument__name">$moduleSize</span>
: <span class="phpdocumentor-argument-list__argument__type">float</span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
<section class="phpdocumentor-description"><p>estimated module size so far</p>
</section>
</dd>
</dl>
</article>
<article
class="phpdocumentor-element
-method
-public
"
>
<h4 class="phpdocumentor-element__name" id="method_find">
find()
<a href="classes/chillerlan-QRCode-Detector-AlignmentPatternFinder.html#method_find" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/Detector/AlignmentPatternFinder.php"><a href="files/src-detector-alignmentpatternfinder.html"><abbr title="src/Detector/AlignmentPatternFinder.php">AlignmentPatternFinder.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">62</span>
</aside>
<p class="phpdocumentor-summary">This method attempts to find the bottom-right alignment pattern in the image. It is a bit messy since
it&#039;s pretty performance-critical and so is written to be fast foremost.</p>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">public</span>
<span class="phpdocumentor-signature__name">find</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__type">int&nbsp;</span><span class="phpdocumentor-signature__argument__name">$startX</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__type">int&nbsp;</span><span class="phpdocumentor-signature__argument__name">$startY</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__type">int&nbsp;</span><span class="phpdocumentor-signature__argument__name">$width</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__type">int&nbsp;</span><span class="phpdocumentor-signature__argument__name">$height</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type"><a href="classes/chillerlan-QRCode-Detector-AlignmentPattern.html"><abbr title="\chillerlan\QRCode\Detector\AlignmentPattern">AlignmentPattern</abbr></a>|null</span></code>
<div class="phpdocumentor-label-line">
</div>
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
<dl class="phpdocumentor-argument-list">
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-argument-list__argument__name">$startX</span>
: <span class="phpdocumentor-argument-list__argument__type">int</span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
<section class="phpdocumentor-description"><p>left column from which to start searching</p>
</section>
</dd>
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-argument-list__argument__name">$startY</span>
: <span class="phpdocumentor-argument-list__argument__type">int</span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
<section class="phpdocumentor-description"><p>top row from which to start searching</p>
</section>
</dd>
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-argument-list__argument__name">$width</span>
: <span class="phpdocumentor-argument-list__argument__type">int</span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
<section class="phpdocumentor-description"><p>width of region to search</p>
</section>
</dd>
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-argument-list__argument__name">$height</span>
: <span class="phpdocumentor-argument-list__argument__type">int</span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
<section class="phpdocumentor-description"><p>height of region to search</p>
</section>
</dd>
</dl>
<section>
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
<span class="phpdocumentor-signature__response_type"><a href="classes/chillerlan-QRCode-Detector-AlignmentPattern.html"><abbr title="\chillerlan\QRCode\Detector\AlignmentPattern">AlignmentPattern</abbr></a>|null</span>
</section>
</article>
<article
class="phpdocumentor-element
-method
-private
"
>
<h4 class="phpdocumentor-element__name" id="method_centerFromEnd">
centerFromEnd()
<a href="classes/chillerlan-QRCode-Detector-AlignmentPatternFinder.html#method_centerFromEnd" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/Detector/AlignmentPatternFinder.php"><a href="files/src-detector-alignmentpatternfinder.html"><abbr title="src/Detector/AlignmentPatternFinder.php">AlignmentPatternFinder.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">207</span>
</aside>
<p class="phpdocumentor-summary">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.</p>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">private</span>
<span class="phpdocumentor-signature__name">centerFromEnd</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__type">array&lt;string|int, int&gt;&nbsp;</span><span class="phpdocumentor-signature__argument__name">$stateCount</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__type">int&nbsp;</span><span class="phpdocumentor-signature__argument__name">$end</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">float</span></code>
<div class="phpdocumentor-label-line">
</div>
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
<dl class="phpdocumentor-argument-list">
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-argument-list__argument__name">$stateCount</span>
: <span class="phpdocumentor-argument-list__argument__type">array&lt;string|int, int&gt;</span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
</dd>
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-argument-list__argument__name">$end</span>
: <span class="phpdocumentor-argument-list__argument__type">int</span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
</dd>
</dl>
<section>
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
<span class="phpdocumentor-signature__response_type">float</span>
</section>
</article>
<article
class="phpdocumentor-element
-method
-private
"
>
<h4 class="phpdocumentor-element__name" id="method_crossCheckVertical">
crossCheckVertical()
<a href="classes/chillerlan-QRCode-Detector-AlignmentPatternFinder.html#method_crossCheckVertical" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/Detector/AlignmentPatternFinder.php"><a href="files/src-detector-alignmentpatternfinder.html"><abbr title="src/Detector/AlignmentPatternFinder.php">AlignmentPatternFinder.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">223</span>
</aside>
<p class="phpdocumentor-summary">After a horizontal scan finds a potential alignment pattern, this method
&quot;cross-checks&quot; by scanning down vertically through the center of the possible
alignment pattern to see if the same proportion is detected.</p>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">private</span>
<span class="phpdocumentor-signature__name">crossCheckVertical</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__type">int&nbsp;</span><span class="phpdocumentor-signature__argument__name">$startI</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__type">int&nbsp;</span><span class="phpdocumentor-signature__argument__name">$centerJ</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__type">int&nbsp;</span><span class="phpdocumentor-signature__argument__name">$maxCount</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__type">int&nbsp;</span><span class="phpdocumentor-signature__argument__name">$originalStateCountTotal</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">float|null</span></code>
<div class="phpdocumentor-label-line">
</div>
<section class="phpdocumentor-description"><p>$startI row where an alignment pattern was detected
$centerJ center of the section that appears to cross an alignment pattern
$maxCount maximum reasonable number of modules that should be
observed in any reading state, based on the results of the horizontal scan</p>
<p>returns vertical center of alignment pattern, or null if not found</p>
</section>
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
<dl class="phpdocumentor-argument-list">
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-argument-list__argument__name">$startI</span>
: <span class="phpdocumentor-argument-list__argument__type">int</span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
</dd>
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-argument-list__argument__name">$centerJ</span>
: <span class="phpdocumentor-argument-list__argument__type">int</span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
</dd>
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-argument-list__argument__name">$maxCount</span>
: <span class="phpdocumentor-argument-list__argument__type">int</span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
</dd>
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-argument-list__argument__name">$originalStateCountTotal</span>
: <span class="phpdocumentor-argument-list__argument__type">int</span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
</dd>
</dl>
<section>
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
<span class="phpdocumentor-signature__response_type">float|null</span>
</section>
</article>
<article
class="phpdocumentor-element
-method
-private
"
>
<h4 class="phpdocumentor-element__name" id="method_foundPatternCross">
foundPatternCross()
<a href="classes/chillerlan-QRCode-Detector-AlignmentPatternFinder.html#method_foundPatternCross" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/Detector/AlignmentPatternFinder.php"><a href="files/src-detector-alignmentpatternfinder.html"><abbr title="src/Detector/AlignmentPatternFinder.php">AlignmentPatternFinder.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">154</span>
</aside>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">private</span>
<span class="phpdocumentor-signature__name">foundPatternCross</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__type">array&lt;string|int, int&gt;&nbsp;</span><span class="phpdocumentor-signature__argument__name">$stateCount</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">bool</span></code>
<div class="phpdocumentor-label-line">
</div>
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
<dl class="phpdocumentor-argument-list">
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-argument-list__argument__name">$stateCount</span>
: <span class="phpdocumentor-argument-list__argument__type">array&lt;string|int, int&gt;</span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
<section class="phpdocumentor-description"><p>count of black/white/black pixels just read</p>
</section>
</dd>
</dl>
<section>
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
<span class="phpdocumentor-signature__response_type">bool</span>
&mdash;
<section class="phpdocumentor-description"><p>true if the proportions of the counts is close enough to the 1/1/1 ratios
used by alignment patterns to be considered a match</p>
</section>
</section>
</article>
<article
class="phpdocumentor-element
-method
-private
"
>
<h4 class="phpdocumentor-element__name" id="method_handlePossibleCenter">
handlePossibleCenter()
<a href="classes/chillerlan-QRCode-Detector-AlignmentPatternFinder.html#method_handlePossibleCenter" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/Detector/AlignmentPatternFinder.php"><a href="files/src-detector-alignmentpatternfinder.html"><abbr title="src/Detector/AlignmentPatternFinder.php">AlignmentPatternFinder.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">178</span>
</aside>
<p class="phpdocumentor-summary">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>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">private</span>
<span class="phpdocumentor-signature__name">handlePossibleCenter</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__type">array&lt;string|int, int&gt;&nbsp;</span><span class="phpdocumentor-signature__argument__name">$stateCount</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__type">int&nbsp;</span><span class="phpdocumentor-signature__argument__name">$i</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__type">int&nbsp;</span><span class="phpdocumentor-signature__argument__name">$j</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type"><a href="classes/chillerlan-QRCode-Detector-AlignmentPattern.html"><abbr title="\chillerlan\QRCode\Detector\AlignmentPattern">AlignmentPattern</abbr></a>|null</span></code>
<div class="phpdocumentor-label-line">
</div>
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
<dl class="phpdocumentor-argument-list">
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-argument-list__argument__name">$stateCount</span>
: <span class="phpdocumentor-argument-list__argument__type">array&lt;string|int, int&gt;</span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
<section class="phpdocumentor-description"><p>reading state module counts from horizontal scan</p>
</section>
</dd>
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-argument-list__argument__name">$i</span>
: <span class="phpdocumentor-argument-list__argument__type">int</span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
<section class="phpdocumentor-description"><p>row where alignment pattern may be found</p>
</section>
</dd>
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-argument-list__argument__name">$j</span>
: <span class="phpdocumentor-argument-list__argument__type">int</span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
<section class="phpdocumentor-description"><p>end of possible alignment pattern in row</p>
</section>
</dd>
</dl>
<section>
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
<span class="phpdocumentor-signature__response_type"><a href="classes/chillerlan-QRCode-Detector-AlignmentPattern.html"><abbr title="\chillerlan\QRCode\Detector\AlignmentPattern">AlignmentPattern</abbr></a>|null</span>
&mdash;
<section class="phpdocumentor-description"><p>if we have found the same pattern twice, or null if not</p>
</section>
</section>
</article>
</section>
</article>
</section>
<section class="phpdocumentor-on-this-page__sidebar">
<section class="phpdocumentor-on-this-page__content">
<strong class="phpdocumentor-on-this-page__title">On this page</strong>
<ul class="phpdocumentor-list -clean">
<li class="phpdocumentor-on-this-page-section__title">Table Of Contents</li>
<li>
<ul class="phpdocumentor-list -clean">
<li><a href="classes/chillerlan-QRCode-Detector-AlignmentPatternFinder.html#toc-properties">Properties</a></li>
<li><a href="classes/chillerlan-QRCode-Detector-AlignmentPatternFinder.html#toc-methods">Methods</a></li>
</ul>
</li>
<li class="phpdocumentor-on-this-page-section__title">Properties</li>
<li>
<ul class="phpdocumentor-list -clean">
<li class=""><a href="classes/chillerlan-QRCode-Detector-AlignmentPatternFinder.html#property_matrix">$matrix</a></li>
<li class=""><a href="classes/chillerlan-QRCode-Detector-AlignmentPatternFinder.html#property_moduleSize">$moduleSize</a></li>
<li class=""><a href="classes/chillerlan-QRCode-Detector-AlignmentPatternFinder.html#property_possibleCenters">$possibleCenters</a></li>
</ul>
</li>
<li class="phpdocumentor-on-this-page-section__title">Methods</li>
<li>
<ul class="phpdocumentor-list -clean">
<li class=""><a href="classes/chillerlan-QRCode-Detector-AlignmentPatternFinder.html#method___construct">__construct()</a></li>
<li class=""><a href="classes/chillerlan-QRCode-Detector-AlignmentPatternFinder.html#method_find">find()</a></li>
<li class=""><a href="classes/chillerlan-QRCode-Detector-AlignmentPatternFinder.html#method_centerFromEnd">centerFromEnd()</a></li>
<li class=""><a href="classes/chillerlan-QRCode-Detector-AlignmentPatternFinder.html#method_crossCheckVertical">crossCheckVertical()</a></li>
<li class=""><a href="classes/chillerlan-QRCode-Detector-AlignmentPatternFinder.html#method_foundPatternCross">foundPatternCross()</a></li>
<li class=""><a href="classes/chillerlan-QRCode-Detector-AlignmentPatternFinder.html#method_handlePossibleCenter">handlePossibleCenter()</a></li>
</ul>
</li>
</ul>
</section>
</section>
</div>
<section data-search-results class="phpdocumentor-search-results phpdocumentor-search-results--hidden">
<section class="phpdocumentor-search-results__dialog">
<header class="phpdocumentor-search-results__header">
<h2 class="phpdocumentor-search-results__title">Search results</h2>
<button class="phpdocumentor-search-results__close"><i class="fas fa-times"></i></button>
</header>
<section class="phpdocumentor-search-results__body">
<ul class="phpdocumentor-search-results__entries"></ul>
</section>
</section>
</section>
</div>
<a href="classes/chillerlan-QRCode-Detector-AlignmentPatternFinder.html#top" class="phpdocumentor-back-to-top"><i class="fas fa-chevron-circle-up"></i></a>
</main>
<script>
cssVars({});
</script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/prism.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/autoloader/prism-autoloader.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.min.js"></script>
</body>
</html>