tesseract v5.3.3.20231005
tesseract::TestableQRSequenceGenerator Class Reference
Inheritance diagram for tesseract::TestableQRSequenceGenerator:
QRSequenceGenerator

Public Member Functions

 TestableQRSequenceGenerator (const int &N)
 
int GetBinaryReversedInteger (int in_val) const
 
- Public Member Functions inherited from QRSequenceGenerator
 QRSequenceGenerator (int N)
 
int GetVal ()
 

Additional Inherited Members

- Protected Member Functions inherited from QRSequenceGenerator
int GetBinaryReversedInteger (int in_val) const
 
- Protected Attributes inherited from QRSequenceGenerator
int N_
 
int next_num_
 
int num_bits_
 

Detailed Description

Definition at line 22 of file qrsequence_test.cc.

Constructor & Destructor Documentation

◆ TestableQRSequenceGenerator()

tesseract::TestableQRSequenceGenerator::TestableQRSequenceGenerator ( const int &  N)
inlineexplicit

Definition at line 24 of file qrsequence_test.cc.

QRSequenceGenerator(int N)
Definition: qrsequence.h:34

Member Function Documentation

◆ GetBinaryReversedInteger()

int QRSequenceGenerator::GetBinaryReversedInteger ( int  in_val) const
inline

Definition at line 60 of file qrsequence.h.

60 {
61 int bit_pos = num_bits_;
62 int out_val = 0;
63 while (bit_pos--) {
64 // Set the value of the last bit.
65 out_val |= (in_val & 0x1);
66 if (bit_pos > 0) {
67 // Left-shift output value to prepare for storing the next bit.
68 out_val <<= 1;
69 }
70 // Right-shift input value to prepare for retrieving the next bit.
71 in_val >>= 1;
72 }
73 return out_val;
74 }

The documentation for this class was generated from the following file: