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 );
466 #endif // __CLAW_GIF_HPP__ wrapped_iterator< frame, frame_list::iterator, claw::dereference< frame > >::iterator_type frame_iterator
Iterator on the content of the gif.
This class reads data from a gif file. The image is resized to the size of the screen (as defined in ...
gif & operator=(const gif &that)
Assignment.
wrapped_iterator< const frame, frame_list::const_iterator, claw::const_dereference< frame > >::iterator_type const_frame_iterator
Iterator on the content of the gif.
One frame in the animation.
unsigned int get_delay() const
Get the time duration of this frame.
unsigned int height() const
Gets image's height.
image super
The type of the parent class.
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.
A class to help decoding a stream encoded with Lempel-Ziv-Welch (LZW) compression algorithm...
A palette of color, for palettized images.
frame_iterator frame_begin()
Get an iterator on the beginning of the frame sequence.
void swap(image &that)
Swap the content of two images.
frame_iterator frame_end()
Get an iterator on the end of the frame sequence.
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...
void load(std::istream &f)
Read the image from a stream.
unsigned_integer_of_size< 16 >::type u_int_16
An unsigned integer on 16 bits.
A palette of colors, for palettized images.
Function object that dereferences a pointer.
unsigned int width() const
Gets image's width.
A class for gif pictures.
Function object that dereferences a constant pointer.
void set_delay(unsigned int d)
Set the time duration of this frame.
A class to deal with images.
Some special kind of iterators. As an example: iterator on the keys of a map.
This is the main namespace.
Some function object classes.
A class to deal with images.