27 #ifndef TESSERACT_CCUTIL_QRSEQUENCE_H_ 28 #define TESSERACT_CCUTIL_QRSEQUENCE_H_ 36 num_bits_ =
static_cast<int>(ceil(log(static_cast<double>(N)) / log(2.0)));
42 const int kInvalidVal = -1;
43 const int kMaxNaturalNumberValue = 1 <<
num_bits_;
48 while (
next_num_ < kMaxNaturalNumberValue) {
52 return (
next_num_ > kMaxNaturalNumberValue) ? kInvalidVal : n;
63 out_val |= (in_val & 0x1);
80 #endif // TESSERACT_CCUTIL_QRSEQUENCE_H_ int num_bits_
Definition: qrsequence.h:77
int N_
Definition: qrsequence.h:73
int GetBinaryReversedInteger(int in_val) const
Definition: qrsequence.h:58
int next_num_
Definition: qrsequence.h:75
Definition: qrsequence.h:32
QRSequenceGenerator(int N)
Definition: qrsequence.h:35
int GetVal()
Definition: qrsequence.h:41