30#ifndef __CLAW_PNG_HPP__
31#define __CLAW_PNG_HPP__
69 void read(png_bytep data, png_size_t length);
73 std::istream& m_input;
81 void load(std::istream& f);
84 void read_from_file(std::istream& f);
85 void check_if_png(png_structp png_ptr, std::istream& f)
const;
87 void read_image(png_structp png_ptr, png_infop info_ptr);
88 void read_sequential_image(png_structp png_ptr, png_infop info_ptr);
89 void read_interlaced_image(png_structp png_ptr, png_infop info_ptr,
92 void copy_pixel_line(png_byte color_type, png_bytep data,
95 void create_read_structures(png_structp& png_ptr,
96 png_infop& info_ptr)
const;
104 static const unsigned int s_rgba_pixel_size;
124 no_compression = Z_NO_COMPRESSION,
125 best_speed = Z_BEST_SPEED,
126 best_compression = Z_BEST_COMPRESSION,
127 default_compression = Z_DEFAULT_COMPRESSION
166 void write(png_bytep data, png_size_t length);
171 std::ostream& m_output;
183 void set_options(png_structp png_ptr, png_infop info_ptr,
185 void save_image(png_structp png_ptr, png_infop info_ptr)
const;
187 void copy_pixel_line(png_bytep data,
unsigned int y)
const;
189 void create_write_structures(png_structp& png_ptr,
190 png_infop& info_ptr)
const;
194 const image& m_image;
198 static const unsigned int s_rgba_pixel_size;
203 png(
unsigned int w,
unsigned int h);
205 png(std::istream& f);
207 void save(std::ostream& os,
image()
Constructor. Creates an image without datas.
void load(std::istream &f)
Load an image from a png file.
reader(image &img)
Constructor.
void save(std::ostream &f, const options &opt=options()) const
Save the image in a PNG file.
writer(const image &img)
Constructor.
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.
Everything about image structures and processing.
This is the main namespace.
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.
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.