Posted By: Matt_Aufderheide
reading a lfoating point bmap - 12/02/14 18:55
Can someone explain how to read float values from a floating point bmap using the finalbits pointer...?
// RGBA, BGRA, ... #define CHANNEL_COUNT 4 int x, y; // Get the scanline (starts at finalbits and goes finalpitch bytes every line) float *scanline = (float*)(((char*)bmp->finalbits) + y * bmp->finalpitch); float channels[CHANNEL_COUNT]; for(i = 0; i < CHANNEL_COUNT; i++) { // Index each channel at x channels[i] = scanline[CHANNEL_COUNT * x + i]; // Offset in the scanline }