PNG writer class template. More...
#include <writer.hpp>
Public Member Functions | |
writer (ostream &stream) | |
Constructs a writer prepared to write PNG image into a stream. More... | |
~writer () | |
size_t | get_bit_depth () const |
color_type | get_color_type () const |
compression_type | get_compression_type () const |
end_info & | get_end_info () |
end_info const & | get_end_info () const |
filter_type | get_filter_type () const |
size_t | get_height () const |
image_info const & | get_image_info () const |
info & | get_info () |
info const & | get_info () const |
interlace_type | get_interlace_type () const |
png_struct * | get_png_struct () const |
size_t | get_width () const |
bool | has_chunk (chunk id) |
void | set_bit_depth (size_t bit_depth) |
void | set_color_type (color_type color_space) |
void | set_compression_type (compression_type compression) |
void | set_filter_type (filter_type filter) |
void | set_height (size_t height) |
void | set_image_info (image_info const &info) |
void | set_interlace_type (interlace_type interlace) |
void | set_rgb_to_gray (rgb_to_gray_error_action error_action=rgb_to_gray_silent, fixed_point red_weight=-1, fixed_point green_weight=-1) const |
void | set_width (size_t width) |
void | write_end_info () const |
Reads ending info about PNG image. More... | |
void | write_info () const |
Write info about PNG image. More... | |
void | write_png () const |
void | write_row (byte *bytes) |
Writes a row of image data at a time. More... | |
Protected Member Functions | |
void * | get_io_ptr () const |
bool | is_error () const |
void | raise_error () |
void | reset_error () |
void | set_error (char const *message) |
Static Protected Member Functions | |
static void | raise_error (png_struct *png, char const *message) |
Protected Attributes | |
end_info | m_end_info |
std::string | m_error |
info | m_info |
png_struct * | m_png |
Static Private Member Functions | |
static void | flush_data (png_struct *png) |
static void | write_data (png_struct *png, byte *data, size_t length) |
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:
With the semantics similar to the std::ostream
. Naturally, std::ostream
fits this requirement and can be used with the writer class as is.
|
inlineexplicit |
Constructs a writer prepared to write PNG image into a stream.
References png::writer< ostream >::flush_data(), png::io_base::m_png, and png::writer< ostream >::write_data().
|
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.
|
inlinestaticprivate |
References png::io_base::is_error(), png::io_base::raise_error(), png::io_base::reset_error(), and png::io_base::set_error().
Referenced by png::writer< ostream >::writer().
|
inlineinherited |
References png::image_info::get_bit_depth(), and png::io_base::m_info.
Referenced by png::detail::convert_color_space_impl< rgb_pixel >::handle_16(), png::detail::convert_color_space_impl< rgb_pixel >::handle_gray(), png::require_color_space< pixel >::operator()(), and png::consumer< pixel, pixel_consumer, image_info_ref_holder, true >::read().
|
inlineinherited |
References png::image_info::get_color_type(), and png::io_base::m_info.
Referenced by png::detail::convert_color_space_impl< rgb_pixel >::handle_alpha(), png::detail::convert_color_space_impl< rgb_pixel >::handle_gray(), png::detail::convert_color_space_impl< rgb_pixel >::handle_palette(), png::detail::convert_color_space_impl< rgb_pixel >::handle_rgb(), png::require_color_space< pixel >::operator()(), and png::consumer< pixel, pixel_consumer, image_info_ref_holder, true >::read().
|
inlineinherited |
References png::image_info::get_compression_type(), and png::io_base::m_info.
|
inlineinherited |
References png::io_base::m_end_info.
|
inlineinherited |
References png::io_base::m_end_info.
|
inlineinherited |
References png::image_info::get_filter_type(), and png::io_base::m_info.
|
inlineinherited |
References png::image_info::get_height(), and png::io_base::m_info.
|
inlineinherited |
References png::io_base::m_info.
Referenced by png::consumer< pixel, pixel_consumer, image_info_ref_holder, true >::read().
|
inlineinherited |
References png::io_base::m_info.
Referenced by png::detail::convert_color_space_impl< rgb_pixel >::handle_palette().
|
inlineinherited |
References png::io_base::m_info.
|
inlineinherited |
References png::image_info::get_interlace_type(), and png::io_base::m_info.
Referenced by png::consumer< pixel, pixel_consumer, image_info_ref_holder, true >::read().
|
inlineprotectedinherited |
References png::io_base::m_png.
|
inlineinherited |
References png::io_base::m_png.
|
inlineinherited |
References png::image_info::get_width(), and png::io_base::m_info.
|
inlineinherited |
References png::info_base::get_png_info(), png::io_base::m_info, and png::io_base::m_png.
Referenced by png::detail::convert_color_space_impl< rgb_pixel >::handle_alpha().
|
inlineprotectedinherited |
References png::io_base::m_error.
Referenced by png::writer< ostream >::flush_data(), png::reader< istream >::read_data(), and png::writer< ostream >::write_data().
|
inlineprotectedinherited |
References png::io_base::m_png.
Referenced by png::writer< ostream >::flush_data(), png::io_base::raise_error(), png::reader< istream >::read_data(), and png::writer< ostream >::write_data().
|
inlinestaticprotectedinherited |
References png::io_base::raise_error(), and png::io_base::set_error().
|
inlineprotectedinherited |
References png::io_base::m_error.
Referenced by png::writer< ostream >::flush_data(), png::reader< istream >::read_data(), and png::writer< ostream >::write_data().
|
inlineinherited |
References png::io_base::m_info, and png::image_info::set_bit_depth().
Referenced by png::detail::convert_color_space_impl< rgb_pixel >::operator()().
|
inlineinherited |
References png::io_base::m_info, and png::image_info::set_color_type().
Referenced by png::detail::convert_color_space_impl< rgb_pixel >::operator()().
|
inlineinherited |
References png::io_base::m_info, and png::image_info::set_compression_type().
|
inlineprotectedinherited |
References png::io_base::m_error.
Referenced by png::writer< ostream >::flush_data(), png::io_base::raise_error(), png::reader< istream >::read_data(), and png::writer< ostream >::write_data().
|
inlineinherited |
References png::io_base::m_info, and png::image_info::set_filter_type().
|
inlineinherited |
References png::io_base::m_info, and png::image_info::set_height().
|
inlineinherited |
References png::io_base::m_info.
Referenced by png::generator< pixel, pixel_generator, image_info_ref_holder, true >::write().
|
inlineinherited |
References png::io_base::m_info, and png::image_info::set_interlace_type().
|
inlineinherited |
References png::io_base::m_png, and TRACE_IO_TRANSFORM.
Referenced by png::detail::convert_color_space_impl< rgb_pixel >::handle_rgb().
|
inlineinherited |
References png::io_base::m_info, and png::image_info::set_width().
|
inlinestaticprivate |
References png::io_base::is_error(), png::io_base::raise_error(), png::io_base::reset_error(), and png::io_base::set_error().
Referenced by png::writer< ostream >::writer().
|
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().
|
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().
|
inline |
References png::info_base::get_png_info(), png::io_base::m_error, png::io_base::m_info, and png::io_base::m_png.
|
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().
|
protectedinherited |
|
protectedinherited |
Referenced by png::io_base::is_error(), png::reader< istream >::read_end_info(), png::reader< istream >::read_info(), png::reader< istream >::read_png(), png::reader< istream >::read_row(), png::io_base::reset_error(), png::io_base::set_error(), png::writer< ostream >::write_end_info(), png::writer< ostream >::write_info(), png::writer< ostream >::write_png(), and png::writer< ostream >::write_row().
|
protectedinherited |
Referenced by png::io_base::get_bit_depth(), png::io_base::get_color_type(), png::io_base::get_compression_type(), png::io_base::get_filter_type(), png::io_base::get_height(), png::io_base::get_image_info(), png::io_base::get_info(), png::io_base::get_interlace_type(), png::io_base::get_width(), png::io_base::has_chunk(), png::reader< istream >::read_info(), png::reader< istream >::read_png(), png::io_base::set_bit_depth(), png::io_base::set_color_type(), png::io_base::set_compression_type(), png::io_base::set_filter_type(), png::io_base::set_height(), png::io_base::set_image_info(), png::io_base::set_interlace_type(), png::io_base::set_width(), png::reader< istream >::update_info(), png::writer< ostream >::write_info(), png::writer< ostream >::write_png(), png::io_base::~io_base(), png::reader< istream >::~reader(), and png::writer< ostream >::~writer().
|
protectedinherited |
Referenced by png::io_base::get_io_ptr(), png::io_base::get_png_struct(), png::io_base::has_chunk(), png::io_base::raise_error(), png::reader< istream >::read_end_info(), png::reader< istream >::read_info(), png::reader< istream >::read_png(), png::reader< istream >::read_row(), png::reader< istream >::reader(), png::io_base::set_rgb_to_gray(), png::writer< ostream >::write_end_info(), png::writer< ostream >::write_info(), png::writer< ostream >::write_png(), png::writer< ostream >::write_row(), png::writer< ostream >::writer(), png::io_base::~io_base(), png::reader< istream >::~reader(), and png::writer< ostream >::~writer().