30#ifndef __CLAW_GIF_HPP__
31#define __CLAW_GIF_HPP__
64 frame( std::size_t w, std::size_t h );
78 typedef std::list<frame*> frame_list;
93 frame_list::const_iterator,
111 struct screen_descriptor
114 bool has_global_color_table()
const;
115 unsigned int color_palette_size()
const;
136 struct image_descriptor
140 static const u_int_8 block_id = 0x2C;
143 bool has_color_table()
const;
144 bool is_interlaced()
const;
145 unsigned int color_palette_size()
const;
169 static const u_int_8 block_id = 0x21;
178 static const u_int_8 block_id = 0x3B;
184 struct graphic_control_extension
188 static const u_int_8 block_label = 0xF9;
199 dispose_do_not_dispose,
213 disposal_method get_disposal_method()
const;
214 bool has_transparent_color()
const;
235 struct comment_extension
239 static const u_int_8 block_label = 0xFE;
247 struct plain_text_extension
251 static const u_int_8 block_label = 0x01;
259 struct application_extension
263 static const u_int_8 block_label = 0xFF;
289 screen_descriptor sd;
292 palette_type* palette;
295 int transparent_color_index;
298 std::vector<graphic_control_extension::disposal_method>
307 input_buffer( std::istream& is,
u_int_8 code_size );
309 bool end_of_data()
const;
310 bool end_of_information()
const;
311 unsigned int symbols_count()
const;
312 unsigned int get_next();
315 void new_code(
unsigned int code );
325 std::istream& m_input;
336 std::size_t m_pending;
339 unsigned char m_pending_bits;
342 std::size_t m_pending_end;
348 const unsigned int m_initial_code_size;
351 unsigned int m_code_size;
354 unsigned int m_code_limit;
363 (
const palette_type& p,
const image_descriptor&
id,
364 int transparent_color_index,
image& output );
366 void write(
unsigned int code );
370 const palette_type& m_palette;
373 const image_descriptor& m_id;
376 const int m_transparent_color_index;
388 int m_interlace_pass;
391 int m_interlace_step;
401 reader( frame_list& frames, std::istream& f );
402 reader(
image& img, frame_list& frames, std::istream& f );
405 void load( std::istream& f );
409 void inside_load( std::istream& f );
410 void make_frames(
const reader_info& info );
411 void fill_background(
image& img,
const reader_info& info )
const;
413 void check_if_gif( std::istream& f )
const;
414 void read_screen_descriptor( std::istream& f, reader_info& info );
416 void read_palette( std::istream& f, palette_type& p )
const;
417 void read_data( std::istream& f, reader_info& info );
418 void read_frame( std::istream& f, reader_info& info );
419 void read_frame_with_gce( std::istream& f, reader_info& info );
421 void skip_extension( std::istream& f )
const;
423 ( std::istream& f,
const reader_info& info,
frame& the_frame )
const;
426 ( std::istream& f,
const palette_type& palette,
427 const image_descriptor&
id,
int transparent_color_index,
428 frame& the_frame )
const;
442 gif( std::istream& f );
Function object that dereferences a constant pointer.
Function object that dereferences a pointer.
A palette of colors, for palettized images.
One frame in the animation.
unsigned int get_delay() const
Get the time duration of this frame.
image super
The type of the parent class.
void set_delay(unsigned int d)
Set the time duration of this frame.
reader(image &img)
Constructor.
void load(std::istream &f)
Load the image data from a stream.
A class for gif pictures.
frame_iterator frame_end()
Get an iterator on the end of the frame sequence.
void swap(gif &that)
Swap the content of two gifs.
gif & operator=(const gif &that)
Assignment.
wrapped_iterator< frame, frame_list::iterator, claw::dereference< frame > >::iterator_type frame_iterator
Iterator on the content of the gif.
wrapped_iterator< constframe, frame_list::const_iterator, claw::const_dereference< frame > >::iterator_type const_frame_iterator
Iterator on the content of the gif.
frame_iterator frame_begin()
Get an iterator on the beginning of the frame sequence.
unsigned int height() const
Gets image's height.
unsigned int width() const
Gets image's width.
image()
Constructor. Creates an image without datas.
A class to help decoding a stream encoded with Lempel-Ziv-Welch (LZW) compression algorithm.
This class defines an iterator resulting of the appliance of a function to an effective iterator.
A palette of color, for palettized images.
Some function object classes.
A class to deal with images.
Some special kind of iterators. As an example: iterator on the keys of a map.
A class to help decoding a stream encoded with Lempel-Ziv-Welch (LZW) compression algorithm.
Everything about image structures and processing.
This is the main namespace.
unsigned_integer_of_size< 16 >::type u_int_16
An unsigned integer on 16 bits.
unsigned_integer_of_size< 8 >::type u_int_8
An unsigned integer on 8 bits.
Some classes for the raw manipulation of the base types.