31#ifndef PNGPP_GENERATOR_HPP_INCLUDED
32#define PNGPP_GENERATOR_HPP_INCLUDED
112 template<
typename pixel,
114 class info_holder = def_image_info_holder,
115 bool interlacing_supported =
false >
128 template<
typename ostream >
135#if __BYTE_ORDER == __LITTLE_ENDIAN
138#ifdef PNG_WRITE_SWAP_SUPPORTED
141 throw error(
"Cannot write 16-bit image: recompile with PNG_WRITE_SWAP_SUPPORTED.");
149#ifdef PNG_WRITE_INTERLACING_SUPPORTED
156 throw std::logic_error(
"Cannot write interlaced image: generator does not support it.");
159 throw error(
"Cannot write interlaced image: interlace handling disabled.");
Exception class to represent runtime errors related to png++ operation.
Definition error.hpp:59
Pixel generator class template.
Definition generator.hpp:118
generator(size_t width, size_t height)
Constructs a generator object prepared to generate an image of specified width and height.
Definition generator.hpp:196
generator(image_info &info)
Constructs a generator object using passed image_info object to store image information.
Definition generator.hpp:187
void write(ostream &stream)
Writes an image to the stream.
Definition generator.hpp:129
streaming_base< pixel, info_holder > base
Definition generator.hpp:181
Holds information about PNG image.
Definition image_info.hpp:48
uint_32 get_height() const
Definition image_info.hpp:77
Holds information about PNG image. Adapter class for IO image operations.
Definition info.hpp:48
int set_interlace_handling() const
Definition io_base.hpp:376
void set_image_info(image_info const &info)
Definition io_base.hpp:102
void set_swap() const
Definition io_base.hpp:312
The PNG reader class template. This is the low-level reading interface–use image class or consumer cl...
Definition reader.hpp:67
A base class template for consumer and generator classes. Provides default reset() method implementat...
Definition streaming_base.hpp:91
image_info const & get_info() const
Definition streaming_base.hpp:107
@ interlace_none
Definition types.hpp:81
Pixel traits class template.
Definition pixel_traits.hpp:48