As far as it is relevant to the current problem:
I want to get RGB values from a 24 bit BGR data. This data is from a raw image without a header.
I don't know how to convert the index of the buffer to its corresponding RGB values.
here is what I have done:
window_width = 800;
window_height = 600;
size = window_width * window_height;
pixels = new float[size*3];
for(int i = 0, j = 0; i < size*3, j < size; i += 3, j++)
{
pixels[i+2] = bytes[i];
}
updateGL();
window_width = 800;
window_height = 600;
size = window_width * window_height;
pixels = new float[size*3];
for(int i = 0, j = 0; i < size*3, j < size; i += 3, j++)
{
pixels[i+2] = bytes[i];
}
updateGL();
To copy to clipboard, switch view to plain text mode
void GlWidget:
aintGL()
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glDrawPixels(window_width,window_height,GL_RGB,GL_ FLOAT,pixels);
}
what am i missing?
Bookmarks