synfig-core  1.0.3
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | List of all members
synfig::CairoImporter Class Reference

Used for importing bitmaps of various formats, including animations. More...

#include <cairoimporter.h>

Inheritance diagram for synfig::CairoImporter:
cairo_png_mptr synfig::CairoListImporter

Classes

struct  BookEntry

Public Types

typedef CairoImporter *(* Factory )(const FileSystem::Identifier &identifier)
typedef std::map< std::string,
BookEntry
Book
typedef etl::handle
< CairoImporter
Handle
typedef etl::loose_handle
< CairoImporter
LooseHandle
typedef etl::handle< const
CairoImporter
ConstHandle

Public Member Functions

Gammagamma ()
const Gammagamma () const
virtual ~CairoImporter ()
virtual bool get_frame (cairo_surface_t *&csurface, const RendDesc &renddesc, Time time, ProgressCallback *callback=NULL)=0
 Gets a frame and puts it into cairo_surface_t.
virtual bool get_frame (cairo_surface_t *&csurface, const RendDesc &renddesc, Time time, bool &trimmed __attribute__((unused)), unsigned int &width __attribute__((unused)), unsigned int &height __attribute__((unused)), unsigned int &top __attribute__((unused)), unsigned int &left __attribute__((unused)), ProgressCallback *callback=NULL)
virtual bool is_animated ()
 Returns true if the importer pays attention to the time parameter of get_frame()

Static Public Member Functions

static Bookbook ()
static bool subsys_init ()
static bool subsys_stop ()
static Handle open (const FileSystem::Identifier &identifier)
 Attempts to open filename, and returns a handle to the associated CairoImporter.

Public Attributes

const FileSystem::Identifier identifier

Static Public Attributes

static Bookbook_

Protected Member Functions

 CairoImporter (const FileSystem::Identifier &identifier)

Detailed Description

Used for importing bitmaps of various formats, including animations.

It is the base class for all the importers for CairoSurfaces. It has a static Book pointer class that is a map for the importers factory creators and the strings of the extension that the importer can understand. It allows to create the a pointer to a particular importer just by using the extension of the name of file to import. Also it creates a virtual member get_frame that must be declared in the inherited classes.

See Also
module.h \

Member Typedef Documentation

typedef CairoImporter*(* synfig::CairoImporter::Factory)(const FileSystem::Identifier &identifier)

Type that represents a pointer to a CairoImporter's constructor. As a pointer to the constructor, it represents a "factory" of importers.

Constructor & Destructor Documentation

CairoImporter::CairoImporter ( const FileSystem::Identifier identifier)
protected
CairoImporter::~CairoImporter ( )
virtual

References __open_cairoimporters.

Member Function Documentation

CairoImporter::Book & CairoImporter::book ( )
static

References book_.

Referenced by synfig::Main::Main().

bool CairoImporter::subsys_init ( )
static

Initializes the CairoImport module by creating a book of importers names and its creators and the list of open importers

References __open_cairoimporters, and book_.

Referenced by synfig::Main::Main().

bool CairoImporter::subsys_stop ( )
static

Stops the Import module by deleting the book and the list of open importers

References __open_cairoimporters, and book_.

Referenced by synfig::Main::Main(), and synfig::Main::~Main().

Gamma& synfig::CairoImporter::gamma ( )
inline
const Gamma& synfig::CairoImporter::gamma ( ) const
inline
virtual bool synfig::CairoImporter::get_frame ( cairo_surface_t *&  csurface,
const RendDesc renddesc,
Time  time,
ProgressCallback callback = NULL 
)
pure virtual

Gets a frame and puts it into cairo_surface_t.

Parameters
surfaceReference to surface to put frame into
timeFor animated importers, determines which frame to get. For static importers, this parameter is unused.
callbackPointer to callback class for progress, errors, etc.
Returns
true on success, false on error
See Also
ProgressCallback, Surface

Implemented in synfig::CairoListImporter, and cairo_png_mptr.

Referenced by get_frame().

virtual bool synfig::CairoImporter::get_frame ( cairo_surface_t *&  csurface,
const RendDesc renddesc,
Time  time,
bool &trimmed   __attribute__(unused),
unsigned int &width   __attribute__(unused),
unsigned int &height   __attribute__(unused),
unsigned int &top   __attribute__(unused),
unsigned int &left   __attribute__(unused),
ProgressCallback callback = NULL 
)
inlinevirtual

References get_frame().

virtual bool synfig::CairoImporter::is_animated ( )
inlinevirtual

Returns true if the importer pays attention to the time parameter of get_frame()

Reimplemented in synfig::CairoListImporter.

CairoImporter::Handle CairoImporter::open ( const FileSystem::Identifier identifier)
static

Attempts to open filename, and returns a handle to the associated CairoImporter.

References _, __open_cairoimporters, synfig::error(), synfig::FileSystem::Identifier::filename, and tolower.

Referenced by synfig::CairoListImporter::get_frame().

Member Data Documentation

CairoImporter::Book * synfig::CairoImporter::book_
static
const FileSystem::Identifier synfig::CairoImporter::identifier

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