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;
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;
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;
364 int transparent_color_index,
image& output );
366 void write(
unsigned int code );
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;
427 const image_descriptor&
id,
int transparent_color_index,
428 frame& the_frame )
const;
442 gif( std::istream& f );
466 #endif // __CLAW_GIF_HPP__