VideoTools
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Gr::PnmInfo Class Reference

A structure holding portable-anymap metadata. More...

#include <grpnm.h>

Public Member Functions

 PnmInfo ()
 Default constructor for an invalid structure.
 
 PnmInfo (std::istream &)
 Constructor reading from an istream.
 
 PnmInfo (const std::vector< char > &)
 Constructor reading from a buffer. More...
 
 PnmInfo (const ImageBuffer &)
 Constructor reading from a Gr::ImageBuffer.
 
 PnmInfo (const char *, size_t)
 Constructor overload for a char buffer.
 
 PnmInfo (const unsigned char *, size_t)
 Constructor overload for unsigned char.
 
 PnmInfo (int pn, int dx, int dy, int maxval, size_t offset)
 Constructor taking the individual metadata items.
 
bool valid () const
 Returns true if successfully constructed.
 
bool binary () const
 Returns true if a binary format.
 
bool binary8 () const
 Returns true if an eight-bit binary format, ie. P5 or P6.
 
int dx () const
 Returns the image width.
 
int dy () const
 Returns the image height.
 
int channels () const
 Returns the number of channels.
 
int pn () const
 Returns the p-number.
 
int maxval () const
 Returns the maximum value, or zero for bitmap formats (p1/p4).
 
size_t offset () const
 Returns the size of the header.
 
size_t rowsize () const
 Returns dx() * channels().
 

Detailed Description

A structure holding portable-anymap metadata.

Definition at line 42 of file grpnm.h.

Constructor & Destructor Documentation

Gr::PnmInfo::PnmInfo ( const std::vector< char > &  buffer)
explicit

Constructor reading from a buffer.

There is no limit on the header size (because of comments and whitespace) so the whole image should be supplied.

Definition at line 337 of file grpnm.cpp.


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