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::Importer Class Reference

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

#include <importer.h>

Inheritance diagram for synfig::Importer:
bmp_mptr exr_mptr ffmpeg_mptr imagemagick_mptr Importer_LibAVCodec jpeg_mptr mplayer_mptr png_mptr ppm_mptr synfig::ListImporter

Classes

struct  BookEntry

Public Types

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

Public Member Functions

Gammagamma ()
const Gammagamma () const
virtual ~Importer ()
virtual bool get_frame (Surface &surface, const RendDesc &renddesc, Time time, ProgressCallback *callback=NULL)=0
 Gets a frame and puts it into surface.
virtual bool get_frame (Surface &surface, 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 Importer.

Public Attributes

const FileSystem::Identifier identifier

Static Public Attributes

static Bookbook_

Protected Member Functions

 Importer (const FileSystem::Identifier &identifier)

Detailed Description

Used for importing bitmaps of various formats, including animations.

It is the base class for all the importers. It defines the 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 Importer*(* synfig::Importer::Factory)(const FileSystem::Identifier &identifier)

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

typedef etl::handle<Importer> synfig::Importer::Handle
typedef etl::loose_handle<Importer> synfig::Importer::LooseHandle
typedef etl::handle<const Importer> synfig::Importer::ConstHandle

Constructor & Destructor Documentation

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

References __open_importers.

Member Function Documentation

Importer::Book & Importer::book ( )
static
bool Importer::subsys_init ( )
static

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

References __open_importers, and book_.

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

bool Importer::subsys_stop ( )
static

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

References __open_importers, and book_.

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

Gamma& synfig::Importer::gamma ( )
inline
const Gamma& synfig::Importer::gamma ( ) const
inline
virtual bool synfig::Importer::get_frame ( Surface surface,
const RendDesc renddesc,
Time  time,
ProgressCallback callback = NULL 
)
pure virtual

Gets a frame and puts it into surface.

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 ffmpeg_mptr, synfig::ListImporter, jpeg_mptr, png_mptr, imagemagick_mptr, Importer_LibAVCodec, bmp_mptr, exr_mptr, mplayer_mptr, and ppm_mptr.

Referenced by get_frame().

virtual bool synfig::Importer::get_frame ( Surface surface,
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::Importer::is_animated ( )
inlinevirtual

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

Reimplemented in ffmpeg_mptr, and synfig::ListImporter.

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

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

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

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

Member Data Documentation

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

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