How do I determine if I've loaded a greyscale image

Hi, can somebody tell me how I can determine if the
image that I’ve loaded into an SDL_Surface is
greyscale or not. My intention is to load color images
into OpenGL using GL_RGBA and use something else for
greyscale (such as GL_LUMINANCE_ALPHA).

Thanks__________________________________
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.

Analyze each pixel to see if the value of R == G == B. To get the pixel
value of an image, use getpixel() found here:

http://sdldoc.csn.ul.ie/guidevideo.php#AEN112

And Suface->w and Surface->h tells the size of the image.

-MarkOn Fri, 12 Dec 2003, Eric Wing wrote:

Hi, can somebody tell me how I can determine if the
image that I’ve loaded into an SDL_Surface is
greyscale or not. My intention is to load color images
into OpenGL using GL_RGBA and use something else for
greyscale (such as GL_LUMINANCE_ALPHA).

Thanks


Mark K. Kim
AIM: markus kimius
Homepage: http://www.cbreak.org/
Xanga: http://www.xanga.com/vindaci
Friendster: http://www.friendster.com/user.jsp?id=13046
PGP key fingerprint: 7324 BACA 53AD E504 A76E 5167 6822 94F0 F298 5DCE
PGP key available on the homepage