Namespaces | Functions

mln::io::pnm Namespace Reference

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)

Detailed Description

Namespace of pnm input/output handling.


Function Documentation

template<typename V >
image2d<V> mln::io::pnm::load ( char  type_,
const std::string &  filename 
) [inline]
template<typename I >
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.

Definition at line 257 of file pnm/load.hh.

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().

template<typename I >
void mln::io::pnm::load_ascii_builtin ( std::ifstream &  file,
I &  ima 
) [inline]

load_ascii for builtin value types.

Definition at line 178 of file pnm/load.hh.

Referenced by mln::io::pnm::internal::load_ascii_dispatch().

template<typename I >
void mln::io::pnm::load_ascii_value ( std::ifstream &  file,
I &  ima 
) [inline]

load_ascii for Milena value types.

Definition at line 164 of file pnm/load.hh.

Referenced by mln::io::pnm::internal::load_ascii_dispatch().

template<typename I >
void mln::io::pnm::load_raw_2d ( std::ifstream &  file,
I &  ima 
) [inline]

load_raw_2d.

for all pnm 8/16 bits formats

Definition at line 198 of file pnm/load.hh.

References load_raw_2d_contiguous(), and load_raw_2d_uncontiguous().

Referenced by load().

template<typename I >
void mln::io::pnm::load_raw_2d_contiguous ( std::ifstream &  file,
I &  ima 
) [inline]

Definition at line 148 of file pnm/load.hh.

References mln::geom::max_row(), mln::geom::min_row(), and mln::geom::ncols().

Referenced by load_raw_2d().

template<typename V >
void mln::io::pnm::load_raw_2d_uncontiguous ( std::ifstream &  file,
image2d< V > &  ima 
) [inline]
template<typename V >
unsigned int mln::io::pnm::max_component ( const V &   )  [inline]

Give the maximum value which can be stored as a component value type V.

Definition at line 56 of file max_component.hh.

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]

Definition at line 51 of file pnm/load_header.hh.

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]

Definition at line 100 of file pnm/load_header.hh.

References read_header().

void mln::io::pnm::read_header ( char  ascii,
char  raw,
std::ifstream &  istr,
char &  type,
int &  nrows,
int &  ncols 
) [inline]

Definition at line 118 of file pnm/load_header.hh.

References read_header().

template<class V >
void mln::io::pnm::read_value ( std::ifstream &  file,
value::Scalar< V > &  v 
) [inline]

Definition at line 109 of file pnm/load.hh.

References mln::exact().

template<typename V >
void mln::io::pnm::read_value ( std::ifstream &  file,
V &  v 
) [inline]

Definition at line 121 of file pnm/load.hh.

template<unsigned int n>
void mln::io::pnm::read_value ( std::ifstream &  file,
value::rgb< n > &  v 
) [inline]
template<typename I >
void mln::io::pnm::save ( char  type,
const Image< I > &  ima_,
const std::string &  filename 
) [inline]

Save a Milena image as a pnm image.

Parameters:
[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.

Definition at line 185 of file pnm/save.hh.

References mln::trace::entering(), mln::exact(), mln::trace::exiting(), mln::io::pnm::impl::save_data_(), and save_header().

template<typename I >
void mln::io::pnm::save_header ( char  type,
const I &  ima,
const std::string &  filename,
std::ofstream &  file 
) [inline]

Definition at line 68 of file save_header.hh.

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]

Definition at line 62 of file save_header.hh.

template<typename V >
void mln::io::pnm::save_max_val ( V &  ,
std::ofstream &  file 
) [inline]

Definition at line 56 of file save_header.hh.

References max_component().

Referenced by save_header().