getModuleAt($row, $col)->isDark() ? 1 : 0; $shouldInvert = $mask2->shouldInvert($row, $col); $unmaskedValue = $shouldInvert ? (1 - $maskedValue) : $maskedValue; echo sprintf( " [%2d,%2d]: masked=%d, shouldInvert=%s, unmasked=%d\n", $row, $col, $maskedValue, $shouldInvert ? 'Y' : 'N', $unmaskedValue ); } echo "\nThis shows the actual data bits before masking.\n"; echo "If data placement is correct, these should match the encoded codewords.\n";