31#ifndef PNGPP_INFO_HPP_INCLUDED
32#define PNGPP_INFO_HPP_INCLUDED
73 png_color* colors = 0;
79#ifdef PNG_tRNS_SUPPORTED
86 if (png_get_tRNS(
m_png,
m_info, & values, & count, NULL)
89 throw error(
"png_get_tRNS() failed");
91 m_tRNS.assign(values, values + count);
96#ifdef PNG_gAMA_SUPPORTED
99#ifdef PNG_FLOATING_POINT_SUPPORTED
102 throw error(
"png_get_gAMA() failed");
105 png_fixed_point gamma = 0;
106 if (png_get_gAMA_fixed(
m_png,
m_info, &gamma) != PNG_INFO_gAMA)
108 throw error(
"png_get_gAMA_fixed() failed");
132#ifdef PNG_tRNS_SUPPORTED
134 const_cast< byte*
>(&
m_tRNS[0]),
138 throw error(
"attempted to write tRNS chunk; recompile with PNG_tRNS_SUPPORTED");
145#ifdef PNG_gAMA_SUPPORTED
146#ifdef PNG_FLOATING_POINT_SUPPORTED
150 (png_fixed_point)(
m_gamma * 100000));
153 throw error(
"attempted to write gAMA chunk; recompile with PNG_gAMA_SUPPORTED");
Exception class to represent runtime errors related to png++ operation.
Definition: error.hpp:59
Holds information about PNG image.
Definition: image_info.hpp:48
color_type m_color_type
Definition: image_info.hpp:189
palette m_palette
Definition: image_info.hpp:193
uint_32 m_width
Definition: image_info.hpp:186
int m_bit_depth
Definition: image_info.hpp:188
double m_gamma
Definition: image_info.hpp:195
interlace_type m_interlace_type
Definition: image_info.hpp:190
filter_type m_filter_type
Definition: image_info.hpp:192
compression_type m_compression_type
Definition: image_info.hpp:191
uint_32 m_height
Definition: image_info.hpp:187
tRNS m_tRNS
Definition: image_info.hpp:194
Internal class to hold PNG info or end_info.
Definition: info_base.hpp:47
png_info * m_info
Definition: info_base.hpp:72
png_struct * m_png
Definition: info_base.hpp:71
Holds information about PNG image. Adapter class for IO image operations.
Definition: info.hpp:48
void write() const
Definition: info.hpp:116
void update()
Definition: info.hpp:160
info(io_base &io, png_struct *png)
Definition: info.hpp:50
void read()
Definition: info.hpp:55
void sync_ihdr(void) const
Definition: info.hpp:170
Base class for PNG reader/writer classes.
Definition: io_base.hpp:63
@ color_type_palette
Definition: types.hpp:50
@ chunk_gAMA
Definition: types.hpp:100
@ chunk_PLTE
Definition: types.hpp:103
@ chunk_tRNS
Definition: types.hpp:104
PNG color struct extension. Adds constructors.
Definition: color.hpp:44