00001 00030 #ifndef PNM_H 00031 #define PNM_H 00032 00033 #include <itpp/base/mat.h> 00034 00035 00036 namespace itpp 00037 { 00038 00051 //-------------------------------------------------------------- 00052 // General PNM functions 00060 char pnm_type(const std::string & filename); 00061 00072 bool pnm_info(const std::string & filename, 00073 char & pnm_type, 00074 int & width, 00075 int & height, 00076 int & max_val, 00077 std::string & comments); 00078 00079 //-------------------------------------------------------------- 00080 // PGM related functions (gray images) 00090 bool pgm_read(const std::string & filename, imat & m, 00091 std::string & comments); 00092 00093 00104 bool pgm_read(const std::string & filename, imat &m, 00105 int r1, int r2, int c1, int c2); 00106 00107 00115 imat pgm_read(const std::string & filename); 00116 00117 00127 bool pgm_write(const std::string & filename, 00128 const imat &m, 00129 const std::string & comments = "Generated by IT++ (http://itpp.sourceforge.net)"); 00130 00131 00132 //-------------------------------------------------------------- 00133 // PPM related functions (color images) 00146 bool ppm_read(const std::string & filename, 00147 imat &r, imat &g, imat &b, 00148 std::string & comments); 00149 00150 00159 bool ppm_read(const std::string & filename, 00160 imat &r, imat &g, imat &b); 00161 00162 00170 bool ppm_read(const std::string & filename, 00171 imat &r, imat &g, imat &b, 00172 int r1, int r2, int c1, int c2); 00173 00185 bool ppm_write(const std::string & filename, 00186 const imat &r, 00187 const imat &g, 00188 const imat &b, 00189 const std::string & comments = "Generated by IT++ (http://itpp.sourceforge.net)", 00190 int max_val = 255); 00191 00207 imat img_double2int(const mat & m, 00208 int max_val = 255, 00209 double double_min = 0 , 00210 double double_max = 1); 00211 00224 mat img_int2double(const imat & m, 00225 int max_val = 255, 00226 double double_min = 0, 00227 double double_max = 1); 00228 00229 } // namespace itpp 00230 00231 #endif // #ifndef PNM_H
Generated on Wed Mar 2 2011 22:05:10 for IT++ by Doxygen 1.7.3