The PNG reader class template. More...
#include <reader.hpp>
Public Member Functions | |
reader (istream &stream) | |
Constructs a reader prepared to read PNG image from a stream. More... | |
~reader () | |
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 | read_end_info () |
Reads ending info about PNG image. More... | |
void | read_info () |
Reads info about PNG image. More... | |
void | read_png () |
Reads the whole PNG data stream into memory. More... | |
void | read_row (byte *bytes) |
Reads a row of image data at a time. More... | |
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 | update_info () |
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 | read_data (png_struct *png, byte *data, size_t length) |
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:
With the semantics similar to the std::istream
. Naturally, std::istream
fits this requirement and can be used with the reader class as is.
|
inlineexplicit |
Constructs a reader prepared to read PNG image from a stream.
References png::io_base::m_png, and png::reader< istream >::read_data().
|
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.
|
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().
|
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::reader< istream >::reader().
|
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().
|
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().
|
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.
|
inline |
Reads a row of image data at a time.
References png::io_base::m_error, and png::io_base::m_png.
Referenced by png::consumer< pixel, pixel_consumer, image_info_ref_holder, true >::read_rows(), and png::consumer< pixel, pixel_consumer, image_info_ref_holder, true >::skip_interlaced_rows().
|
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().
|
inline |
References png::io_base::m_info, and png::info::update().
Referenced by png::consumer< pixel, pixel_consumer, image_info_ref_holder, true >::read().
|
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().