libpng++  v0.2.5-1
C++ library for PNG images
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
png::reader< istream > Class Template Reference

The PNG reader class template. More...

#include <reader.hpp>

Inheritance diagram for png::reader< istream >:
Collaboration diagram for png::reader< istream >:

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_infoget_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
 
infoget_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)
 

Detailed Description

template<class istream>
class png::reader< istream >

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:

class my_istream
{
public:
void read(char*, size_t);
bool good();
};

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

See Also
image, consumer, writer, io_base

Constructor & Destructor Documentation

template<class istream>
png::reader< istream >::reader ( istream &  stream)
inlineexplicit

Constructs a reader prepared to read PNG image from a stream.

References png::io_base::m_png, and png::reader< istream >::read_data().

Here is the call graph for this function:

template<class istream>
png::reader< istream >::~reader ( )
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.

Here is the call graph for this function:

Member Function Documentation

compression_type png::io_base::get_compression_type ( ) const
inlineinherited

References png::image_info::get_compression_type(), and png::io_base::m_info.

Here is the call graph for this function:

end_info& png::io_base::get_end_info ( )
inlineinherited
end_info const& png::io_base::get_end_info ( ) const
inlineinherited
filter_type png::io_base::get_filter_type ( ) const
inlineinherited

References png::image_info::get_filter_type(), and png::io_base::m_info.

Here is the call graph for this function:

size_t png::io_base::get_height ( ) const
inlineinherited

References png::image_info::get_height(), and png::io_base::m_info.

Here is the call graph for this function:

image_info const& png::io_base::get_image_info ( ) const
inlineinherited

References png::io_base::m_info.

Referenced by png::consumer< pixel, pixel_consumer, image_info_ref_holder, true >::read().

Here is the caller graph for this function:

info& png::io_base::get_info ( )
inlineinherited

References png::io_base::m_info.

Referenced by png::detail::convert_color_space_impl< rgb_pixel >::handle_palette().

Here is the caller graph for this function:

info const& png::io_base::get_info ( ) const
inlineinherited

References png::io_base::m_info.

interlace_type png::io_base::get_interlace_type ( ) const
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().

Here is the call graph for this function:

Here is the caller graph for this function:

void* png::io_base::get_io_ptr ( ) const
inlineprotectedinherited

References png::io_base::m_png.

png_struct* png::io_base::get_png_struct ( ) const
inlineinherited

References png::io_base::m_png.

size_t png::io_base::get_width ( ) const
inlineinherited

References png::image_info::get_width(), and png::io_base::m_info.

Here is the call graph for this function:

bool png::io_base::has_chunk ( chunk  id)
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().

Here is the call graph for this function:

Here is the caller graph for this function:

bool png::io_base::is_error ( ) const
inlineprotectedinherited
void png::io_base::raise_error ( )
inlineprotectedinherited
static void png::io_base::raise_error ( png_struct *  png,
char const *  message 
)
inlinestaticprotectedinherited

References png::io_base::raise_error(), and png::io_base::set_error().

Here is the call graph for this function:

template<class istream>
static void png::reader< istream >::read_data ( png_struct *  png,
byte data,
size_t  length 
)
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().

Here is the call graph for this function:

Here is the caller graph for this function:

template<class istream>
void png::reader< istream >::read_end_info ( )
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().

Here is the call graph for this function:

Here is the caller graph for this function:

template<class istream>
void png::reader< istream >::read_info ( )
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().

Here is the call graph for this function:

Here is the caller graph for this function:

template<class istream>
void png::reader< istream >::read_png ( )
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.

Here is the call graph for this function:

template<class istream>
void png::reader< istream >::read_row ( byte bytes)
inline
void png::io_base::reset_error ( )
inlineprotectedinherited
void png::io_base::set_bit_depth ( size_t  bit_depth)
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()().

Here is the call graph for this function:

Here is the caller graph for this function:

void png::io_base::set_color_type ( color_type  color_space)
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()().

Here is the call graph for this function:

Here is the caller graph for this function:

void png::io_base::set_compression_type ( compression_type  compression)
inlineinherited

References png::io_base::m_info, and png::image_info::set_compression_type().

Here is the call graph for this function:

void png::io_base::set_error ( char const *  message)
inlineprotectedinherited
void png::io_base::set_filter_type ( filter_type  filter)
inlineinherited

References png::io_base::m_info, and png::image_info::set_filter_type().

Here is the call graph for this function:

void png::io_base::set_height ( size_t  height)
inlineinherited

References png::io_base::m_info, and png::image_info::set_height().

Here is the call graph for this function:

void png::io_base::set_image_info ( image_info const &  info)
inlineinherited

References png::io_base::m_info.

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

Here is the caller graph for this function:

void png::io_base::set_interlace_type ( interlace_type  interlace)
inlineinherited

References png::io_base::m_info, and png::image_info::set_interlace_type().

Here is the call graph for this function:

void png::io_base::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
inlineinherited

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

Referenced by png::detail::convert_color_space_impl< rgb_pixel >::handle_rgb().

Here is the caller graph for this function:

void png::io_base::set_width ( size_t  width)
inlineinherited

References png::io_base::m_info, and png::image_info::set_width().

Here is the call graph for this function:

template<class istream>
void png::reader< istream >::update_info ( )
inline

References png::io_base::m_info, and png::info::update().

Referenced by png::consumer< pixel, pixel_consumer, image_info_ref_holder, true >::read().

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation


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