/*
 * read_texture() - read in an image file in SGI 'libimage' format
 * 	currently its very simple minded and converts all images
 *      to RGBA8 regardless of the input format and returns the
 *	original number of components in the appropriate parameter.
 *    
 *     
 *	the components are converted as follows
 *		L    -> LLL 1.0
 *		LA   -> LLL A
 *		RGB  -> RGB 1.0
 *		RGBA -> RGB A
 *
 */

//pixel format for ppm
struct pixel {
  unsigned char r;
  unsigned char g;
  unsigned char b;
};

//write a ppm file
void write_PPM( char *filename , pixel ** image, int width, int height);

void read_PPM( char *filename, pixel ** image, int &width, int &height );

//read from the rgb file format
unsigned *
read_rgb(const char *name, int *width, int *height, int *components);