IT++ Logo

pnm.h

Go to the documentation of this file.
00001 
00030 #ifndef PNM_H
00031 #define PNM_H
00032 
00033 #include <itpp/base/mat.h>
00034 
00035 
00036 namespace itpp {
00037 
00050   //--------------------------------------------------------------
00051   // General PNM functions
00059   char pnm_type( const std::string & filename );
00060 
00071   bool pnm_info( const std::string & filename,
00072      char & pnm_type,
00073      int & width,
00074      int & height,
00075      int & max_val,
00076      std::string & comments );
00077 
00078   //--------------------------------------------------------------
00079   // PGM related functions (gray images)
00089   bool pgm_read(const std::string & filename, imat & m,
00090     std::string & comments );
00091 
00092 
00103   bool pgm_read(const std::string & filename, imat &m,
00104     int r1, int r2, int c1, int c2 );
00105 
00106 
00114   imat pgm_read( const std::string & filename );
00115 
00116 
00126   bool pgm_write(const std::string & filename,
00127      const imat &m,
00128      const std::string & comments = "Generated by IT++ (http://itpp.sourceforge.net)" );
00129 
00130 
00131   //--------------------------------------------------------------
00132   // PPM related functions (color images)
00145   bool ppm_read(const std::string & filename,
00146     imat &r, imat &g, imat &b,
00147     std::string & comments );
00148 
00149 
00158   bool ppm_read(const std::string & filename,
00159     imat &r, imat &g, imat &b );
00160 
00161 
00169   bool ppm_read(const std::string & filename,
00170     imat &r, imat &g, imat &b,
00171     int r1, int r2, int c1, int c2 );
00172 
00184   bool ppm_write(const std::string & filename,
00185      const imat &r,
00186      const imat &g,
00187      const imat &b,
00188      const std::string & comments = "Generated by IT++ (http://itpp.sourceforge.net)",
00189      int max_val = 255 );
00190 
00206   imat img_double2int( const mat & m,
00207            int max_val = 255,
00208            double double_min = 0 ,
00209            double double_max = 1 );
00210 
00223   mat img_int2double( const imat & m,
00224           int max_val = 255,
00225           double double_min = 0,
00226           double double_max = 1 );
00227 
00228 } // namespace itpp
00229 
00230 #endif // #ifndef PNM_H
SourceForge Logo

Generated on Sun Sep 14 18:57:06 2008 for IT++ by Doxygen 1.5.6