png++: png::io_base Class Reference

png++ 0.2.10

Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
png::io_base Class Reference

Base class for PNG reader/writer classes. More...

`#include <io_base.hpp>`

Inheritance diagram for png::io_base:

## Public Member Functions
| io_base (png_struct *png)
| ~io_base ()
png_struct * | get_png_struct () const
info & | get_info ()
info const & | get_info () const
image_info const & | get_image_info () const
void | set_image_info (image_info const &info)
end_info & | get_end_info ()
end_info const & | get_end_info () const
uint_32 | get_width () const
void | set_width (uint_32 width)
uint_32 | get_height () const
void | set_height (uint_32 height)
color_type | get_color_type () const
void | set_color_type (color_type color_space)
int | get_bit_depth () const
void | set_bit_depth (int bit_depth)
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)
bool | has_chunk (chunk id)
void | set_gray_1_2_4_to_8 () const
void | set_palette_to_rgb () const
void | set_tRNS_to_alpha () const
void | set_bgr () const
void | set_gray_to_rgb () const
void | set_rgb_to_gray (rgb_to_gray_error_action error_action=rgb_to_gray_silent, double red_weight=-1.0, double green_weight=-1.0) const
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_strip_alpha () const
void | set_swap_alpha () const
void | set_invert_alpha () const
void | set_filler (uint_32 filler, filler_type type) const
void | set_add_alpha (uint_32 filler, filler_type type) const
void | set_swap () const
void | set_packing () const
void | set_packswap () const
void | set_shift (byte red_bits, byte green_bits, byte blue_bits, byte alpha_bits=0) const
void | set_shift (byte gray_bits, byte alpha_bits=0) const
int | set_interlace_handling () const
void | set_invert_mono () const
void | set_strip_16 () const
void | set_read_user_transform (png_user_transform_ptr transform_fn)
void | set_user_transform_info (void *info, int bit_depth, int channels)

## Protected Member Functions
void * | get_io_ptr () const
void | set_error (char const *message)
void | reset_error ()
bool | is_error () const
void | raise_error ()

## Static Protected Member Functions
static void | raise_error (png_struct *png, char const *message)

## Protected Attributes
png_struct * | m_png
info | m_info
end_info | m_end_info
std::string | m_error

## Detailed Description

Base class for PNG reader/writer classes.

See also
  reader, writer

## Constructor & Destructor Documentation

## ◆ io_base()

png::io_base::io_base | ( | png_struct * | png | ) |
| inlineexplicit

## ◆ ~io_base()

png::io_base::~io_base | ( |  | ) |
| inline

References png::info_base::get_png_info(), m_end_info, m_info, and m_png.

## Member Function Documentation

## ◆ get_png_struct()

png_struct* png::io_base::get_png_struct | ( |  | ) | const
| inline

References m_png.

## ◆ get_info() [1/2]

info& png::io_base::get_info | ( |  | ) |
| inline

References m_info.

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

## ◆ get_info() [2/2]

info const& png::io_base::get_info | ( |  | ) | const
| inline

References m_info.

## ◆ get_image_info()

image_info const& png::io_base::get_image_info | ( |  | ) | const
| inline

References m_info.

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

## ◆ set_image_info()

void png::io_base::set_image_info | ( | image_info const & | info | ) |
| inline

References m_info.

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

## ◆ get_end_info() [1/2]

end_info& png::io_base::get_end_info | ( |  | ) |
| inline

References m_end_info.

## ◆ get_end_info() [2/2]

end_info const& png::io_base::get_end_info | ( |  | ) | const
| inline

References m_end_info.

## ◆ get_width()

uint_32 png::io_base::get_width | ( |  | ) | const
| inline

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

## ◆ set_width()

void png::io_base::set_width | ( | uint_32 | width | ) |
| inline

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

## ◆ get_height()

uint_32 png::io_base::get_height | ( |  | ) | const
| inline

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

## ◆ set_height()

void png::io_base::set_height | ( | uint_32 | height | ) |
| inline

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

## ◆ get_color_type()

color_type png::io_base::get_color_type | ( |  | ) | const
| inline

