00001 00033 #ifndef PNM_H 00034 #define PNM_H 00035 00036 #include <itpp/base/mat.h> 00037 00038 00039 namespace itpp { 00040 00053 //-------------------------------------------------------------- 00054 // General PNM functions 00062 char pnm_type( const std::string & filename ); 00063 00074 bool pnm_info( const std::string & filename, 00075 char & pnm_type, 00076 int & width, 00077 int & height, 00078 int & max_val, 00079 std::string & comments ); 00080 00081 //-------------------------------------------------------------- 00082 // PGM related functions (gray images) 00092 bool pgm_read(const std::string & filename, imat & m, 00093 std::string & comments ); 00094 00095 00106 bool pgm_read(const std::string & filename, imat &m, 00107 int r1, int r2, int c1, int c2 ); 00108 00109 00117 imat pgm_read( const std::string & filename ); 00118 00119 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 Fri Jun 8 02:08:56 2007 for IT++ by Doxygen 1.5.2