Public Member Functions

DGImage< type > Class Template Reference

Wraps the reading and writing of PNM ASCII images. More...

#include <DGImage.hpp>

List of all members.

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.

Detailed Description

template<typename type>
class DGImage< type >

Wraps the reading and writing of PNM ASCII images.

Definition at line 40 of file DGImage.hpp.


Constructor & Destructor Documentation

template<typename type >
DGImage< type >::DGImage (  ) 

Definition at line 69 of file DGImage.hpp.

template<typename type >
DGImage< type >::~DGImage (  )  [virtual]

Definition at line 75 of file DGImage.hpp.


Member Function Documentation

template<typename type >
bool DGImage< type >::isPNMBinaryFormat ( string  filename  ) 

Get File Type magic number

Definition at line 81 of file DGImage.hpp.

template<typename type >
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.

template<typename type >
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.


The documentation for this class was generated from the following file: