IT++ Logo
pnm.h
Go to the documentation of this file.
1
29#ifndef PNM_H
30#define PNM_H
31
32#include <itpp/base/mat.h>
33#include <itpp/itexports.h>
34
35
36namespace itpp
37{
38
51//--------------------------------------------------------------
52// General PNM functions
60ITPP_EXPORT char pnm_type(const std::string & filename);
61
72ITPP_EXPORT bool pnm_info(const std::string & filename,
73 char & pnm_type,
74 int & width,
75 int & height,
76 int & max_val,
77 std::string & comments);
78
79//--------------------------------------------------------------
80// PGM related functions (gray images)
90ITPP_EXPORT bool pgm_read(const std::string & filename, imat & m,
91 std::string & comments);
92
93
104ITPP_EXPORT bool pgm_read(const std::string & filename, imat &m,
105 int r1, int r2, int c1, int c2);
106
107
115ITPP_EXPORT imat pgm_read(const std::string & filename);
116
117
127ITPP_EXPORT bool pgm_write(const std::string & filename,
128 const imat &m,
129 const std::string & comments = "Generated by IT++ (http://itpp.sourceforge.net)");
130
131
132//--------------------------------------------------------------
133// PPM related functions (color images)
146ITPP_EXPORT bool ppm_read(const std::string & filename,
147 imat &r, imat &g, imat &b,
148 std::string & comments);
149
150
159ITPP_EXPORT bool ppm_read(const std::string & filename,
160 imat &r, imat &g, imat &b);
161
162
170ITPP_EXPORT bool ppm_read(const std::string & filename,
171 imat &r, imat &g, imat &b,
172 int r1, int r2, int c1, int c2);
173
185ITPP_EXPORT bool ppm_write(const std::string & filename,
186 const imat &r,
187 const imat &g,
188 const imat &b,
189 const std::string & comments = "Generated by IT++ (http://itpp.sourceforge.net)",
190 int max_val = 255);
191
207ITPP_EXPORT imat img_double2int(const mat & m,
208 int max_val = 255,
209 double double_min = 0 ,
210 double double_max = 1);
211
224ITPP_EXPORT mat img_int2double(const imat & m,
225 int max_val = 255,
226 double double_min = 0,
227 double double_max = 1);
228
229} // namespace itpp
230
231#endif // #ifndef PNM_H
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 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 ...
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.
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 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 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 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,...
Matrix Class Definitions.
itpp namespace
Definition itmex.h:37
SourceForge Logo

Generated on Tue Dec 10 2024 04:49:37 for IT++ by Doxygen 1.12.0