From: Skullheadx Date: Thu, 21 Nov 2024 00:19:29 +0000 (-0500) Subject: Fixed so that the data codewords come BEFORE the error correction codewords X-Git-Url: http://git.skullheadx.com/nixos/static/gitweb.css?a=commitdiff_plain;h=992d86c6feab2d3132ec6adc427748fb69d968a6;p=qrcodescanner.git Fixed so that the data codewords come BEFORE the error correction codewords --- diff --git a/camera.cpp b/camera.cpp index 4f979f2..b21c383 100644 --- a/camera.cpp +++ b/camera.cpp @@ -41,7 +41,9 @@ int main(){ std::cout << "Number of data codewords: " << data_codewords.size() / 8.0 << std::endl; std::cout << "Number of error correction codewords: " << error_correction_codewords.size() / 8.0 << std::endl; - //print_bytes(data_codewords); + print_bytes(data_codewords); + + diff --git a/output.pbm b/output.pbm index 48a169f..2ff4419 100644 --- a/output.pbm +++ b/output.pbm @@ -1,23 +1,23 @@ P1 21 21 -1 1 1 1 1 1 1 0 0 1 0 0 1 0 1 1 1 1 1 1 1 -1 0 0 0 0 0 1 0 1 1 1 1 0 0 1 0 0 0 0 0 1 +1 1 1 1 1 1 1 0 0 0 1 0 1 0 1 1 1 1 1 1 1 +1 0 0 0 0 0 1 0 1 0 1 0 0 0 1 0 0 0 0 0 1 1 0 1 1 1 0 1 0 0 1 0 0 1 0 1 0 1 1 1 0 1 -1 0 1 1 1 0 1 0 0 1 0 1 0 0 1 0 1 1 1 0 1 -1 0 1 1 1 0 1 0 1 0 1 1 1 0 1 0 1 1 1 0 1 -1 0 0 0 0 0 1 0 0 0 0 1 1 0 1 0 0 0 0 0 1 +1 0 1 1 1 0 1 0 0 0 1 0 1 0 1 0 1 1 1 0 1 +1 0 1 1 1 0 1 0 1 0 1 0 1 0 1 0 1 1 1 0 1 +1 0 0 0 0 0 1 0 0 0 0 0 1 0 1 0 0 0 0 0 1 1 1 1 1 1 1 1 0 1 0 1 0 1 0 1 1 1 1 1 1 1 -0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 -1 0 1 0 1 0 1 0 0 1 1 0 0 0 0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 0 1 0 0 0 1 0 1 0 1 +1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 1 0 1 1 0 0 +1 1 1 1 1 1 1 0 1 1 0 0 1 0 1 0 1 1 1 0 1 diff --git a/qrgenerator.cpp b/qrgenerator.cpp index 7a550ae..a127024 100644 --- a/qrgenerator.cpp +++ b/qrgenerator.cpp @@ -274,7 +274,7 @@ int main() { // final message codeword sequence std::vector codeword_message = input_data_vector; - codeword_message.insert(codeword_message.begin(), error_correction_codewords.begin(), error_correction_codewords.end()); + codeword_message.insert(codeword_message.end(), error_correction_codewords.begin(), error_correction_codewords.end()); std::cout << "Codeword Message (size = " << codeword_message.size()/8<<"): "; k = 0; for (auto i : codeword_message){