tesseract 5.2.0
Loading...
Searching...
No Matches
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.

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

Member Function Documentation

◆ Read()

int BitReader::Read ( void  )
inline

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

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

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