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 );
93 void copy_pixel_line( png_bytep data,
unsigned int y );
95 void create_read_structures( png_structp& png_ptr,
96 png_infop& info_ptr )
const;
105 static const unsigned int s_rgba_pixel_size;
126 no_compression = Z_NO_COMPRESSION,
127 best_speed = Z_BEST_SPEED,
128 best_compression = Z_BEST_COMPRESSION,
129 default_compression = Z_DEFAULT_COMPRESSION
169 void write( png_bytep data, png_size_t length );
174 std::ostream& m_output;
186 void set_options( png_structp png_ptr, png_infop info_ptr,
188 void save_image( png_structp png_ptr, png_infop info_ptr )
const;
190 void copy_pixel_line( png_bytep data,
unsigned int y )
const;
192 void create_write_structures( png_structp& png_ptr,
193 png_infop& info_ptr )
const;
198 const image& m_image;
202 static const unsigned int s_rgba_pixel_size;
207 png(
unsigned int w,
unsigned int h );
209 png( std::istream& f );
211 void save( std::ostream& os,
218 #endif // __CLAW_PNG_HPP__
A class for png pictures.
compression_level
Compression level in the interlaced image.
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.
Source manager that allow us to read from a std::istream.
options()
Default constructor.
interlace_type
The algorithm to use to interlace the saved image.
void write(png_bytep data, png_size_t length)
Write data in the ouput stream.
Saved image won't be interaced.
Saved image will be interlaced using the Adam7 algorithm.
void save(std::ostream &f, const options &opt=options()) const
Save the image in a PNG file.
Target manager that allow us to write in a std::ostream.
void read(png_bytep data, png_size_t length)
Read data from the input stream.
void save(std::ostream &os, const writer::options &opt=writer::options()) const
Save the image.
writer(const image &img)
Constructor.
reader(image &img)
Constructor.
source_manager(std::istream &is)
Constructor.
void flush()
Flush the output stream.
This class write an image in a png file.
compression_level compression
Compression level to use in the saved stream.
target_manager(std::ostream &os)
Constructor.
interlace_type interlace
Interlace method to apply to the saved image.
A class to deal with images.
This is the main namespace.
Parameters of the writing algorithm.
png(unsigned int w, unsigned int h)
Constructor. Creates an empty image.
A class to deal with images.