# png::writer< ostream > Class Template Reference

PNG writer class template. This is the low-level writing interface--use image class or generator class to actually write images. More...

`#include <writer.hpp>`

Inheritance diagram for png::writer< ostream >:

List of all members.

## Public Member Functions

| writer (ostream &stream)
| Constructs a writer prepared to write PNG image into a stream.
| ~writer ()
void | write_png () const
void | write_info () const
| Write info about PNG image.
void | write_row (byte *bytes)
| Writes a row of image data at a time.
void | write_end_info () const
| Reads ending info about PNG image.

## Detailed Description

### template<class ostream>
class png::writer< ostream >

PNG writer class template. This is the low-level writing interface--use image class or generator class to actually write images.

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

     class my_ostream
     {
     public:
         void write(char const*, size_t);
         void flush();
         bool good();
     };

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

See also:
  image, reader, generator, io_base

## Constructor & Destructor Documentation

template<class ostream>

png::writer< ostream >::writer | ( | ostream & | stream ) | `[inline, explicit]`

Constructs a writer prepared to write PNG image into a stream.

References png::io_base::m_png.

template<class ostream>

png::writer< ostream >::~writer | ( | ) | `[inline]`

References png::end_info::destroy(), 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 ostream>

void png::writer< ostream >::write_png | ( | ) | const`[inline]`

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 ostream>

void png::writer< ostream >::write_info | ( | ) | const`[inline]`

Write info about PNG image.

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

Referenced by png::generator< pixel, pixel_generator, image_info_ref_holder, true >::write().

template<class ostream>

void png::writer< ostream >::write_row | ( | byte * | bytes ) | `[inline]`

Writes a row of image data at a time.

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

Referenced by png::generator< pixel, pixel_generator, image_info_ref_holder, true >::write().

template<class ostream>

void png::writer< ostream >::write_end_info | ( | ) | const`[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::write().

Referenced by png::generator< pixel, pixel_generator, image_info_ref_holder, true >::write().

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

- writer.hpp