#include <image.h>
Public Types | |
enum | imtype { NOTUSED, PBM_A, PGM_A, PPM_A, PBM_B, PGM_B, PPM_B } |
Public Member Functions | |
PNM () | |
~PNM () | |
void | clear (void) |
void | read_header () |
void | write_header (const imtype _type, const arma::uword _rows, const arma::uword _cols, const int _maxval, const std::string comments) |
bool | write (std::string fname, const imtype _type, const arma::cube &img, const std::string info="") |
bool | write (std::string fname, const imtype _type, arma::mat &img, const std::string info="") |
void | get_info () |
arma::uword | get_rows () |
arma::uword | get_cols () |
int | get_maxval () |
bool | read (std::string fname, arma::cube &img) |
bool | read (std::string fname, arma::mat &img) |
Public Attributes | |
enum sp::PNM::imtype | type |
Private Attributes | |
std::ifstream | ifs |
std::ofstream | ofs |
arma::uword | cols |
arma::uword | rows |
int | maxval |
Implements portable anymap image functions Supports .pbm, .pgm and .ppm plain and raw
enum sp::PNM::imtype |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Read image.
fname | File name |
img | Image data |
Definition at line 392 of file image.h.
References cols, get_info(), PBM_A, PBM_B, PGM_A, PGM_B, read_header(), and rows.
|
inline |
|
inline |
|
inline |
|
inline |
|
private |
Nr of columns in image.
Definition at line 27 of file image.h.
Referenced by get_cols(), read(), and write().
|
private |
|
private |
Nr of rows in image.
Definition at line 28 of file image.h.
Referenced by get_rows(), read(), and write().
enum sp::PNM::imtype sp::PNM::type |
Image format.