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");
186 #endif // PNGPP_INFO_HPP_INCLUDED
png_struct * m_png
Definition: info_base.hpp:71
info(io_base &io, png_struct *png)
Definition: info.hpp:50
void sync_ihdr(void) const
Definition: info.hpp:170
Base class for PNG reader/writer classes.
Definition: io_base.hpp:62
Definition: types.hpp:104
void read()
Definition: info.hpp:55
Definition: types.hpp:103
filter_type m_filter_type
Definition: image_info.hpp:192
palette m_palette
Definition: image_info.hpp:193
void update()
Definition: info.hpp:160
Definition: types.hpp:100
uint_32 m_height
Definition: image_info.hpp:187
Holds information about PNG image.
Definition: image_info.hpp:47
void write() const
Definition: info.hpp:116
color_type m_color_type
Definition: image_info.hpp:189
double m_gamma
Definition: image_info.hpp:195
uint_32 m_width
Definition: image_info.hpp:186
png_byte byte
Definition: types.hpp:39
Holds information about PNG image. Adapter class for IO image operations.
Definition: info.hpp:45
tRNS m_tRNS
Definition: image_info.hpp:194
Internal class to hold PNG info or end_info.
Definition: info_base.hpp:46
png_info * m_info
Definition: info_base.hpp:72
Exception class to represent runtime errors related to png++ operation.
Definition: error.hpp:57
int m_bit_depth
Definition: image_info.hpp:188
compression_type m_compression_type
Definition: image_info.hpp:191
interlace_type m_interlace_type
Definition: image_info.hpp:190