qrencoder
qrencoder copied to clipboard
API method to get the used mask pattern
Hello,
could you add an API method to get some information about the mask pattern that has been used to generate the QR code?
The library does expose the QREncoder::QRCode#data method, which may do what you need. It returns an array of integers, each of whose bit is significant. From there, you can perform bitwise operations to get what you need. From the libqrencoder documentation:
MSB 76543210 LSB
|||||||`- 1=black/0=white
||||||`-- data and ecc code area
|||||`--- format information
||||`---- version information
|||`----- timing pattern
||`------ alignment pattern
|`------- finder pattern and separator
`-------- non-data modules (format, timing, etc.)
I know, but I was wondering whether this extraction could be performed directly by the qrencoder gem instead of application code. :)