Loading color index tables from files...
Hi! I''m kinda new to handling images in C++. I''m just wondering how do you handle the color index table and image data from an image file such as those BMPs made using Photoshop. Are there any special classes or something to use?
And also, does anyone know how or knows of a tutorial to use those color index tables on a texture using OpenGL?
I''m not quite sure of what you want to achieve but....if I am right you want some info about how to detect what kind of palette is used and how to use it in your program, right?
If not, then I''ll write the follwoing down for nothing, but......oh well.
I''ll take BMP''s for example.
BMP''s contain data just like every other file, but there is a part which contains the palette colors.......IF the bitmap is either 1, 2, 4 or 8 bit, otherwise there is NO palette.
For bitmaps you have a bitmapinfoheader....in that header is the palette stored.....
To load a bitmap, I think you''d better take a good look on the
BitmapInfoHeader and BitmapFileHeader.
I;''m a bit busy at work right now, so.....email me when you want more info
Dance with me......
If not, then I''ll write the follwoing down for nothing, but......oh well.
I''ll take BMP''s for example.
BMP''s contain data just like every other file, but there is a part which contains the palette colors.......IF the bitmap is either 1, 2, 4 or 8 bit, otherwise there is NO palette.
For bitmaps you have a bitmapinfoheader....in that header is the palette stored.....
To load a bitmap, I think you''d better take a good look on the
BitmapInfoHeader and BitmapFileHeader.
I;''m a bit busy at work right now, so.....email me when you want more info
Dance with me......
http://members.xoom.com/CJdeVos/index.htm
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement