00001 #ifndef _AnImageReader_H 00002 #define _AnImageReader_H 00003 00004 00005 00024 #include "AnImage.hpp" 00025 00026 class AnImageReader 00027 { 00028 protected: 00029 00030 #ifdef _WINDOWS_USED_ 00031 AnImage* readBitmapPalette8(const char* filename); 00032 AnImage* readBitmapPaletteRLE8(const char* filename); // testing does not work yet 00033 #endif 00034 00035 // reading images 00036 AnImage* readByteImage(const char* filename); 00037 AnImage* readShortImage(const char* filename){return 0;} 00038 AnImage* readUShortImage(const char* filename){return 0;} 00039 AnImage* readIntegerImage(const char* filename); 00040 00041 AnImage* readRGBImage(const char* filename); // 24 bit image 00042 00043 // scaled reading 00044 AnImage* readByteImage(const char* filename, int reductionScale); 00045 AnImage* readShortImage(const char* filename, int reductionScale){return 0;} 00046 AnImage* readUShortImage(const char* filename, int reductionScale){return 0;} 00047 AnImage* readIntegerImage(const char* filename, int reductionScale); 00048 00049 AnImage* readRGBImage(const char* filename, int reductionScale); // 24 bit image 00050 00051 00052 bool isJpeg(const char* filename); 00053 bool isTiff(const char* filename); 00054 bool isBmp(const char* filename); 00055 bool isPgm(const char* filename); 00056 bool isPpm(const char* filename); 00057 bool isPnm(const char* filename); // any pbm or ppm (P5 or P6) 00058 bool isPam(const char* filename); // support for multi pgm(multichannel)/ppm(multirgb) 00059 bool isTga(const char* filename){ return false; } 00060 bool isPng(const char* filename){ return false; } 00061 00062 public: 00063 AnImageReader(){} 00064 ~AnImageReader(){} 00065 00066 AnImage* readImage(const char* filename); 00067 AnImage* readImage(const char* filename, int reductionScale); 00068 00069 bool readParams(const char* filename, int* width, int* height); 00070 bool readParams(const char* filename, int* width, int* height, int* channels); 00071 bool readParams(const char* filename, int* width, int* height, int* channels, 00072 int* xResolution, int* yResolution); 00073 00074 void output(); 00075 00076 }; 00077 00078 #endif