#ifndef __PPMREADER_H
#define __PPMREADER_H


typedef struct {

  unsigned char magicNumber[2];

  unsigned int width;
  unsigned int height;

  unsigned int maxval;
  unsigned int componentSize;

  unsigned int dataDim;
  void * data;

} ppmImage_t;


/**
 * Loads a ppm image (P6 format) from the file given by 'fileName'. Returns a
 * pointer to the image, if the load was successful. Otherwise, returns 0.
 */
ppmImage_t * imageLoad(char * fileName);


/**
 * Free the image given by 'image', if there was really memory allocated.
 */
void imageFree(ppmImage_t * image);


#endif /* __PPMREADER_H */
