How to load 30 BMP frames to device ?


I would like to load about 30 BMP frames (30 layers of one image) to device
and then merge the layers to one image .
I would like to do that (only the merging) with openGL (in order to get better perfomance)
I dont want to display the image only the merging and then back the image to save on disk.
Any idea how to do that?


Well, the brute-force way would be to load either load your pixels into 30 texture objects and then render correctly sized quads and do some blending operation either with a shader or with fixed blending ops and then read the resulting data back to the application with glReadPixels(). Note that this definitely not the only way to do it, but it’s the most simple way IMHO. The problem I see here is that you don’t define what merging means in your context.
Please be more specific.


to be more specific
I run over the layer
for (…each layer…){
for (…image Width…){
for (…image Height…)
ouputImage += F(x,y,Layer) ///where F is some function that “merge the pixel for for all layers to one outputImage”

since I m Newbie to openGL can you also give the basic gl functions (best prototype) of how to do that?

Thanks much

The question remains: what is F? Do you want addition, multiplication, difference? Pick one and I’ll try to give you an example.

The rest is fairly basic and not a problem at all.


F chose the visible pixel from the all layers and put it in ouput image (here rgmb_main_raster is output image)


How do you determine alpha? Is is a fixed value? Is it supposed to be determined and stored per pixel? What is k?

k is constant 0.5
alpha is per pixel