imageIO.h

Go to the documentation of this file.
00001 
00015 #ifndef DLR_COMPUTERVISION_IMAGEIO_H
00016 #define DLR_COMPUTERVISION_IMAGEIO_H
00017 
00018 
00019 #include <string>
00020 #include <dlrComputerVision/image.h>
00021 
00022 namespace dlr {
00023 
00024   namespace computerVision {
00025 
00026 #if 0  /* Here's the interface I think we ultimately want. */
00027     
00028     class ImageReader {
00029     public:
00030       
00034       ImageReader();
00035       
00036       
00040       virtual
00041       ~ImageReader();
00042 
00043 
00044       void
00045       readFile(std::string const& fileName);
00046 
00047 
00048       ImageFormat
00049       getNativeFormat();
00050 
00051 
00052       template<ImageFormat format>
00053       Image<format>
00054       getImage() {return Image<format>();}
00055       
00056     private:
00057 
00058       bool
00059       readPGM(std::string const& fileName);
00060 
00061       bool
00062       readPNG(std::string const& fileName);
00063 
00064       bool
00065       readPPM(std::string const& fileName);
00066       
00067     };
00068 
00069 #endif
00070 
00071     /* ================ Non-member function declarations. ================ */
00072   
00073     Image<GRAY8>
00074     readPGM8(const std::string& fileName);
00075 
00076   
00077     Image<GRAY8>
00078     readPGM8(const std::string& fileName,
00079              std::string& commentString);
00080 
00081   
00082     Image<GRAY16>
00083     readPGM16(const std::string& fileName);
00084 
00085   
00086     Image<RGB8>
00087     readPPM8(const std::string& fileName);
00088 
00089 
00090     Image<RGB8>
00091     readPPM8(const std::string& fileName,
00092              std::string& commentString);
00093     
00094   
00095     void
00096     writePGM8(const std::string& fileName,
00097               const Image<GRAY8>& outputImage,
00098               const std::string& comment = "");
00099   
00100   
00101     void
00102     writePGM16(const std::string& fileName,
00103                const Image<GRAY16>& outputImage,
00104                const std::string& comment = "");
00105   
00106 
00107     void
00108     writePPM8(const std::string& fileName,
00109               const Image<RGB8>& outputImage,
00110               const std::string& comment = "");
00111 
00112 #ifndef HAVE_LIBPNG
00113 #define HAVE_LIBPNG 1
00114 #endif
00115     
00116 #if HAVE_LIBPNG
00117 
00127     Image<GRAY8>
00128     readPNG8(const std::string& fileName,
00129              std::string& commentString);
00130 
00131 
00141     void
00142     writePNG8(const std::string& fileName,
00143               const Image<GRAY8>& outputImage,
00144               const std::string& comment = "");
00145 
00146 #endif /* #if HAVE_LIBPNG */
00147 
00148     
00149   } // namespace computerVision
00150 
00151 } // namespace dlr
00152 
00153 
00154 #endif /* #ifndef DLR_COMPUTERVISION_IMAGEIO_H */

Generated on Wed Nov 25 12:15:05 2009 for dlrComputerVision Utility Library by  doxygen 1.5.8