References png::image_info::get_color_type(), and 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()(), png::consumer< pixel, pixel_consumer, image_info_ref_holder, true >::read(), and set_shift().

## ◆ set_color_type()

void png::io_base::set_color_type | ( | color_type | color_space | ) |
| inline

References m_info, and png::image_info::set_color_type().

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

## ◆ get_bit_depth()

int png::io_base::get_bit_depth | ( |  | ) | const
| inline

References png::image_info::get_bit_depth(), and 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::detail::convert_color_space_impl< rgb_pixel >::handle_palette(), png::require_color_space< pixel >::operator()(), and png::consumer< pixel, pixel_consumer, image_info_ref_holder, true >::read().

## ◆ set_bit_depth()

void png::io_base::set_bit_depth | ( | int | bit_depth | ) |
| inline

References m_info, and png::image_info::set_bit_depth().

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

## ◆ get_interlace_type()

interlace_type png::io_base::get_interlace_type | ( |  | ) | const
| inline

References png::image_info::get_interlace_type(), and m_info.

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

## ◆ set_interlace_type()

void png::io_base::set_interlace_type | ( | interlace_type | interlace | ) |
| inline

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

## ◆ get_compression_type()

compression_type png::io_base::get_compression_type | ( |  | ) | const
| inline

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

## ◆ set_compression_type()

void png::io_base::set_compression_type | ( | compression_type | compression | ) |
| inline

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

## ◆ get_filter_type()

filter_type png::io_base::get_filter_type | ( |  | ) | const
| inline

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

## ◆ set_filter_type()

void png::io_base::set_filter_type | ( | filter_type | filter | ) |
| inline

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

## ◆ has_chunk()

bool png::io_base::has_chunk | ( | chunk | id | ) |
| inline

References png::info_base::get_png_info(), m_info, and m_png.

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

## ◆ set_gray_1_2_4_to_8()

void png::io_base::set_gray_1_2_4_to_8 | ( |  | ) | const
| inline

References m_png.

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

## ◆ set_palette_to_rgb()

void png::io_base::set_palette_to_rgb | ( |  | ) | const
| inline

References m_png.

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

## ◆ set_tRNS_to_alpha()

void png::io_base::set_tRNS_to_alpha | ( |  | ) | const
| inline

References m_png.

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

## ◆ set_bgr()

void png::io_base::set_bgr | ( |  | ) | const
| inline

References m_png.

## ◆ set_gray_to_rgb()

void png::io_base::set_gray_to_rgb | ( |  | ) | const
| inline

References m_png.

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

## ◆ set_rgb_to_gray() [1/2]

void png::io_base::set_rgb_to_gray | ( | rgb_to_gray_error_action | error_action = `rgb_to_gray_silent`,
|  | double | red_weight = `-1.0`,
|  | double | green_weight = `-1.0`
| ) |  | const
| inline

References m_png.

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

## ◆ set_rgb_to_gray() [2/2]

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
| inline

References m_png.

## ◆ set_strip_alpha()

void png::io_base::set_strip_alpha | ( |  | ) | const
| inline

References m_png.

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

## ◆ set_swap_alpha()

void png::io_base::set_swap_alpha | ( |  | ) | const
| inline

References m_png.

## ◆ set_invert_alpha()

void png::io_base::set_invert_alpha | ( |  | ) | const
| inline

References m_png.

## ◆ set_filler()

void png::io_base::set_filler | ( | uint_32 | filler,
|  | filler_type | type
| ) |  | const
| inline

References m_png.

## ◆ set_add_alpha()

void png::io_base::set_add_alpha | ( | uint_32 | filler,
|  | filler_type | type
| ) |  | const
| inline

References m_png.

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

## ◆ set_swap()

void png::io_base::set_swap | ( |  | ) | const
| inline

References m_png.

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

## ◆ set_packing()

void png::io_base::set_packing | ( |  | ) | const
| inline

References m_png.

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

## ◆ set_packswap()

void png::io_base::set_packswap | ( |  | ) | const
| inline

References m_png.

## ◆ set_shift() [1/2]

void png::io_base::set_shift | ( | byte | red_bits,
|  | byte | green_bits,
|  | byte | blue_bits,
|  | byte | alpha_bits = `0`
| ) |  | const
| inline

