MCPcopy Create free account
hub / github.com/DFHack/dfhack / readBitsFromReversedStream

Function readBitsFromReversedStream

depends/lodepng/lodepng.cpp:2445–2453  ·  view source on GitHub ↗

TODO: make this faster */

Source from the content-addressed store, hash-verified

2443
2444/* TODO: make this faster */
2445static unsigned readBitsFromReversedStream(size_t* bitpointer, const unsigned char* bitstream, size_t nbits) {
2446 unsigned result = 0;
2447 size_t i;
2448 for(i = 0 ; i < nbits; ++i) {
2449 result <<= 1u;
2450 result |= (unsigned)readBitFromReversedStream(bitpointer, bitstream);
2451 }
2452 return result;
2453}
2454
2455static void setBitOfReversedStream(size_t* bitpointer, unsigned char* bitstream, unsigned char bit) {
2456 /*the current bit in bitstream may be 0 or 1 for this to work*/

Callers 3

getPixelColorRGBA8Function · 0.85
getPixelColorsRGBA8Function · 0.85
getPixelColorsRGB8Function · 0.85

Calls 1

Tested by

no test coverage detected