Returns the number of 8-bit codewords that can be used for storing data (not ECC), for the given version number and error correction level. The result is in the range [9, 2956].
| 237 | // Returns the number of 8-bit codewords that can be used for storing data (not ECC), |
| 238 | // for the given version number and error correction level. The result is in the range [9, 2956]. |
| 239 | testable int getNumDataCodewords(int version, enum qrcodegen_Ecc ecl) { |
| 240 | int v = version, e = (int)ecl; |
| 241 | assert(0 <= e && e < 4 && qrcodegen_VERSION_MIN <= v && v <= qrcodegen_VERSION_MAX); |
| 242 | return getNumRawDataModules(v) / 8 - c_read8(&ECC_CODEWORDS_PER_BLOCK[e][v]) * c_read8(&NUM_ERROR_CORRECTION_BLOCKS[e][v]); |
| 243 | } |
| 244 | |
| 245 | |
| 246 | // Returns the number of data bits that can be stored in a QR Code of the given version number, after |
no test coverage detected