# synfig::Importer Class Reference

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

`#include <importer.h>`

Inheritance diagram for synfig::Importer:

List of all members.

## Public Types

typedef Importer *(* | Factory )(const char *filename)
typedef std::map< String, Factory > | Book
typedef etl::handle< Importer > | Handle
typedef etl::loose_handle < Importer > | LooseHandle
typedef etl::handle< const Importer > | ConstHandle

## Public Member Functions

Gamma & | gamma ()
const Gamma & | gamma () const
virtual | ~Importer ()
virtual bool | get_frame (Surface &surface, Time time, ProgressCallback *callback=NULL)=0
| Gets a frame and puts it into surface.
virtual bool | get_frame (Surface &surface, 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 Book & | book ()
static bool | subsys_init ()
static bool | subsys_stop ()
static Handle | open (const String &filename)
| Attempts to open filename, and returns a handle to the associated Importer.

## Static Public Attributes

static Book * | book_

## Protected Member Functions

| Importer ()

## Detailed Description

Used for importing bitmaps of various formats, including animations.

Todo:
  Write more detailed description

## Member Typedef Documentation

typedef Importer*(* synfig::Importer::Factory)(const char *filename)

typedef std::map<String,Factory> synfig::Importer::Book

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 | ( |  | ) | `[protected]`

Importer::~Importer | ( |  | ) | `[virtual]`

References __open_importers.

## Member Function Documentation

Importer::Book & Importer::book | ( |  | ) | `[static]`

References book_.

Referenced by synfig::Main::Main(), open(), and process_global_flags().

bool Importer::subsys_init | ( |  | ) | `[static]`

References __open_importers, and book_.

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

bool Importer::subsys_stop | ( |  | ) | `[static]`

References __open_importers, and book_.

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

Gamma& synfig::Importer::gamma | ( |  | ) | `[inline]`

Referenced by ppm_mptr::get_frame(), imagemagick_mptr::get_frame(), bmp_mptr::get_frame(), jpeg_mptr::jpeg_mptr(), and png_mptr::png_mptr().

const Gamma& synfig::Importer::gamma | ( |  | ) | const`[inline]`

virtual bool synfig::Importer::get_frame | ( | Surface & | surface,
|  | Time | time,
|  | ProgressCallback * | callback = `NULL` |
| ) |  |  | `[pure virtual]`

Gets a frame and puts it into surface.

Parameters:

  | surface | Reference to surface to put frame into
  | time | For animated importers, determines which frame to get. For static importers, this parameter is unused.
  | callback | Pointer to callback class for progress, errors, etc.

Returns:
  `true` on success, `false` on error

See also:
  ProgressCallback, Surface

Implemented in bmp_mptr, ffmpeg_mptr, imagemagick_mptr, jpeg_mptr, Importer_LibAVCodec, exr_mptr, png_mptr, ppm_mptr, and synfig::ListImporter.

Referenced by get_frame().

virtual bool synfig::Importer::get_frame | ( | Surface & | surface,
|  | 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` |
| ) |  |  | `[inline, virtual]`

References get_frame().

virtual bool synfig::Importer::is_animated | ( |  | ) | `[inline, virtual]`

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 String & | filename | ) | `[static]`

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

References _, __open_importers, book(), synfig::error(), and tolower.

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

## Member Data Documentation

Importer::Book * synfig::Importer::book_ `[static]`

Referenced by book(), subsys_init(), and subsys_stop().

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

- importer.h
- importer.cpp