\brief This file contains the #image_s struct and the function #loadImage(), which are used to load various image formats.
The following image formats are supported: BMP, PNM (PPM/PGM/PBM), XPM, LBM, PCX, GIF, JPEG, PNG, TGA, TIFF and RGB/RGBA (SGI). RGB is supported through my own loader in rgbloader.h, all other formats are loaded by SDL_image routines (see imageloader.h).
Color depth is scaled to one byte per component for all images (e.g. for rgb three bytes per pixel).
*/
//! This struct represents an image in memory
typedef struct image_s{
int width; //!< width of the image
int height; //!< height of the image
int numChannels; //!< number channels the image has (3=rgb, 4=rgba, ...)
unsigned char* data; //!< the image data as an array of bytes (size=width*height*numChannels)
}image_t;
class ImageLoader{
public:
//! loads an image and returns a corresponding #image_s struct