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
136 if (pixel_traits< pixel >::get_bit_depth() == 16)
138 #ifdef PNG_WRITE_SWAP_SUPPORTED
141 throw error(
"Cannot write 16-bit image:"
142 " recompile with PNG_WRITE_SWAP_SUPPORTED.");
150 #ifdef PNG_WRITE_INTERLACING_SUPPORTED
151 if (interlacing_supported)
157 throw std::logic_error(
"Cannot write interlaced image:"
158 " generator does not support it.");
161 throw error(
"Cannot write interlaced image:"
162 " interlace handling disabled.");
169 pixgen* pixel_gen =
static_cast< pixgen*
>(
this);
170 for (
size_t pass = 0; pass < pass_count; ++pass)
172 pixel_gen->reset(pass);
176 wr.
write_row(pixel_gen->get_next_row(pos));
200 :
base(width, height)
207 #endif // PNGPP_GENERATOR_HPP_INCLUDED