MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/SPlisHSPlasH / flush

Method flush

extern/toojpeg/toojpeg.cpp:149–153  ·  view source on GitHub ↗

write all non-yet-written bits, fill gaps with 1s (that's a strange JPEG thing)

Source from the content-addressed store, hash-verified

147
148 // write all non-yet-written bits, fill gaps with 1s (that's a strange JPEG thing)
149 void flush()
150 {
151 // at most seven set bits needed to "fill" the last byte: 0x7F = binary 0111 1111
152 *this << BitCode(0x7F, 7); // I should set buffer.numBits = 0 but since there are no single bits written after flush() I can safely ignore it
153 }
154
155 // NOTE: all the following BitWriter functions IGNORE the BitBuffer and write straight to output !
156 // write a single byte

Callers 3

writeJpegFunction · 0.80
exportSamplesMethod · 0.80
writeMethod · 0.80

Calls 1

BitCodeClass · 0.85

Tested by

no test coverage detected