tesseract  5.0.0-alpha-619-ge9db
BitReader Class Reference

Public Member Functions

 BitReader (const uint8_t *data, size_t size)
 
int Read (void)
 

Detailed Description

Definition at line 17 of file fuzzer-api.cpp.

Constructor & Destructor Documentation

◆ BitReader()

BitReader::BitReader ( const uint8_t *  data,
size_t  size 
)
inline

Definition at line 24 of file fuzzer-api.cpp.

25  : data(data), size(size), shift(0) {}

Member Function Documentation

◆ Read()

int BitReader::Read ( void  )
inline

Definition at line 27 of file fuzzer-api.cpp.

27  {
28  if (size == 0) {
29  return 0;
30  }
31 
32  const int ret = ((*data) >> shift) & 1;
33 
34  shift++;
35  if (shift >= 8) {
36  shift = 0;
37  data++;
38  size--;
39  }
40 
41  return ret;
42  }

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