30 #ifndef __CLAW_JPEG_HPP__ 31 #define __CLAW_JPEG_HPP__ 65 struct jpeg_error_mgr
pub;
95 boolean fill_input_buffer();
96 void skip_input_data(
long num_bytes);
100 struct jpeg_source_mgr
pub;
104 std::istream& m_input;
107 const JOCTET* m_buffer;
110 const unsigned int m_buffer_size;
113 unsigned int m_stream_size;
116 unsigned int m_stream_position;
135 class grayscale_to_pixel32
145 void load( std::istream& f );
148 template<
class Convert>
149 void read_data( jpeg_decompress_struct& cinfo,
150 const Convert& pixel_convert );
152 void read_from_file( std::istream& f );
153 void decompress( std::istream& f, jpeg_decompress_struct& cinfo );
155 void create_decompress_info( jpeg_decompress_struct& cinfo,
178 options(
unsigned char compression_quality_,
bool progressive_ );
207 struct jpeg_destination_mgr
pub;
211 std::ostream& m_output;
217 const unsigned int m_buffer_size;
229 void set_options( jpeg_compress_struct& cinfo,
231 void save_image( jpeg_compress_struct& cinfo )
const;
233 void copy_pixel_line( JSAMPLE* data,
unsigned int y )
const;
235 void create_compress_info( jpeg_compress_struct& cinfo,
240 const image& m_image;
244 static const unsigned int s_rgb_pixel_size;
249 jpeg(
unsigned int w,
unsigned int h );
251 jpeg( std::istream& f );
253 void save( std::ostream& os,
260 #include <claw/impl/jpeg_reader.tpp> 262 #endif // __CLAW_JPEG_HPP__ unsigned char quality
Quality level to use in the saved stream.
void save(std::ostream &os, const writer::options &opt=writer::options()) const
Save the image.
jpeg(unsigned int w, unsigned int h)
Constructor. Creates an empty image.
struct jpeg_error_mgr pub
"public" fields, needed by the jpeg library.
std::string error_string
A comprehensive description of the error.
Destination manager that allow us to write in a std::ostream.
bool progressive
Tell if we save a progressive jpeg.
jmp_buf setjmp_buffer
For return to caller.
void load(std::istream &f)
Read the image from a stream.
This class write an image in a jpeg file.
This class read data from a jpeg file and store it in an image.
Error handler that throw an exception instead of exiting the program.
Parameters of the writing algorithm.
Source manager that allow us to read from a std::istream.
A class for jpeg pictures.
A class to deal with images.
This is the main namespace.
A class to deal with images.