33 #include <itpp/itexports.h> 60 ITPP_EXPORT
char pnm_type(
const std::string & filename);
72 ITPP_EXPORT
bool pnm_info(
const std::string & filename,
77 std::string & comments);
90 ITPP_EXPORT
bool pgm_read(
const std::string & filename, imat & m,
91 std::string & comments);
104 ITPP_EXPORT
bool pgm_read(
const std::string & filename, imat &m,
105 int r1,
int r2,
int c1,
int c2);
115 ITPP_EXPORT imat
pgm_read(
const std::string & filename);
127 ITPP_EXPORT
bool pgm_write(
const std::string & filename,
129 const std::string & comments =
"Generated by IT++ (http://itpp.sourceforge.net)");
146 ITPP_EXPORT
bool ppm_read(
const std::string & filename,
147 imat &r, imat &g, imat &b,
148 std::string & comments);
159 ITPP_EXPORT
bool ppm_read(
const std::string & filename,
160 imat &r, imat &g, imat &b);
170 ITPP_EXPORT
bool ppm_read(
const std::string & filename,
171 imat &r, imat &g, imat &b,
172 int r1,
int r2,
int c1,
int c2);
185 ITPP_EXPORT
bool ppm_write(
const std::string & filename,
189 const std::string & comments =
"Generated by IT++ (http://itpp.sourceforge.net)",
209 double double_min = 0 ,
210 double double_max = 1);
226 double double_min = 0,
227 double double_max = 1);
231 #endif // #ifndef PNM_H ITPP_EXPORT mat img_int2double(const imat &m, int max_val=255, double double_min=0, double double_max=1)
Return a matrix of double which is a scaled version of the input matrix m of integers.
ITPP_EXPORT bool pgm_write(const std::string &filename, const imat &m, const std::string &comments="Generated by IT++ (http://itpp.sourceforge.net)")
Create an image file from the matrix of integer.
ITPP_EXPORT bool pgm_read(const std::string &filename, imat &m, std::string &comments)
Read the entire graymap into the matrix m or return false if the function failed. ...
Matrix Class Definitions.
ITPP_EXPORT bool ppm_write(const std::string &filename, const imat &r, const imat &g, const imat &b, const std::string &comments="Generated by IT++ (http://itpp.sourceforge.net)", int max_val=255)
Write the matrix m as a pixmap.
ITPP_EXPORT bool ppm_read(const std::string &filename, imat &r, imat &g, imat &b, std::string &comments)
Read the color image file in the format ppm. The image is retrieved as a set of three matrices...
ITPP_EXPORT bool pnm_info(const std::string &filename, char &pnm_type, int &width, int &height, int &max_val, std::string &comments)
Retrieve some information about an pnm file.
ITPP_EXPORT imat img_double2int(const mat &m, int max_val=255, double double_min=0, double double_max=1)
Prepare a matrix of double to be writted as an image.
ITPP_EXPORT char pnm_type(const std::string &filename)
Determines the type of a PNM file, based on magic numbers. The returned value is a character between ...