Class template to represent PNG image. More...
#include <image.hpp>
Classes | |
class | pixel_consumer |
The pixel buffer adapter for reading pixel data. More... | |
class | pixel_generator |
The pixel buffer adapter for writing pixel data. More... | |
class | streaming_impl |
A common base class template for pixel_consumer and pixel_generator classes. More... | |
struct | transform_identity |
The default io transformation: does nothing. More... | |
Public Types | |
typedef pixel_buffer< pixel > | pixbuf |
The pixel buffer type for pixel . More... | |
typedef pixbuf::row_type | row_type |
Represents a row of image pixel data. More... | |
typedef pixel_traits< pixel > | traits |
The pixel traits type for pixel . More... | |
typedef convert_color_space < pixel > | transform_convert |
A transformation functor to convert any image to appropriate color space. More... | |
Public Member Functions | |
image () | |
Constructs an empty image. More... | |
image (size_t width, size_t height) | |
Constructs an empty image of specified width and height. More... | |
image (std::string const &filename) | |
Constructs an image reading data from specified file using default converting transform. More... | |
template<class transformation > | |
image (std::string const &filename, transformation const &transform) | |
Constructs an image reading data from specified file using custom transformaton. More... | |
image (char const *filename) | |
Constructs an image reading data from specified file using default converting transform. More... | |
template<class transformation > | |
image (char const *filename, transformation const &transform) | |
Constructs an image reading data from specified file using custom transformaton. More... | |
image (std::istream &stream) | |
Constructs an image reading data from a stream using default converting transform. More... | |
template<class transformation > | |
image (std::istream &stream, transformation const &transform) | |
Constructs an image reading data from a stream using custom transformation. More... | |
compression_type | get_compression_type () const |
filter_type | get_filter_type () const |
size_t | get_height () const |
interlace_type | get_interlace_type () const |
palette & | get_palette () |
Returns a reference to the image palette. More... | |
palette const & | get_palette () const |
Returns a const reference to the image palette. More... | |
pixbuf & | get_pixbuf () |
Returns a reference to image pixel buffer. More... | |
pixbuf const & | get_pixbuf () const |
Returns a const reference to image pixel buffer. More... | |
pixel | get_pixel (size_t x, size_t y) const |
Returns a pixel at (x,y) position. More... | |
row_type & | get_row (size_t index) |
Returns a reference to the row of image data at specified index. More... | |
row_type const & | get_row (size_t index) const |
Returns a const reference to the row of image data at specified index. More... | |
tRNS const & | get_tRNS () const |
tRNS & | get_tRNS () |
size_t | get_width () const |
row_type & | operator[] (size_t index) |
The non-checking version of get_row() method. More... | |
row_type const & | operator[] (size_t index) const |
The non-checking version of get_row() method. More... | |
void | read (std::string const &filename) |
Reads an image from specified file using default converting transform. More... | |
template<class transformation > | |
void | read (std::string const &filename, transformation const &transform) |
Reads an image from specified file using custom transformaton. More... | |
void | read (char const *filename) |
Reads an image from specified file using default converting transform. More... | |
template<class transformation > | |
void | read (char const *filename, transformation const &transform) |
Reads an image from specified file using custom transformaton. More... | |
void | read (std::istream &stream) |
Reads an image from a stream using default converting transform. More... | |
template<class transformation > | |
void | read (std::istream &stream, transformation const &transform) |
Reads an image from a stream using custom transformation. More... | |
template<class istream > | |
void | read_stream (istream &stream) |
Reads an image from a stream using default converting transform. More... | |
template<class istream , class transformation > | |
void | read_stream (istream &stream, transformation const &transform) |
Reads an image from a stream using custom transformation. More... | |
void | resize (size_t width, size_t height) |
Resizes the image pixel buffer. More... | |
void | set_compression_type (compression_type compression) |
void | set_filter_type (filter_type filter) |
void | set_interlace_type (interlace_type interlace) |
void | set_palette (palette const &plte) |
Replaces the image palette. More... | |
void | set_pixbuf (pixbuf const &buffer) |
Replaces the image pixel buffer. More... | |
void | set_pixel (size_t x, size_t y, pixel p) |
Replaces a pixel at (x,y) position. More... | |
void | set_tRNS (tRNS const &trns) |
void | write (std::string const &filename) |
Writes an image to specified file. More... | |
void | write (char const *filename) |
Writes an image to specified file. More... | |
void | write_stream (std::ostream &stream) |
Writes an image to a stream. More... | |
template<class ostream > | |
void | write_stream (ostream &stream) |
Writes an image to a stream. More... | |
Protected Attributes | |
image_info | m_info |
pixbuf | m_pixbuf |
Class template to represent PNG image.
The image consists of pixel data as well as additional image info like interlace type, compression method, palette (for colormap-based images) etc. Provides methods to read and write images from/to a generic stream and to manipulate image pixels.
typedef pixel_buffer< pixel > png::image< pixel >::pixbuf |
The pixel buffer type for pixel
.
typedef pixbuf::row_type png::image< pixel >::row_type |
Represents a row of image pixel data.
typedef pixel_traits< pixel > png::image< pixel >::traits |
The pixel traits type for pixel
.
typedef convert_color_space< pixel > png::image< pixel >::transform_convert |
A transformation functor to convert any image to appropriate color space.
|
inline |
Constructs an empty image.
|
inline |
Constructs an empty image of specified width and height.
References png::image< pixel >::resize().
|
inlineexplicit |
Constructs an image reading data from specified file using default converting transform.
References png::image< pixel >::read().
|
inline |
Constructs an image reading data from specified file using custom transformaton.
References png::image< pixel >::read().
|
inlineexplicit |
Constructs an image reading data from specified file using default converting transform.
References png::image< pixel >::read().
|
inline |
Constructs an image reading data from specified file using custom transformaton.
References png::image< pixel >::read().
|
inlineexplicit |
Constructs an image reading data from a stream using default converting transform.
References png::image< pixel >::read_stream().
|
inline |
Constructs an image reading data from a stream using custom transformation.
References png::image< pixel >::read_stream().
|
inline |
References png::image_info::get_compression_type(), and png::image< pixel >::m_info.
|
inline |
References png::image_info::get_filter_type(), and png::image< pixel >::m_info.
|
inline |
References png::image< pixel >::m_pixbuf.
Referenced by png::image< pixel >::pixel_consumer::reset().
|
inline |
References png::image_info::get_interlace_type(), and png::image< pixel >::m_info.
|
inline |
Returns a reference to the image palette.
References png::image_info::get_palette(), and png::image< pixel >::m_info.
|
inline |
Returns a const reference to the image palette.
References png::image_info::get_palette(), and png::image< pixel >::m_info.
|
inline |
Returns a reference to image pixel buffer.
References png::image< pixel >::m_pixbuf.
|
inline |
Returns a const reference to image pixel buffer.
References png::image< pixel >::m_pixbuf.
|
inline |
Returns a pixel at (x,y) position.
References png::image< pixel >::m_pixbuf.
|
inline |
Returns a reference to the row of image data at specified index.
References png::image< pixel >::m_pixbuf.
|
inline |
Returns a const reference to the row of image data at specified index.
References png::image< pixel >::m_pixbuf.
|
inline |
References png::image_info::get_tRNS(), and png::image< pixel >::m_info.
|
inline |
References png::image_info::get_tRNS(), and png::image< pixel >::m_info.
|
inline |
References png::image< pixel >::m_pixbuf.
Referenced by png::image< pixel >::pixel_consumer::reset().
|
inline |
The non-checking version of get_row() method.
References png::image< pixel >::m_pixbuf.
|
inline |
The non-checking version of get_row() method.
References png::image< pixel >::m_pixbuf.
|
inline |
Reads an image from specified file using default converting transform.
Referenced by png::image< pixel >::image(), and png::image< pixel >::read().
|
inline |
Reads an image from specified file using custom transformaton.
References png::image< pixel >::read().
|
inline |
Reads an image from specified file using default converting transform.
References png::image< pixel >::read().
|
inline |
Reads an image from specified file using custom transformaton.
References png::image< pixel >::read_stream().
|
inline |
Reads an image from a stream using default converting transform.
References png::image< pixel >::read_stream().
|
inline |
Reads an image from a stream using custom transformation.
References png::image< pixel >::read_stream().
|
inline |
Reads an image from a stream using default converting transform.
Referenced by png::image< pixel >::image(), and png::image< pixel >::read().
|
inline |
Reads an image from a stream using custom transformation.
References png::image< pixel >::m_info, and png::image< pixel >::m_pixbuf.
|
inline |
Resizes the image pixel buffer.
References png::image< pixel >::m_info, png::image< pixel >::m_pixbuf, png::image_info::set_height(), and png::image_info::set_width().
Referenced by png::image< pixel >::image().
|
inline |
References png::image< pixel >::m_info, and png::image_info::set_compression_type().
|
inline |
References png::image< pixel >::m_info, and png::image_info::set_filter_type().
|
inline |
References png::image< pixel >::m_info, and png::image_info::set_interlace_type().
|
inline |
Replaces the image palette.
References png::image< pixel >::m_info, and png::image_info::set_palette().
|
inline |
Replaces the image pixel buffer.
buffer | a pixel buffer object to take a copy from |
References png::image< pixel >::m_pixbuf.
|
inline |
Replaces a pixel at (x,y) position.
References png::image< pixel >::m_pixbuf.
|
inline |
References png::image< pixel >::m_info, and png::image_info::set_tRNS().
|
inline |
Writes an image to specified file.
|
inline |
Writes an image to specified file.
References png::image< pixel >::write_stream().
|
inline |
Writes an image to a stream.
Referenced by png::image< pixel >::write().
|
inline |
Writes an image to a stream.
References png::image< pixel >::m_info, and png::image< pixel >::m_pixbuf.
|
protected |
Referenced by png::image< pixel >::get_compression_type(), png::image< pixel >::get_filter_type(), png::image< pixel >::get_interlace_type(), png::image< pixel >::get_palette(), png::image< pixel >::get_tRNS(), png::image< pixel >::read_stream(), png::image< pixel >::resize(), png::image< pixel >::set_compression_type(), png::image< pixel >::set_filter_type(), png::image< pixel >::set_interlace_type(), png::image< pixel >::set_palette(), png::image< pixel >::set_tRNS(), and png::image< pixel >::write_stream().
|
protected |
Referenced by png::image< pixel >::get_height(), png::image< pixel >::get_pixbuf(), png::image< pixel >::get_pixel(), png::image< pixel >::get_row(), png::image< pixel >::get_width(), png::image< pixel >::operator[](), png::image< pixel >::read_stream(), png::image< pixel >::resize(), png::image< pixel >::set_pixbuf(), png::image< pixel >::set_pixel(), and png::image< pixel >::write_stream().