claw::graphic::gif Class Reference

A class for gif pictures. More...

`#include <gif.hpp>`

Inheritance diagram for claw::graphic::gif:

## Classes

class | frame
| One frame in the animation. More...
class | reader
| This class reads data from a gif file. The image is resized to the size of the screen (as defined in the gif file) and the frames are stored in a list of frames passed as parameter. More...

## Public Types

typedef wrapped_iterator< frame, frame_list::iterator, claw::dereference< frame > >::iterator_type | frame_iterator
| Iterator on the content of the gif.
typedef wrapped_iterator< constframe, frame_list::const_iterator, claw::const_dereference< frame > >::iterator_type | const_frame_iterator
| Iterator on the content of the gif.
Public Types inherited from claw::graphic::image
typedef rgba_pixel | pixel_type
| The type representing the colors of the pixels in the image.
typedef base_iterator< image, pixel_type > | iterator
| The type of the iterator on the pixels of the image.
typedef base_iterator< const image, const pixel_type > | const_iterator
| The type of the iterator to access constant pixels.

## Public Member Functions

| gif ()
| Constructor.
| gif (const gif &that)
| Copy constructor.
| gif (std::istream &f)
| Constructor. Load an image from a gif file.
| ~gif ()
| Destructor.
gif & | operator= (const gif &that)
| Assignment.
void | swap (gif &that)
| Swap the content of two gifs.
frame_iterator | frame_begin ()
| Get an iterator on the beginning of the frame sequence.
frame_iterator | frame_end ()
| Get an iterator on the end of the frame sequence.
const_frame_iterator | frame_begin () const
| Get an iterator on the beginning of the frame sequence.
const_frame_iterator | frame_end () const
| Get an iterator on the beginning of the frame sequence.
Public Member Functions inherited from claw::graphic::image
| image ()
| Constructor. Creates an image without datas.
| image (unsigned int w, unsigned int h)
| Constructor. Creates an empty image.
| image (std::istream &f)
| Constructor. Reads an image from an input stream.
void | swap (image &that)
| Swap the content of two images.
unsigned int | width () const
| Gets image's width.
unsigned int | height () const
| Gets image's height.
scanline & | operator[] (unsigned int i)
| Gets a line of the image.
const scanline & | operator[] (unsigned int i) const
| Gets a line of the image.
iterator | begin ()
| Get an iterator pointing on the first pixel.
iterator | end ()
| Get an iterator pointing just past the last pixel.
const_iterator | begin () const
| Get an iterator pointing on the first pixel.
const_iterator | end () const
| Get an iterator pointing just past the last pixel.
void | merge (const image &that)
| Merge an image on the current image.
void | merge (const image &that, const math::coordinate_2d< int > &pos)
| Merge an image on the current image.
void | partial_copy (const image &that, const math::coordinate_2d< int > &pos)
| Copy an image on the current image.
void | flip ()
| Set the image upside down.
void | fill (const math::rectangle< int > r, const pixel_type &c)
| Fill an area of the image with a given color.
void | set_size (unsigned int w, unsigned int h)
| Set a new size to the image.
void | load (std::istream &f)
| Read the image from a stream.

## Detailed Description

A class for gif pictures.

Author
  Julien Jorge

Definition at line 50 of file gif.hpp.

## Member Typedef Documentation

## const_frame_iterator

typedef wrapped_iterator<constframe,frame_list::const_iterator,claw::const_dereference<frame>>::iterator_type claw::graphic::gif::const_frame_iterator

Iterator on the content of the gif.

Definition at line 94 of file gif.hpp.

## frame_iterator

typedef wrapped_iterator<frame,frame_list::iterator,claw::dereference<frame>>::iterator_type claw::graphic::gif::frame_iterator

Iterator on the content of the gif.

Definition at line 88 of file gif.hpp.

## Constructor & Destructor Documentation

## gif() [1/3]

claw::graphic::gif::gif | ( |  | ) |

Constructor.

Definition at line 127 of file gif.cpp.

Referenced by gif(), operator=(), and swap().

## gif() [2/3]

claw::graphic::gif::gif | ( | const gif & | that | ) |

Copy constructor.

Parameters

  that | Image to copy from.

Definition at line 137 of file gif.cpp.

References gif(), and claw::graphic::image::image().

## gif() [3/3]

claw::graphic::gif::gif | ( | std::istream & | f | ) |

Constructor. Load an image from a gif file.

Parameters

  f | Gif file.

Definition at line 151 of file gif.cpp.

## ~gif()

claw::graphic::gif::~gif | ( |  | ) |

Destructor.

Definition at line 160 of file gif.cpp.

## Member Function Documentation

## frame_begin() [1/2]

claw::graphic::gif::frame_iterator claw::graphic::gif::frame_begin | ( |  | ) |

Get an iterator on the beginning of the frame sequence.

Definition at line 194 of file gif.cpp.

## frame_begin() [2/2]

claw::graphic::gif::const_frame_iterator claw::graphic::gif::frame_begin | ( |  | ) | const

Get an iterator on the beginning of the frame sequence.

Definition at line 212 of file gif.cpp.

## frame_end() [1/2]

claw::graphic::gif::frame_iterator claw::graphic::gif::frame_end | ( |  | ) |

Get an iterator on the end of the frame sequence.

Definition at line 203 of file gif.cpp.

## frame_end() [2/2]

claw::graphic::gif::const_frame_iterator claw::graphic::gif::frame_end | ( |  | ) | const

Get an iterator on the beginning of the frame sequence.

Definition at line 221 of file gif.cpp.

## operator=()

claw::graphic::gif & claw::graphic::gif::operator= | ( | const gif & | that | ) |

Assignment.

Parameters

  that | The gif to copy from.

Definition at line 172 of file gif.cpp.

References gif().

## swap()

void claw::graphic::gif::swap | ( | gif & | that | ) |

Swap the content of two gifs.

Parameters

  that | The gif to swap with.

Definition at line 184 of file gif.cpp.

References gif(), and claw::graphic::image::swap().

Referenced by std::swap().

The documentation for this class was generated from the following files:

- gif.hpp
- code/gif.cpp