View Full Version : Loading *.rgb file and Reading the Pixel values
07-14-2003, 11:43 PM
How to load an rgb file and store pixel values from the file.
glReadPixels reads the pixels from an image only.
Once I read the image, I want to store in an array,
Please tell me .
I am new to OPENGL.
07-16-2003, 12:53 PM
nehe.gamedev.net - lesson 6 I think is the one where he loads a bitmap. You just have to know the BITMAPHEADER structure, that's read from the file first, the rest is RGB data.
That's actually commonplace in OpenGL is that the image data is read into in array or pointer and then passed to, for example, glTexture2D.
07-16-2003, 04:17 PM
If you want more informations about bmp format there are good web site that explain you how it's made, so you can easierly use them. The Nehe Tut are very good to learn such a thing.
Ah, so rgb files are actually, windows bmp files...
Well, I learnt something.
07-17-2003, 05:57 PM
Well in fact I'm not sure...
Well let me see a seconde plize...
Oh Yeah! Exact. It seems that is not the same thing. Well I look in Paint Shop Pro (to make it quick) and RGB file or not at the same range than the BMP so I guess the are construct differently.But I don't how.
So sorry for my answer, and sorry I'm not an expert about it, I will look at it.
RGB file contain just that. simple red green and blue data for each pixel location.
very simple to open and read. as suggested check out the NehE tuts.
So it's a easy to use raw data file format...
[array of of (width)x(height)x(channels) entries (bytesPerChannel) bytes wide]
If it is so simple I will add it to my todo list... having more and more formats avaiable to choose is simply good.
07-18-2003, 04:38 AM
www.wotsit.org. (http://www.wotsit.org.) The place to go for file format specifications
Powered by vBulletin® Version 4.2.3 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.