pnm.h
Go to the documentation of this file.
#ifndef PNM_H
#define PNM_H
#include <itpp/base/mat.h>
#include <itpp/itexports.h>
namespace itpp
{
//--------------------------------------------------------------
// General PNM functions
ITPP_EXPORT char pnm_type(const std::string & filename);
ITPP_EXPORT bool pnm_info(const std::string & filename,
char & pnm_type,
int & width,
int & height,
int & max_val,
std::string & comments);
//--------------------------------------------------------------
// PGM related functions (gray images)
ITPP_EXPORT bool pgm_read(const std::string & filename, imat & m,
std::string & comments);
ITPP_EXPORT bool pgm_read(const std::string & filename, imat &m,
int r1, int r2, int c1, int c2);
ITPP_EXPORT imat pgm_read(const std::string & filename);
ITPP_EXPORT bool pgm_write(const std::string & filename,
const imat &m,
const std::string & comments = "Generated by IT++ (http://itpp.sourceforge.net)");
//--------------------------------------------------------------
// PPM related functions (color images)
ITPP_EXPORT bool ppm_read(const std::string & filename,
imat &r, imat &g, imat &b,
std::string & comments);
ITPP_EXPORT bool ppm_read(const std::string & filename,
imat &r, imat &g, imat &b);
ITPP_EXPORT bool ppm_read(const std::string & filename,
imat &r, imat &g, imat &b,
int r1, int r2, int c1, int c2);
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);
ITPP_EXPORT imat img_double2int(const mat & m,
int max_val = 255,
double double_min = 0 ,
double double_max = 1);
ITPP_EXPORT mat img_int2double(const imat & m,
int max_val = 255,
double double_min = 0,
double double_max = 1);
} // namespace itpp
#endif // #ifndef PNM_H
itpp::Array
General array class.
Definition array.h:105
itpp::pgm_write
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::pnm_type
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::pgm_read
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::img_int2double
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::img_double2int
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::pnm_info
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::ppm_write
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::ppm_read
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,...
mat.h
Matrix Class Definitions.
itpp
itpp namespace
Definition itmex.h:37

Generated on Mon Jun 10 2024 11:49:25 for IT++ by Doxygen 1.9.8