mirror of
https://github.com/chillerlan/php-qrcode.git
synced 2026-08-24 09:28:04 +00:00
:octocat: return QRMatrix created from result data
This commit is contained in:
@@ -11,7 +11,8 @@
|
||||
|
||||
namespace chillerlan\QRCode\Decoder;
|
||||
|
||||
use chillerlan\QRCode\Common\{EccLevel, MaskPattern, Version};
|
||||
use chillerlan\QRCode\Data\QRMatrix;
|
||||
use chillerlan\QRCode\Common\{BitBuffer, EccLevel, MaskPattern, Version};
|
||||
use function property_exists;
|
||||
|
||||
/**
|
||||
@@ -83,4 +84,15 @@ final class DecoderResult{
|
||||
return $this->structuredAppendParity >= 0 && $this->structuredAppendSequence >= 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a QRMatrix instance with thesettings and data of the reader result
|
||||
*/
|
||||
public function getMatrix():QRMatrix{
|
||||
return (new QRMatrix($this->version, $this->eccLevel, $this->maskPattern))
|
||||
->initFunctionalPatterns()
|
||||
->writeCodewords(new BitBuffer($this->rawBytes))
|
||||
->mask()
|
||||
;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user