Wraps the reading and writing of PNM ASCII images. More...
#include <DGImage.hpp>
Public Member Functions | |
DGImage () | |
virtual | ~DGImage () |
bool | isPNMBinaryFormat (string filename) |
bool | readPNM (string filename, Array< type, 2 > &data, int &greyMax) |
Reads ASCII PNM (Portable aNy Map) Image files. Returns true if successful. Formats of PNM supported are *.pgm, *.ppm (mono) and *.pbm. | |
bool | writePNM (Array< type, 2 > &data, const int greyMax, string filename) |
Writes ASCII PNM (Portable aNy Map) Image files. Returns true if successful. Formats of PNM supported are *.pgm, *.ppm (mono) and *.pbm. |
Wraps the reading and writing of PNM ASCII images.
Definition at line 40 of file DGImage.hpp.
Definition at line 69 of file DGImage.hpp.
Definition at line 75 of file DGImage.hpp.
bool DGImage< type >::isPNMBinaryFormat | ( | string | filename | ) |
Get File Type magic number
Definition at line 81 of file DGImage.hpp.
bool DGImage< type >::readPNM | ( | string | filename, | |
Array< type, 2 > & | data, | |||
int & | greyMax | |||
) |
Reads ASCII PNM (Portable aNy Map) Image files. Returns true if successful. Formats of PNM supported are *.pgm, *.ppm (mono) and *.pbm.
< Open File.
Read PGM Header Read Filetype and File comment
Read File Type (1-3 = ASCII where 1 is 1-bit and 2 is plain, 4-6 = Binary)
Get comment
Read Image Characteristics
Allocate Memory for Image appropriately
Read Data according to size and type provided in header
Black & White PPM
< Close File.
Definition at line 113 of file DGImage.hpp.
bool DGImage< type >::writePNM | ( | Array< type, 2 > & | data, | |
const int | greyMax, | |||
string | filename | |||
) |
Writes ASCII PNM (Portable aNy Map) Image files. Returns true if successful. Formats of PNM supported are *.pgm, *.ppm (mono) and *.pbm.
Definition at line 171 of file DGImage.hpp.