Feature: Labelprint für Kistenetiketten hinzugefügt
This commit is contained in:
+17
-6
@@ -25,6 +25,8 @@ use const NAN;
|
||||
final class Detector{
|
||||
|
||||
private BitMatrix $matrix;
|
||||
/** @var \chillerlan\QRCode\Detector\FinderPattern[] */
|
||||
private array $finderPatterns = [];
|
||||
|
||||
/**
|
||||
* Detector constructor.
|
||||
@@ -33,11 +35,20 @@ final class Detector{
|
||||
$this->matrix = (new Binarizer($source))->getBlackMatrix();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \chillerlan\QRCode\Detector\FinderPattern[]
|
||||
*/
|
||||
public function getFinderPatterns():array{
|
||||
return $this->finderPatterns;
|
||||
}
|
||||
|
||||
/**
|
||||
* Detects a QR Code in an image.
|
||||
*/
|
||||
public function detect():BitMatrix{
|
||||
[$bottomLeft, $topLeft, $topRight] = (new FinderPatternFinder($this->matrix))->find();
|
||||
$this->finderPatterns = (new FinderPatternFinder($this->matrix))->find();
|
||||
|
||||
[$bottomLeft, $topLeft, $topRight] = $this->finderPatterns;
|
||||
|
||||
$moduleSize = $this->calculateModuleSize($topLeft, $topRight, $bottomLeft);
|
||||
$dimension = $this->computeDimension($topLeft, $topRight, $bottomLeft, $moduleSize);
|
||||
@@ -305,11 +316,11 @@ final class Detector{
|
||||
*
|
||||
*/
|
||||
private function createTransform(
|
||||
FinderPattern $nw,
|
||||
FinderPattern $ne,
|
||||
FinderPattern $sw,
|
||||
int $size,
|
||||
AlignmentPattern $ap = null
|
||||
FinderPattern $nw,
|
||||
FinderPattern $ne,
|
||||
FinderPattern $sw,
|
||||
int $size,
|
||||
?AlignmentPattern $ap = null
|
||||
):PerspectiveTransform{
|
||||
$dimMinusThree = ($size - 3.5);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user