mirror of
https://github.com/chillerlan/php-qrcode.git
synced 2026-08-28 02:57:57 +00:00
🚿
This commit is contained in:
@@ -160,7 +160,7 @@ final class Binarizer{
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function getHistogramBlackMatrix(int $width, int $height):BitMatrix{
|
||||
private function getHistogramBlackMatrix(int $width, int $height):BitMatrix{
|
||||
$matrix = new BitMatrix(max($width, $height));
|
||||
|
||||
// Quickly calculates the histogram by sampling four rows from the image. This proved to be
|
||||
|
||||
@@ -37,8 +37,7 @@ final class Decoder{
|
||||
* @throws \Throwable if the QR Code cannot be decoded
|
||||
*/
|
||||
public function decode(LuminanceSourceInterface $source):DecoderResult{
|
||||
$matrix = (new Binarizer($source))->getBlackMatrix();
|
||||
$bitMatrix = (new Detector($matrix))->detect();
|
||||
$bitMatrix = (new Detector($source))->detect();
|
||||
|
||||
try{
|
||||
// clone the BitMatrix to avoid errors in case we run into mirroring
|
||||
|
||||
Reference in New Issue
Block a user