00001 #ifndef _PgmPpmInterface_H 00002 #define _PgmPpmInterface_H 00003 00004 00005 00025 class PgmPpmInterface 00026 { 00027 public: 00028 00029 static bool readImageParams(const char* filename, 00030 int* width, 00031 int* height, 00032 int* channels, 00033 int* bitsPerSample); 00034 00035 // read 00036 static unsigned char * read(const char* filename, 00037 int* width, 00038 int* height, 00039 int* channels, 00040 int* bitsPerSample); 00041 00042 // read 00043 static unsigned short * read16(const char* filename, 00044 int* width, 00045 int* height, 00046 int* channels, 00047 int* bitsPerSample); 00048 00049 // save byte and RGB raw data 00050 static bool save(const char* filename, 00051 unsigned char *image, 00052 int width, 00053 int height, 00054 int channels); 00055 00056 static bool save16(const char* filename, 00057 unsigned short *image, 00058 int width, 00059 int height, 00060 int channels); 00061 00062 }; 00063 00064 #endif