PDA

View Full Version : RGB image display



suresh
04-17-2004, 05:54 AM
Hi,

I am a newbie to OpenGL. I want to display 24bit RGB (8,8,8) data of size 640x480 using OpenGL.My development target is Linux. So I found an example program to display a bitmap file at

http://www.codesampler.com/source/ogl_glx_sample_linux.zip

Using this example program i am able to display 128x128 image only. But not fullfill my requirement. How can i achieve this using OpenGL?

With Thanks & Regards,
suresh

04-17-2004, 04:35 PM
Why can you only display 128x128? Does the application crash, give you an error, or does it just not display anything?

If your graphics hardware can display textures no larger than 128x128, there's not a lot you can do about it. If the resolution of the 640x480 graphic can be dropped you could stretch it to cover the screen.

Otherwise, you could load a number of 128x128 graphics and tile them to create the effect of a much larger textured quad.

Also, note that non-power-of-two textures may not be supported on your hardware - 640 and 480 are non-power-of-two. You'd need to draw your 640x480 image in one corner of a 1024x512 image, then modify your texture coordinates to texture the quad with just the 640x480 part.

suresh
04-19-2004, 11:53 PM
Hi,

Thanks for ur reply cfmdobbie. I got success in displaying images of different resolutions. My requirement is to display 24-bit 1280x960 image data from camera over OpenGL at a rate of 30fps.
The problem is the time taken for displaying the 1280x960 image data is 2.23 seconds. I am using the function glDrawPixels() for displaying the image data from the camera.
Is there any way to achieve the number of frames per second.

With Thanks & Regards,
suresh

04-20-2004, 05:43 AM
Yikes!

1280x960 = 1,228,800 pixels, 24-bit = 3 bytes/pixel, so one frame = 3,686,400 bytes. At 30fps, that comes to 110,592,000 bytes per second.

Is there any chance of relaxing your requirements? That's one hell of a lot of data you're trying to push.