VideoTools
|
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. | |
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.