00001 00009 #ifndef IMAGE_WRITER_H 00010 #define IMAGE_WRITER_H 00011 00012 #include "GrayLevelImage8.h" 00013 #include "GrayLevelImage16.h" 00014 #include "ColorImageRGB8.h" 00015 #include "ColorImageRGBa8.h" 00016 #include "FeatureImage.h" 00017 00018 #include <cstdio> 00019 00020 namespace puma2 { 00021 00029 class ImageWriter { 00030 private: // should never be instantiated 00031 ImageWriter () {}; 00032 ~ImageWriter () {}; 00033 00034 public: 00041 static bool writeImage(const GrayLevelImage8 &img, std::string filename); 00042 00043 static bool writeImage(const GrayLevelImage16 &img, std::string filename); 00044 00045 static bool writeImage(const ColorImageRGB8 &img, std::string filename); 00046 00047 static bool writeImage(const ColorImageRGBa8 &img, std::string filename); 00048 00055 template <class T> static bool writeImage(FeatureImage<T> &img, 00056 std::string filename); 00057 }; 00058 00059 template <class T> bool ImageWriter::writeImage(FeatureImage<T> &img, 00060 std::string filename) 00061 { 00062 GrayLevelImage8 g = img.getGrayLevelImageRepresentation(); 00063 return writeImage(g, filename); 00064 } 00065 00066 } 00067 00068 #endif /* IMAGE_WRITER_H */