1
0
mirror of https://github.com/x-hw/amazing-qr.git synced 2025-07-15 01:24:37 +02:00

code more

This commit is contained in:
sylnsfar
2016-08-29 23:02:17 +08:00
parent e6fe986e6d
commit d1a9eba3ea
4 changed files with 99 additions and 11 deletions

View File

@ -7,17 +7,22 @@ def get_qrcode(ecl, str):
try:
# Data Coding
ver, data_codewords = data.encode(ecl, str)
ndc = 0
for i in range(len(data_codewords)):
ndc += len(data_codewords[i])
# Error Correction Coding
ecc = ECC.encode(ver, ecl, data_codewords)
ndc = 0
for i in range(len(data_codewords)):
ndc += len(data_codewords[i])
# Structure final bits
final_bits = structure.structure_final_bits(ver, ecl, data_codewords, ecc)
# Get the QR Matrix
qrmatrix = matrix.get_qrmatrix(ver, ecl, final_bits)
for i in qrmatrix:
print(i)
# Draw the picture
draw.draw_qrcode(qrmatrix)