#include <image.hpp>
Public Types | |
typedef pixel_traits< pixel > | traits |
The pixel traits type for pixel . | |
typedef pixel_buffer< pixel > | pixbuf |
The pixel buffer type for pixel . | |
typedef pixbuf::row_type | row_type |
Represents a row of image pixel data. | |
typedef convert_color_space < pixel > | transform_convert |
A transformation functor to convert any image to appropriate color space. | |
Public Member Functions | |
image () | |
Constructs an empty image. | |
image (size_t width, size_t height) | |
Constructs an empty image of specified width and height. | |
image (std::string const &filename) | |
Constructs an image reading data from specified file using default converting transform. | |
template<class transformation> | |
image (std::string const &filename, transformation const &transform) | |
Constructs an image reading data from specified file using custom transformaton. | |
image (char const *filename) | |
Constructs an image reading data from specified file using default converting transform. | |
template<class transformation> | |
image (char const *filename, transformation const &transform) | |
Constructs an image reading data from specified file using custom transformaton. | |
image (std::istream &stream) | |
Constructs an image reading data from a stream using default converting transform. | |
template<class transformation> | |
image (std::istream &stream, transformation const &transform) | |
Constructs an image reading data from a stream using custom transformation. | |
void | read (std::string const &filename) |
Reads an image from specified file using default converting transform. | |
template<class transformation> | |
void | read (std::string const &filename, transformation const &transform) |
Reads an image from specified file using custom transformaton. | |
void | read (char const *filename) |
Reads an image from specified file using default converting transform. | |
template<class transformation> | |
void | read (char const *filename, transformation const &transform) |
Reads an image from specified file using custom transformaton. | |
void | read (std::istream &stream) |
Reads an image from a stream using default converting transform. | |
template<class transformation> | |
void | read (std::istream &stream, transformation const &transform) |
Reads an image from a stream using custom transformation. | |
template<class istream> | |
void | read_stream (istream &stream) |
Reads an image from a stream using default converting transform. | |
template<class istream, class transformation> | |
void | read_stream (istream &stream, transformation const &transform) |
Reads an image from a stream using custom transformation. | |
void | write (std::string const &filename) |
Writes an image to specified file. | |
void | write (char const *filename) |
Writes an image to specified file. | |
void | write_stream (std::ostream &stream) |
Writes an image to a stream. | |
template<class ostream> | |
void | write_stream (ostream &stream) |
Writes an image to a stream. | |
pixbuf & | get_pixbuf () |
Returns a reference to image pixel buffer. | |
pixbuf const & | get_pixbuf () const |
Returns a const reference to image pixel buffer. | |
void | set_pixbuf (pixbuf const &buffer) |
Replaces the image pixel buffer. | |
size_t | get_width () const |
size_t | get_height () const |
void | resize (size_t width, size_t height) |
Resizes the image pixel buffer. | |
row_type & | get_row (size_t index) |
Returns a reference to the row of image data at specified index. | |
row_type const & | get_row (size_t index) const |
Returns a const reference to the row of image data at specified index. | |
row_type & | operator[] (size_t index) |
The non-checking version of get_row() method. | |
row_type const & | operator[] (size_t index) const |
The non-checking version of get_row() method. | |
pixel | get_pixel (size_t x, size_t y) const |
Returns a pixel at (x,y) position. | |
void | set_pixel (size_t x, size_t y, pixel p) |
Replaces a pixel at (x,y) position. | |
interlace_type | get_interlace_type () const |
void | set_interlace_type (interlace_type interlace) |
compression_type | get_compression_type () const |
void | set_compression_type (compression_type compression) |
filter_type | get_filter_type () const |
void | set_filter_type (filter_type filter) |
palette & | get_palette () |
Returns a reference to the image palette. | |
palette const & | get_palette () const |
Returns a const reference to the image palette. | |
void | set_palette (palette const &plte) |
Replaces the image palette. | |
tRNS const & | get_tRNS () const |
tRNS & | get_tRNS () |
void | set_tRNS (tRNS const &trns) |
Protected Attributes | |
image_info | m_info |
pixbuf | m_pixbuf |
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... |
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_traits< pixel > png::image< pixel >::traits |
The pixel traits type for pixel
.
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 convert_color_space< pixel > png::image< pixel >::transform_convert |
png::image< pixel >::image | ( | ) | [inline] |
Constructs an empty image.
png::image< pixel >::image | ( | size_t | width, | |
size_t | height | |||
) | [inline] |
Constructs an empty image of specified width and height.
png::image< pixel >::image | ( | std::string const & | filename | ) | [inline, explicit] |
Constructs an image reading data from specified file using default converting transform.
png::image< pixel >::image | ( | std::string const & | filename, | |
transformation const & | transform | |||
) | [inline] |
Constructs an image reading data from specified file using custom transformaton.
png::image< pixel >::image | ( | char const * | filename | ) | [inline, explicit] |
Constructs an image reading data from specified file using default converting transform.
png::image< pixel >::image | ( | char const * | filename, | |
transformation const & | transform | |||
) | [inline] |
Constructs an image reading data from specified file using custom transformaton.
png::image< pixel >::image | ( | std::istream & | stream | ) | [inline, explicit] |
Constructs an image reading data from a stream using default converting transform.
png::image< pixel >::image | ( | std::istream & | stream, | |
transformation const & | transform | |||
) | [inline] |
Constructs an image reading data from a stream using custom transformation.
void png::image< pixel >::read | ( | std::string const & | filename | ) | [inline] |
Reads an image from specified file using default converting transform.
void png::image< pixel >::read | ( | std::string const & | filename, | |
transformation const & | transform | |||
) | [inline] |
Reads an image from specified file using custom transformaton.
void png::image< pixel >::read | ( | char const * | filename | ) | [inline] |
Reads an image from specified file using default converting transform.
void png::image< pixel >::read | ( | char const * | filename, | |
transformation const & | transform | |||
) | [inline] |
Reads an image from specified file using custom transformaton.
void png::image< pixel >::read | ( | std::istream & | stream | ) | [inline] |
Reads an image from a stream using default converting transform.
void png::image< pixel >::read | ( | std::istream & | stream, | |
transformation const & | transform | |||
) | [inline] |
Reads an image from a stream using custom transformation.
void png::image< pixel >::read_stream | ( | istream & | stream | ) | [inline] |
Reads an image from a stream using default converting transform.
void png::image< pixel >::read_stream | ( | istream & | stream, | |
transformation const & | transform | |||
) | [inline] |
Reads an image from a stream using custom transformation.
void png::image< pixel >::write | ( | std::string const & | filename | ) | [inline] |
Writes an image to specified file.
void png::image< pixel >::write | ( | char const * | filename | ) | [inline] |
Writes an image to specified file.
void png::image< pixel >::write_stream | ( | std::ostream & | stream | ) | [inline] |
Writes an image to a stream.
void png::image< pixel >::write_stream | ( | ostream & | stream | ) | [inline] |
Writes an image to a stream.
pixbuf& png::image< pixel >::get_pixbuf | ( | ) | [inline] |
Returns a reference to image pixel buffer.
pixbuf const& png::image< pixel >::get_pixbuf | ( | ) | const [inline] |
Returns a const reference to image pixel buffer.
void png::image< pixel >::set_pixbuf | ( | pixbuf const & | buffer | ) | [inline] |
size_t png::image< pixel >::get_width | ( | ) | const [inline] |
size_t png::image< pixel >::get_height | ( | ) | const [inline] |
void png::image< pixel >::resize | ( | size_t | width, | |
size_t | height | |||
) | [inline] |
Resizes the image pixel buffer.
row_type& png::image< pixel >::get_row | ( | size_t | index | ) | [inline] |
row_type const& png::image< pixel >::get_row | ( | size_t | index | ) | const [inline] |
Returns a const reference to the row of image data at specified index.
row_type& png::image< pixel >::operator[] | ( | size_t | index | ) | [inline] |
The non-checking version of get_row() method.
row_type const& png::image< pixel >::operator[] | ( | size_t | index | ) | const [inline] |
The non-checking version of get_row() method.
pixel png::image< pixel >::get_pixel | ( | size_t | x, | |
size_t | y | |||
) | const [inline] |
Returns a pixel at (x,y) position.
void png::image< pixel >::set_pixel | ( | size_t | x, | |
size_t | y, | |||
pixel | p | |||
) | [inline] |
Replaces a pixel at (x,y) position.
interlace_type png::image< pixel >::get_interlace_type | ( | ) | const [inline] |
void png::image< pixel >::set_interlace_type | ( | interlace_type | interlace | ) | [inline] |
compression_type png::image< pixel >::get_compression_type | ( | ) | const [inline] |
void png::image< pixel >::set_compression_type | ( | compression_type | compression | ) | [inline] |
filter_type png::image< pixel >::get_filter_type | ( | ) | const [inline] |
void png::image< pixel >::set_filter_type | ( | filter_type | filter | ) | [inline] |
palette& png::image< pixel >::get_palette | ( | ) | [inline] |
Returns a reference to the image palette.
palette const& png::image< pixel >::get_palette | ( | ) | const [inline] |
Returns a const reference to the image palette.
void png::image< pixel >::set_palette | ( | palette const & | plte | ) | [inline] |
Replaces the image palette.
tRNS const& png::image< pixel >::get_tRNS | ( | ) | const [inline] |
tRNS& png::image< pixel >::get_tRNS | ( | ) | [inline] |
void png::image< pixel >::set_tRNS | ( | tRNS const & | trns | ) | [inline] |
image_info png::image< pixel >::m_info [protected] |
pixbuf png::image< pixel >::m_pixbuf [protected] |