]> Skullheadx's Git Forge - qrcodescanner.git/commitdiff
Fixed so that the data codewords come BEFORE the error correction codewords
authorSkullheadx <admonty1@gmail.com>
Thu, 21 Nov 2024 00:19:29 +0000 (19:19 -0500)
committerSkullheadx <admonty1@gmail.com>
Thu, 21 Nov 2024 00:19:29 +0000 (19:19 -0500)
camera.cpp
output.pbm
qrgenerator.cpp

index 4f979f27bf4bf1cc83898a5d586bb76c39baf8f8..b21c383b6b53a7ac02703b167aaa928f394c9ede 100644 (file)
@@ -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);
+
+        
        
 
 
index 48a169fa4728d3b7d1e774045c318f8446ebe849..2ff441944bc045acdaa840319160291f1feb10dc 100644 (file)
@@ -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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 1 0 1 1 1 0 1 0 0 1 
+1 0 1 1 1 0 1 0 0 1 0 0 0 0 1 1 0 1 1 1 0 
+1 0 1 1 1 0 1 0 1 0 0 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 
index 7a550ae3ca9fd8d432928bbefd7144093baa79c3..a1270247b79ea532a167d01ddb2bad3e31b01322 100644 (file)
@@ -274,7 +274,7 @@ int main() {
        
        // final message codeword sequence
        std::vector<bool> 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){