Bmap |link| <Chrome TOP-RATED>

#include <stdint.h> int get_pixel(const uint8_t* bmap_data, int x, int y, int width) int byte_index = (y * width + x) / 8; int bit_offset = 7 - ((y * width + x) % 8); // MSB first return (bmap_data[byte_index] >> bit_offset) & 1;

Rows are often padded to byte boundaries. For instance, a row of 20 pixels requires 3 bytes (24 bits), with the last 4 bits unused/padded with zeros. #include &lt;stdint