PDA

View Full Version : Bitmap in OpenGL



12-03-2000, 10:58 PM
Hi all, I'm a newbie to OpenGL. Just read the book OpenGL SuperBible from Waite Group Press.

In Chapter 8, they mention about texture mapping. However they used .bmp files to do it. I was wondering what about gif, jpeg and other file format.

For bitmap, there is BitmapFileHeader and BitmapInfo for me to get to the Bitmap/Pixel data. Is it the same procedure for gif, jpeg and the like? If yes, where can I get the file header format? And is the texture mapping method for gif, jpeg and the like the same as bitmap?

Thanks in advance.

Nutty
12-04-2000, 01:19 AM
The procedures used for grabbing the image data out of gif's and jpeg's is a bit more complex than BMP's.

After you have extracted the image information, texture mapping with it is identical, regardless of how you stored the image.

If you search on the net you should find image file formats. there seems to be a growing trend towards a file called .PNG

for Intels Jpeg library try. http://support.intel.com/support/performancetools/libraries/ijl/index.htm

And for PNG's try http://www.boutell.com/boutell/png/

hope thats helps,
Nutty

12-05-2000, 08:08 PM
Originally posted by Nutty:
for Intels Jpeg library try. http://support.intel.com/support/performancetools/libraries/ijl/index.htm
Nutty

Thanks a lot. Got hold of JPEG library to load files of jpeg format. Pity like most software company, they will only give you the library in binary format to access JPEG. How nice it would be if they could also release the source code so that we can understand the JPEG header format just like the BMP header format.

Now, anyone got any clue where to get hold of GIF file header format? Binary or source code is welcomed.

Thanks in advance.

Eric
12-05-2000, 10:07 PM
If you want source code for JPEG, go to http://www.ijg.org/ .This is the site of the Independant JPEG Group. I changed their distribution to allow me to use the library as a DLL and it is simply fantastic. Most people will tell you that it is a bit slower than Intel's....

As far as GIF are concerned, it is such a simple format that you won't find a specific library for it... Although LIBTIFF (http://www.libtiff.org/) has support for GIF, I am not sure how easy it is to use... Your best bet is to go to http://www.wotsit.org/ and look at the GIF format. It will take you 30mn to build a GIF reader !

Hope this will help you !

Best regards.

Eric

Deiussum
12-06-2000, 06:18 AM
Originally posted by Eric:

As far as GIF are concerned, it is such a simple format that you won't find a specific library for it... Although LIBTIFF (http://www.libtiff.org/) has support for GIF, I am not sure how easy it is to use... Your best bet is to go to http://www.wotsit.org/ and look at the GIF format. It will take you 30mn to build a GIF reader !


Wow, only 30 min? I looked at the GIF format awhile ago and even though the header was easy to understand, it took a couple days of closely examining the rest of it before I really understood how the LZW compression algorithm worked.

Eric
12-06-2000, 07:37 AM
Originally posted by Deiussum:
it took a couple days of closely examining the rest of it before I really understood how the LZW compression algorithm worked.

Hum, OK, I cheated here... I already knew the LZW compression algorithm...

That's probably why it didn't take me long ! http://www.opengl.org/discussion_boards/ubb/smile.gif

Regards.

Eric

Punchey
12-06-2000, 10:28 AM
Check out www.openil.org. (http://www.openil.org.) It is for images what OpenGL is for 3D graphics. I've heard it's DREAMY and supports MANY image formats AND works well with OpenGL. BTW, OpenIL stands for Open Image Library (or something like that as if you couldn't guess)

[This message has been edited by Punchey (edited 12-06-2000).]

Michael Steinberg
12-06-2000, 01:31 PM
I've written a bmp loader on sunday.
I've tested it with all formats from 1bpp to 24bpp, but I couldn't get a 32bpp bitmap. Has anybody a simple 32bpp image for me?