30#ifndef __CLAW_GIF_HPP__
31#define __CLAW_GIF_HPP__
63 frame(std::size_t w, std::size_t h);
77 typedef std::list<frame*> frame_list;
109 struct screen_descriptor
112 bool has_global_color_table()
const;
113 unsigned int color_palette_size()
const;
134 struct image_descriptor
138 static const u_int_8 block_id = 0x2C;
141 bool has_color_table()
const;
142 bool is_interlaced()
const;
143 unsigned int color_palette_size()
const;
167 static const u_int_8 block_id = 0x21;
176 static const u_int_8 block_id = 0x3B;
182 struct graphic_control_extension
186 static const u_int_8 block_label = 0xF9;
197 dispose_do_not_dispose,
211 disposal_method get_disposal_method()
const;
212 bool has_transparent_color()
const;
233 struct comment_extension
237 static const u_int_8 block_label = 0xFE;
245 struct plain_text_extension
249 static const u_int_8 block_label = 0x01;
257 struct application_extension
261 static const u_int_8 block_label = 0xFF;
286 screen_descriptor sd;
289 palette_type* palette;
293 int transparent_color_index;
296 std::vector<graphic_control_extension::disposal_method>
305 input_buffer(std::istream& is,
u_int_8 code_size);
307 bool end_of_data()
const;
308 bool end_of_information()
const;
309 unsigned int symbols_count()
const;
310 unsigned int get_next();
313 void new_code(
unsigned int code);
323 std::istream& m_input;
334 std::size_t m_pending;
337 unsigned char m_pending_bits;
340 std::size_t m_pending_end;
346 const unsigned int m_initial_code_size;
349 unsigned int m_code_size;
352 unsigned int m_code_limit;
360 output_buffer(
const palette_type& p,
const image_descriptor&
id,
361 int transparent_color_index,
image& output);
363 void write(
unsigned int code);
367 const palette_type& m_palette;
370 const image_descriptor& m_id;
373 const int m_transparent_color_index;
385 int m_interlace_pass;
388 int m_interlace_step;
398 reader(frame_list& frames, std::istream& f);
399 reader(
image& img, frame_list& frames, std::istream& f);
402 void load(std::istream& f);
406 void inside_load(std::istream& f);
407 void make_frames(
const reader_info& info);
408 void fill_background(
image& img,
const reader_info& info)
const;
410 void check_if_gif(std::istream& f)
const;
411 void read_screen_descriptor(std::istream& f, reader_info& info);
413 void read_palette(std::istream& f, palette_type& p)
const;
414 void read_data(std::istream& f, reader_info& info);
415 void read_frame(std::istream& f, reader_info& info);
416 void read_frame_with_gce(std::istream& f, reader_info& info);
418 void skip_extension(std::istream& f)
const;
419 void read_frame_data(std::istream& f,
const reader_info& info,
420 frame& the_frame)
const;
422 void decode_data(std::istream& f,
const palette_type& palette,
423 const image_descriptor&
id,
424 int transparent_color_index,
frame& the_frame)
const;
438 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.