# png::reader< istream > Class Template Reference

The PNG reader class template. This is the low-level reading interface--use image class or consumer class to actually read images. More...

`#include <reader.hpp>`

Inheritance diagram for png::reader< istream >:

List of all members.

## Public Member Functions

| reader (istream &stream)
| Constructs a reader prepared to read PNG image from a stream.
| ~reader ()
void | read_png ()
| Reads the whole PNG data stream into memory. Not particularly useful.
void | read_info ()
| Reads info about PNG image.
void | read_row (byte *bytes)
| Reads a row of image data at a time.
void | read_end_info ()
| Reads ending info about PNG image.
void | update_info ()

## Detailed Description

### template<class istream>
class png::reader< istream >

The PNG reader class template. This is the low-level reading interface--use image class or consumer class to actually read images.

The `istream` template parameter specifies the type of input stream to work with. The `istream` class should implement the minimum of the following interface:

     class my_istream
     {
     public:
         void read(char*, size_t);
         bool good();
     };

With the semantics similar to the `std::istream`. Naturally, `std::istream` fits this requirement and can be used with the reader class as is.

See also:
  image, consumer, writer, io_base

## Constructor & Destructor Documentation

template<class istream>

png::reader< istream >::reader | ( | istream & | stream ) | `[inline, explicit]`

Constructs a reader prepared to read PNG image from a stream.

References png::io_base::m_png.

template<class istream>

png::reader< istream >::~reader | ( | ) | `[inline]`

References png::info_base::get_png_info_ptr(), png::io_base::m_end_info, png::io_base::m_info, and png::io_base::m_png.

## Member Function Documentation

template<class istream>

void png::reader< istream >::read_png | ( | ) | `[inline]`

Reads the whole PNG data stream into memory. Not particularly useful.

References png::info_base::get_png_info(), png::io_base::m_error, png::io_base::m_info, and png::io_base::m_png.

template<class istream>

void png::reader< istream >::read_info | ( | ) | `[inline]`

Reads info about PNG image.

References png::io_base::m_error, png::io_base::m_info, png::io_base::m_png, and png::info::read().

Referenced by png::consumer< pixel, pixel_consumer, image_info_ref_holder, true >::read().

template<class istream>

void png::reader< istream >::read_row | ( | byte * | bytes ) | `[inline]`

Reads a row of image data at a time.

References png::io_base::m_error, and png::io_base::m_png.

template<class istream>

void png::reader< istream >::read_end_info | ( | ) | `[inline]`

Reads ending info about PNG image.

References png::io_base::m_end_info, png::io_base::m_error, png::io_base::m_png, and png::end_info::read().

Referenced by png::consumer< pixel, pixel_consumer, image_info_ref_holder, true >::read().

template<class istream>

void png::reader< istream >::update_info | ( | ) | `[inline]`

References png::io_base::m_info, and png::info::update().

Referenced by png::consumer< pixel, pixel_consumer, image_info_ref_holder, true >::read().

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

- reader.hpp