Pixel Format Help

Hi,

I’m writing a OpenGL texture loader. It needs to be able to load data from
an SDL_Surface.

Surfaces have different formats, and really the only one I understand is
RGBA (Uint32). How is RGB stored? What is Uint16 do? What about a Uint8
surface? Does that have just one channel?

My big question is: how do I translate the pixel data from ANY surface of
ANY format to an OpenGL texture?

Thanks,
Ian