CLAW Library (a C++ Library Absolutely Wonderful) 1.5.5
Classes | Public Types | Public Member Functions | Private Types | Private Attributes

claw::graphic::gif Class Reference

A class for gif pictures. More...

#include <gif.hpp>

Inheritance diagram for claw::graphic::gif:
claw::graphic::image

List of all members.

Classes

struct  application_extension
 Extension adding some informations about the application. More...
struct  comment_extension
 Extension commenting the file. More...
struct  extension
 Extension of the format. More...
class  frame
 One frame in the animation. More...
struct  graphic_control_extension
 Extension describing a rendering block. More...
struct  header
 Header of the gif files. More...
struct  image_descriptor
struct  plain_text_extension
 Extension adding graphic text support. 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...
struct  screen_descriptor
 Some informations on the screen where the image is rendered. More...
struct  trailer
 The end of the file. 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
< const frame,
frame_list::const_iterator,
claw::const_dereference< frame >
>::iterator_type 
const_frame_iterator
 Iterator on the content of the gif.

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.
gifoperator= (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.

Private Types

typedef std::list< frame * > frame_list
 A list of frame stored in the gif.
typedef image super
 The type of the parent class.

Private Attributes

frame_list m_frame
 The list of frames in the animation.

Detailed Description

A class for gif pictures.

Author:
Julien Jorge

Definition at line 50 of file gif.hpp.


Member Typedef Documentation

typedef wrapped_iterator< const frame, 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.

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.

typedef std::list<frame*> claw::graphic::gif::frame_list [private]

A list of frame stored in the gif.

Definition at line 78 of file gif.hpp.

typedef image claw::graphic::gif::super [private]

The type of the parent class.

Definition at line 81 of file gif.hpp.


Constructor & Destructor Documentation

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

Constructor.

Definition at line 127 of file gif.cpp.

{

} // gif::gif() [copy constructor]
claw::graphic::gif::gif ( const gif that)

Copy constructor.

Parameters:
thatImage to copy from.

Definition at line 137 of file gif.cpp.

References m_frame.

  : image(that)
{
  frame_list::const_iterator it;

  for (it=that.m_frame.begin(); it!=that.m_frame.end(); ++it)
    m_frame.push_back( new frame(**it) );
} // gif::gif() [copy constructor]
claw::graphic::gif::gif ( std::istream &  f)

Constructor. Load an image from a gif file.

Parameters:
fGif file.

Definition at line 151 of file gif.cpp.

{
  reader(*this, m_frame, f);
} // gif::gif() [constructor, from file]
claw::graphic::gif::~gif ( )

Destructor.

Definition at line 160 of file gif.cpp.

{
  std::for_each
    ( m_frame.begin(), m_frame.end(), claw::delete_function<frame*>() );
  m_frame.clear();
} // gif::~gif()

Member Function Documentation

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.

{
  return frame_iterator(m_frame.begin());
} // gif::begin()
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.

{
  return const_frame_iterator(m_frame.begin());
} // gif::begin()
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.

{
  return frame_iterator(m_frame.end());
} // gif::end()
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.

{
  return const_frame_iterator(m_frame.end());
} // gif::end()
claw::graphic::gif & claw::graphic::gif::operator= ( const gif that)

Assignment.

Parameters:
thatThe gif to copy from.

Definition at line 172 of file gif.cpp.

References std::swap().

{
  gif tmp(that);
  std::swap(tmp, *this);
  return *this;
} // gif::operator=()
void claw::graphic::gif::swap ( gif that)

Swap the content of two gifs.

Parameters:
thatThe gif to swap with.

Definition at line 184 of file gif.cpp.

References m_frame, and std::swap().

Referenced by claw::graphic::gif::reader::make_frames(), and std::swap().

{
  super::swap(that);
  std::swap(m_frame, that.m_frame);
} // gif::swap()

Member Data Documentation


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