30#ifndef __CLAW_PNG_HPP__
31#define __CLAW_PNG_HPP__
70 void read( png_bytep data, png_size_t length );
74 std::istream& m_input;
82 void load( std::istream& f );
85 void read_from_file( std::istream& f );
86 void check_if_png( png_structp png_ptr, std::istream& f )
const;
88 void read_image( png_structp png_ptr, png_infop info_ptr );
89 void read_sequential_image( png_structp png_ptr, png_infop info_ptr );
90 void read_interlaced_image( png_structp png_ptr, png_infop info_ptr,
91 unsigned int passes );
94 ( png_byte color_type, png_bytep data,
unsigned int y );
96 void create_read_structures( png_structp& png_ptr,
97 png_infop& info_ptr )
const;
106 static const unsigned int s_rgba_pixel_size;
127 no_compression = Z_NO_COMPRESSION,
128 best_speed = Z_BEST_SPEED,
129 best_compression = Z_BEST_COMPRESSION,
130 default_compression = Z_DEFAULT_COMPRESSION
141 adam7 = PNG_INTERLACE_ADAM7
170 void write( png_bytep data, png_size_t length );
175 std::ostream& m_output;
187 void set_options( png_structp png_ptr, png_infop info_ptr,
189 void save_image( png_structp png_ptr, png_infop info_ptr )
const;
191 void copy_pixel_line( png_bytep data,
unsigned int y )
const;
193 void create_write_structures( png_structp& png_ptr,
194 png_infop& info_ptr )
const;
199 const image& m_image;
203 static const unsigned int s_rgba_pixel_size;
208 png(
unsigned int w,
unsigned int h );
210 png( std::istream& f );
212 void save( std::ostream& os,
A class to deal with images.
This class read data from a png file and store it in an image.
void load(std::istream &f)
Load an image from a png file.
reader(image &img)
Constructor.
This class write an image in a png file.
void save(std::ostream &f, const options &opt=options()) const
Save the image in a PNG file.
writer(const image &img)
Constructor.
A class for png pictures.
png(unsigned int w, unsigned int h)
Constructor. Creates an empty image.
void save(std::ostream &os, const writer::options &opt=writer::options()) const
Save the image.
A class to deal with images.
This is the main namespace.
Source manager that allow us to read from a std::istream.
void read(png_bytep data, png_size_t length)
Read data from the input stream.
source_manager(std::istream &is)
Constructor.
Parameters of the writing algorithm.
compression_level compression
Compression level to use in the saved stream.
interlace_type interlace
Interlace method to apply to the saved image.
interlace_type
The algorithm to use to interlace the saved image.
@ none
Saved image won't be interaced.
@ adam7
Saved image will be interlaced using the Adam7 algorithm.
compression_level
Compression level in the interlaced image.
options()
Default constructor.
Target manager that allow us to write in a std::ostream.
void flush()
Flush the output stream.
void write(png_bytep data, png_size_t length)
Write data in the ouput stream.
target_manager(std::ostream &os)
Constructor.