References png::color_type_rgb, png::color_type_rgb_alpha, get_color_type(), and m_png.

## ◆ set_shift() [2/2]

void png::io_base::set_shift | ( | byte | gray_bits,
|  | byte | alpha_bits = `0`
| ) |  | const
| inline

References png::color_type_gray, png::color_type_gray_alpha, get_color_type(), and m_png.

## ◆ set_interlace_handling()

int png::io_base::set_interlace_handling | ( |  | ) | const
| inline

References m_png.

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

## ◆ set_invert_mono()

void png::io_base::set_invert_mono | ( |  | ) | const
| inline

References m_png.

## ◆ set_strip_16()

void png::io_base::set_strip_16 | ( |  | ) | const
| inline

References m_png.

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

## ◆ set_read_user_transform()

void png::io_base::set_read_user_transform | ( | png_user_transform_ptr | transform_fn | ) |
| inline

References m_png.

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

## ◆ set_user_transform_info()

void png::io_base::set_user_transform_info | ( | void * | info,
|  | int | bit_depth,
|  | int | channels
| ) |  |
| inline

References m_png.

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

## ◆ get_io_ptr()

void* png::io_base::get_io_ptr | ( |  | ) | const
| inlineprotected

References m_png.

## ◆ set_error()

void png::io_base::set_error | ( | char const * | message | ) |
| inlineprotected

References m_error.

Referenced by raise_error().

## ◆ reset_error()

void png::io_base::reset_error | ( |  | ) |
| inlineprotected

References m_error.

## ◆ is_error()

bool png::io_base::is_error | ( |  | ) | const
| inlineprotected

References m_error.

## ◆ raise_error() [1/2]

void png::io_base::raise_error | ( |  | ) |
| inlineprotected

References m_png.

Referenced by raise_error().

## ◆ raise_error() [2/2]

static void png::io_base::raise_error | ( | png_struct * | png,
|  | char const * | message
| ) |  |
| inlinestaticprotected

References raise_error(), and set_error().

## Member Data Documentation

## ◆ m_png

png_struct* png::io_base::m_png
| protected

Referenced by get_io_ptr(), get_png_struct(), has_chunk(), 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(), set_add_alpha(), set_bgr(), set_filler(), set_gray_1_2_4_to_8(), set_gray_to_rgb(), set_interlace_handling(), set_invert_alpha(), set_invert_mono(), set_packing(), set_packswap(), set_palette_to_rgb(), set_read_user_transform(), set_rgb_to_gray(), set_shift(), set_strip_16(), set_strip_alpha(), set_swap(), set_swap_alpha(), set_tRNS_to_alpha(), set_user_transform_info(), 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(), ~io_base(), png::reader< istream >::~reader(), and png::writer< ostream >::~writer().

## ◆ m_info

info png::io_base::m_info
| protected

Referenced by get_bit_depth(), get_color_type(), get_compression_type(), get_filter_type(), get_height(), get_image_info(), get_info(), get_interlace_type(), get_width(), has_chunk(), png::reader< istream >::read_info(), png::reader< istream >::read_png(), set_bit_depth(), set_color_type(), set_compression_type(), set_filter_type(), set_height(), set_image_info(), set_interlace_type(), set_width(), png::reader< istream >::update_info(), png::writer< ostream >::write_info(), png::writer< ostream >::write_png(), ~io_base(), png::reader< istream >::~reader(), and png::writer< ostream >::~writer().

## ◆ m_end_info

end_info png::io_base::m_end_info
| protected

Referenced by get_end_info(), png::reader< istream >::read_end_info(), png::writer< ostream >::write_end_info(), ~io_base(), png::reader< istream >::~reader(), and png::writer< ostream >::~writer().

## ◆ m_error

std::string png::io_base::m_error
| protected

Referenced by is_error(), png::reader< istream >::read_end_info(), png::reader< istream >::read_info(), png::reader< istream >::read_png(), png::reader< istream >::read_row(), reset_error(), set_error(), png::writer< ostream >::write_end_info(), png::writer< ostream >::write_info(), png::writer< ostream >::write_png(), and png::writer< ostream >::write_row().

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

- io_base.hpp