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

A class that reads a png header in order to provide the image dimensions. More...

#include <grpng.h>

Public Member Functions

 PngInfo (std::istream &)
 Constructor.
 
 PngInfo (const unsigned char *p, size_t)
 Constructor.
 
 PngInfo (const char *p, size_t)
 Constructor overload for char.
 
 PngInfo (const ImageBuffer &)
 Constructor overload for ImageBuffer.
 
bool valid () const
 Returns true if successfully constructed.
 
int dx () const
 Returns the image width. Returns zero on error.
 
int dy () const
 Returns the image height. Returns zero on error.
 

Detailed Description

A class that reads a png header in order to provide the image dimensions.

The number of channels is not provided because PngReader always transforms to three channels. An implementation of PngInfo is available even without libpng. Png files must have the IHDR as the first chunk, so it is sufficient to supply only 30 bytes to be correctly parsed.

Definition at line 72 of file grpng.h.


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