Skip to content

Commit 81ef065

Browse files
committed
:octocat: allow reflectance reversal via QROptions::$invertMatrix
1 parent 502dd69 commit 81ef065

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/Output/QROutputAbstract.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ public function __construct(SettingsContainerInterface $options, QRMatrix $matri
6161
$this->options = $options;
6262
$this->matrix = $matrix;
6363

64+
if($this->options->invertMatrix){
65+
$this->matrix->invert();
66+
}
67+
6468
$this->setMatrixDimensions();
6569
$this->setModuleValues();
6670
}

src/QROptionsTrait.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,13 @@ trait QROptionsTrait{
157157
*/
158158
protected $bgColor = null;
159159

160+
/**
161+
* Whether to invert the matrix (reflectance reversal)
162+
*/
163+
protected bool $invertMatrix = false;
164+
160165
/**
161166
* Whether to draw the light (false) modules
162-
*
163-
* @var bool
164167
*/
165168
protected bool $drawLightModules = true;
166169

0 commit comments

Comments
 (0)