Namespace of pnm input/output handling. More...
Namespaces | |
namespace | impl |
Namespace of pnm's implementation details. | |
namespace | internal |
Functions | |
template<typename V > | |
image2d< V > | load (char type_, const std::string &filename) |
main function : load pnm format | |
template<typename I > | |
void | load (char type_, Image< I > &ima_, const std::string &filename) |
An other way to load pnm files : the destination is an argument to check if the type match the file to load. | |
template<typename I > | |
void | load_ascii_builtin (std::ifstream &file, I &ima) |
load_ascii for builtin value types. | |
template<typename I > | |
void | load_ascii_value (std::ifstream &file, I &ima) |
load_ascii for Milena value types. | |
template<typename I > | |
void | load_raw_2d (std::ifstream &file, I &ima) |
load_raw_2d. | |
template<typename I > | |
void | load_raw_2d_contiguous (std::ifstream &file, I &ima) |
template<typename V > | |
void | load_raw_2d_uncontiguous (std::ifstream &file, image2d< V > &ima) |
template<typename V > | |
unsigned int | max_component (const V &) |
Give the maximum value which can be stored as a component value type V. | |
bool | read_header (std::ifstream &istr, char &type, int &nrows, int &ncols, unsigned int &maxval, bool test=false) |
void | read_header (char ascii, char raw, std::ifstream &istr, char &type, int &nrows, int &ncols, unsigned int &maxval) |
void | read_header (char ascii, char raw, std::ifstream &istr, char &type, int &nrows, int &ncols) |
template<class V > | |
void | read_value (std::ifstream &file, value::Scalar< V > &v) |
template<typename V > | |
void | read_value (std::ifstream &file, V &v) |
template<unsigned int n> | |
void | read_value (std::ifstream &file, value::rgb< n > &v) |
template<typename I > | |
void | save (char type, const Image< I > &ima_, const std::string &filename) |
template<typename I > | |
void | save_header (char type, const I &ima, const std::string &filename, std::ofstream &file) |
void | save_max_val (bool &, std::ofstream &) |
template<typename V > | |
void | save_max_val (V &, std::ofstream &file) |
Namespace of pnm input/output handling.
image2d<V> mln::io::pnm::load | ( | char | type_, | |
const std::string & | filename | |||
) | [inline] |
main function : load pnm format
References mln::trace::entering(), mln::trace::exiting(), mln::io::pnm::internal::load_ascii_dispatch(), load_raw_2d(), max_component(), and read_header().
void mln::io::pnm::load | ( | char | type_, | |
Image< I > & | ima_, | |||
const std::string & | filename | |||
) | [inline] |
An other way to load pnm files : the destination is an argument to check if the type match the file to load.
References mln::make::box2d(), mln::trace::entering(), mln::exact(), mln::trace::exiting(), mln::io::pnm::internal::load_ascii_dispatch(), load_raw_2d(), max_component(), and read_header().
void mln::io::pnm::load_ascii_builtin | ( | std::ifstream & | file, | |
I & | ima | |||
) | [inline] |
load_ascii for builtin value types.
Referenced by mln::io::pnm::internal::load_ascii_dispatch().
void mln::io::pnm::load_ascii_value | ( | std::ifstream & | file, | |
I & | ima | |||
) | [inline] |
load_ascii for Milena value types.
Referenced by mln::io::pnm::internal::load_ascii_dispatch().
void mln::io::pnm::load_raw_2d | ( | std::ifstream & | file, | |
I & | ima | |||
) | [inline] |
load_raw_2d.
for all pnm 8/16 bits formats
References load_raw_2d_contiguous(), and load_raw_2d_uncontiguous().
Referenced by load().
void mln::io::pnm::load_raw_2d_contiguous | ( | std::ifstream & | file, | |
I & | ima | |||
) | [inline] |
References mln::geom::max_row(), mln::geom::min_row(), and mln::geom::ncols().
Referenced by load_raw_2d().
void mln::io::pnm::load_raw_2d_uncontiguous | ( | std::ifstream & | file, | |
image2d< V > & | ima | |||
) | [inline] |
References mln::geom::max_col(), mln::geom::max_row(), mln::geom::min_col(), mln::geom::min_row(), and read_value().
Referenced by load_raw_2d().
unsigned int mln::io::pnm::max_component | ( | const V & | ) | [inline] |
Give the maximum value which can be stored as a component value type V.
Referenced by load(), and save_max_val().
bool mln::io::pnm::read_header | ( | std::ifstream & | istr, | |
char & | type, | |||
int & | nrows, | |||
int & | ncols, | |||
unsigned int & | maxval, | |||
bool | test = false | |||
) | [inline] |
Referenced by load(), mln::io::pbm::load(), and read_header().
void mln::io::pnm::read_header | ( | char | ascii, | |
char | raw, | |||
std::ifstream & | istr, | |||
char & | type, | |||
int & | nrows, | |||
int & | ncols, | |||
unsigned int & | maxval | |||
) | [inline] |
References read_header().
void mln::io::pnm::read_header | ( | char | ascii, | |
char | raw, | |||
std::ifstream & | istr, | |||
char & | type, | |||
int & | nrows, | |||
int & | ncols | |||
) | [inline] |
References read_header().
void mln::io::pnm::read_value | ( | std::ifstream & | file, | |
value::Scalar< V > & | v | |||
) | [inline] |
References mln::exact().
void mln::io::pnm::read_value | ( | std::ifstream & | file, | |
V & | v | |||
) | [inline] |
void mln::io::pnm::read_value | ( | std::ifstream & | file, | |
value::rgb< n > & | v | |||
) | [inline] |
References mln::value::rgb< n >::blue(), mln::value::rgb< n >::green(), and mln::value::rgb< n >::red().
Referenced by load_raw_2d_uncontiguous().
void mln::io::pnm::save | ( | char | type, | |
const Image< I > & | ima_, | |||
const std::string & | filename | |||
) | [inline] |
Save a Milena image as a pnm image.
[in] | type | The type of the image to save (can be PPM, PGM, PBM). |
[in] | ima_ | The image to save. |
[in,out] | filename | the destination. |
References mln::trace::entering(), mln::exact(), mln::trace::exiting(), mln::io::pnm::impl::save_data_(), and save_header().
void mln::io::pnm::save_header | ( | char | type, | |
const I & | ima, | |||
const std::string & | filename, | |||
std::ofstream & | file | |||
) | [inline] |
References mln::geom::ncols(), mln::geom::nrows(), and save_max_val().
Referenced by save(), and mln::io::pbm::impl::save_().
void mln::io::pnm::save_max_val | ( | bool & | , | |
std::ofstream & | ||||
) | [inline] |
void mln::io::pnm::save_max_val | ( | V & | , | |
std::ofstream & | file | |||
) | [inline] |
References max_component().
Referenced by save_header().