/*----------------------------------------------------------------------
  File:    image.h
  Purpose: Stuff PPM and PGM images
  Author:  Tomas Möller
           Department of Computer Engineering
           Chalmers University of Technology   
  History: July 1999 (started)
           2000-06-07: added reWritePGM()
           2000-06-10: cleaned up reReadPPM()
----------------------------------------------------------------------*/

#ifndef IMAGE_H
#define IMAGE_H

bool fReadPPM(char *filename, int &width, int &height, unsigned char *&pixels);
bool fWritePPM(char *filename, int width, int height, unsigned char *pixels,bool reverse_y);
bool fWritePPMfromRGBA(char *filename, int width, int height, unsigned char *pixels,bool reverse_y);
bool fWrite3PPMfromRGBA(char *filename, int width1,int width2,int width3, int height,
			unsigned char *buffer1,unsigned char *buffer2, 
			unsigned char *buffer3, bool reverse_y);
// write a grey scale image
bool fWritePGM(char *filename, int width, int height, unsigned char *pixels,bool reverse_y);

bool fWritePPMfromLuminance(char *filename, int width, int height, 
							unsigned char *pixels,bool reverse_y);
bool fConvertPPMToJPG(char *filename);
bool fConvertToPPM(char *filename);

#endif

