FinderPattern
extends ResultPoint
in package
FinalYes
Encapsulates a finder pattern, which are the three square patterns found in the corners of QR Codes. It also encapsulates a count of similar finder patterns, as a convenience to the finder's bookkeeping.
Tags
Table of Contents
Properties
- $estimatedModuleSize : float
- $x : float
- $y : float
- $count : int
Methods
- __construct() : mixed
- aboutEquals() : bool
- Determines if this finder pattern "about equals" a finder pattern at the stated position and size -- meaning, it is at nearly the same center with nearly the same size.
- combineEstimate() : static
- Combines this object's current estimate of a finder pattern position and module size with a new estimate. It returns a new FinderPattern containing a weighted average based on count.
- distance() : float
- getCount() : int
- getDistance() : float
- getEstimatedModuleSize() : float
- getSquaredDistance() : float
- Get square of distance between a and b.
- getX() : float
- getY() : float
- squaredDistance() : float
Properties
$estimatedModuleSize
protected
float
$estimatedModuleSize
$x
protected
float
$x
$y
protected
float
$y
$count
private
int
$count
Methods
__construct()
public
__construct(float $posX, float $posY, float $estimatedModuleSize[, int|null $count = null ]) : mixed
Parameters
- $posX : float
- $posY : float
- $estimatedModuleSize : float
- $count : int|null = null
aboutEquals()
Determines if this finder pattern "about equals" a finder pattern at the stated position and size -- meaning, it is at nearly the same center with nearly the same size.
public
aboutEquals(float $moduleSize, float $i, float $j) : bool
Parameters
- $moduleSize : float
- $i : float
- $j : float
Return values
boolcombineEstimate()
Combines this object's current estimate of a finder pattern position and module size with a new estimate. It returns a new FinderPattern containing a weighted average based on count.
public
combineEstimate(float $i, float $j, float $newModuleSize) : static
Parameters
- $i : float
- $j : float
- $newModuleSize : float
Return values
staticdistance()
public
static distance(float $aX, float $aY, float $bX, float $bY) : float
Parameters
- $aX : float
- $aY : float
- $bX : float
- $bY : float
Return values
floatgetCount()
public
getCount() : int
Return values
intgetDistance()
public
getDistance(FinderPattern $b) : float
Parameters
- $b : FinderPattern
-
second pattern
Return values
float —distance between two points
getEstimatedModuleSize()
public
getEstimatedModuleSize() : float
Return values
floatgetSquaredDistance()
Get square of distance between a and b.
public
getSquaredDistance(FinderPattern $b) : float
Parameters
- $b : FinderPattern
Return values
floatgetX()
public
getX() : float
Return values
floatgetY()
public
getY() : float
Return values
floatsquaredDistance()
private
static squaredDistance(float $aX, float $aY, float $bX, float $bY) : float
Parameters
- $aX : float
- $aY : float
- $bX : float
- $bY : float