PDA

View Full Version : Where can i find the manual for glaux? Need it very urgent!!!



jacky_cheecheo
04-16-2003, 09:42 AM
I need the properties of this type definition

AUX_RGBImageRec

Deiussum
04-16-2003, 09:46 AM
glaux.h is always a good source to find out stuff like that.




/*
** RGB Image Structure
*/

typedef struct _AUX_RGBImageRec {
GLint sizeX, sizeY;
unsigned char *data;
} AUX_RGBImageRec;

jacky_cheecheo
04-16-2003, 09:55 AM
i have an image loaded with this:

AUX_RGBImageRec *TextureImage[1];

memset(TextureImage,0,sizeof(void *)*1);
TextureImage[0]=LoadBMP("Textures/Brick/tuile1.bmp")

is there a way for me to get the perpixel data of the bitmap?

Deiussum
04-16-2003, 10:04 AM
That's where the data member would come in.

nexusone
04-16-2003, 10:10 AM
I don't know if there is a real manual for it other then the help files on the VC++ CD.

You can try Microsoft help, since it is their library.

or a google search.



Originally posted by jacky_cheecheo:
I need the properties of this type definition

AUX_RGBImageRec

jacky_cheecheo
04-16-2003, 10:15 AM
Hi Deiussum,

Can you pls. elaborate what you mean by that...I don't really understand what you're trying to say!!!

What i need is to get the value of each of the pixels in the data! Is is even possible?

Deiussum
04-16-2003, 11:53 AM
What I mean is, all the pixel data is in the AUX_RGBImageRec::data member.

Maybe some code would explain:




struct RGBColor
{
unsigned char r, g, b;
};

RGBColor GetPixelColor(AUX_RGBImageRec* pImg, int x, int y)
{
RGBColor results;
int index = (x+y*pImg->Width)*3;

results.r = pImg->data[index];
results.g = pImg->data[index+1];
results.b = pImg->data[index+2];

return results;
}

void main()
{
AUX_RGBImageRec* pImg = auxRGBImageLoad("someimage.bmp");
RGBColor color = GetPixelColor(pImg, 0, 0);
cout << color.r << "," << color.g << "," << color.b << endl;
}

jacky_cheecheo
04-16-2003, 03:28 PM
Thank you Deiussum! That is exactly what i need...