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

Used to produce rendered animations of the documents. More...

#include <target.h>

Inheritance diagram for synfig::Target:
synfig::Target_Cairo synfig::Target_Cairo_Tile synfig::Target_Scanline synfig::Target_Tile cairo_png_trgt bmp dv_trgt exr_trgt ffmpeg_trgt gif imagemagick_trgt jpeg_trgt magickpp_trgt mng_trgt png_trgt png_trgt_spritesheet ppm synfig::Target_Multi synfig::Target_Null Target_LibAVCodec yuv synfig::Target_Null_Tile

Classes

struct  BookEntry

Public Types

typedef etl::handle< TargetHandle
typedef etl::loose_handle< TargetLooseHandle
typedef etl::handle< const TargetConstHandle
typedef Target *(* Factory )(const char *filename, TargetParam p)
 Type that represents a pointer to a Target's constructor.
typedef std::map< String,
BookEntry
Book
 Book of types of targets indexed by the name of the Target.
typedef std::map< String, StringExtBook
 Book of types of targets indexed by the file extension.

Public Member Functions

sigc::signal< void > & signal_progress ()
virtual ~Target ()
int get_quality () const
 Gets the target quality.
void set_quality (int q)
 Sets the target quality.
void set_avoid_time_sync (bool x=true)
 Sets the target avoid time synchronization.
bool get_avoid_time_sync () const
 Gets the target avoid time synchronization.
TargetAlphaMode get_alpha_mode () const
 Tells how to handle alpha.
void set_alpha_mode (TargetAlphaMode x=TARGET_ALPHA_MODE_KEEP)
 Sets how to handle alpha.
Gammagamma ()
const Gammagamma () const
 Sets the target gamma.
virtual void set_canvas (etl::handle< Canvas > c)
 Sets the target canvas. Must be defined by derived targets.
const etl::handle< Canvas > & get_canvas () const
 Gets the target canvas.
RendDescrend_desc ()
 Gets the target particular render description.
const RendDescrend_desc () const
 Gets the target particular render description.
virtual bool set_rend_desc (RendDesc *d)
 Sets the RendDesc for the Target to desc.
virtual bool render (ProgressCallback *cb=NULL)=0
 Renders the canvas to the target.
virtual bool init (ProgressCallback *cb=NULL)
 Initialization tasks of the derived target.
virtual int next_frame (Time &time)
 Sets the time for the next frame at time.

Static Public Member Functions

static Bookbook ()
static ExtBookext_book ()
static bool subsys_init ()
static bool subsys_stop ()
 Stops the Target module by deleting the book and the extension book.
static Handle create (const String &type, const String &filename, synfig::TargetParam params)
 Creates a new Target described by type, outputting to a file described by filename.

Public Attributes

RendDesc desc
 Adjusted Render description set by set_rend_desc()
etl::handle< Canvascanvas
 Canvas being rendered in this target module.
int quality_
 Render quality used for the render process of the target.
Gamma gamma_
 Gamma value used for the render process of the target.
TargetAlphaMode alpha_mode
 Tells how to handle alpha. Used by non alpha supported targets to decide if the background must be filled or not.
bool avoid_time_sync_
 When set to true, the target doesn't sync to canvas time.
int curr_frame_
 The current frame being rendered.

Static Public Attributes

static Bookbook_
 Target Book, indexed by the target's name.
static ExtBookext_book_
 Map of target names indexed by associated file extension.

Protected Member Functions

 Target ()
 Default constructor.

Detailed Description

Used to produce rendered animations of the documents.

It is the base class for all the target renderers. It defines the has a static Book pointer class that is a map for the targets factory creators and the strings of the extension that the renderer can understand. It allows to create the a pointer to a particular renderer just by using the extension of the name of file to import. Also it creates a virtual member render() that must be declared in the inherited classes.

Member Typedef Documentation

typedef etl::handle<Target> synfig::Target::Handle
typedef etl::loose_handle<Target> synfig::Target::LooseHandle
typedef etl::handle<const Target> synfig::Target::ConstHandle
typedef Target*(* synfig::Target::Factory)(const char *filename, TargetParam p)

Type that represents a pointer to a Target's constructor.

As a pointer to the constructor, it represents a "factory" of targets. Receives the output filename (including path) and the parameters of the target.

Book of types of targets indexed by the name of the Target.

Book of types of targets indexed by the file extension.

Constructor & Destructor Documentation

Target::Target ( )
protected

Default constructor.

virtual synfig::Target::~Target ( )
inlinevirtual

Member Function Documentation

sigc::signal<void>& synfig::Target::signal_progress ( )
inline
Target::Book & Target::book ( )
static
Target::ExtBook & Target::ext_book ( )
static

Referenced by setup_job().

bool Target::subsys_init ( )
static

Initializes the Target module by creating a book of targets names and its creators

Todo:
Do not hard core gamma to 2.2

References book_, synfig::Target_Null_Tile::create(), synfig::Target_Null::create(), and default_gamma_.

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

bool Target::subsys_stop ( )
static

Stops the Target module by deleting the book and the extension book.

References book_, and default_gamma_.

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

int synfig::Target::get_quality ( ) const
inline

Gets the target quality.

References quality_.

Referenced by gif::init().

void synfig::Target::set_quality ( int  q)
inline

Sets the target quality.

References quality_.

void synfig::Target::set_avoid_time_sync ( bool  x = true)
inline

Sets the target avoid time synchronization.

References avoid_time_sync_.

bool synfig::Target::get_avoid_time_sync ( ) const
inline

Gets the target avoid time synchronization.

References avoid_time_sync_.

TargetAlphaMode synfig::Target::get_alpha_mode ( ) const
inline

Tells how to handle alpha.

Used by non alpha supported targets to decide if the background must be filled or not

References alpha_mode.

Referenced by synfig::Target_Scanline::add_frame(), gif::end_frame(), png_trgt::end_scanline(), cairo_png_trgt::put_surface(), png_trgt::start_frame(), and png_trgt_spritesheet::write_png_file().

void synfig::Target::set_alpha_mode ( TargetAlphaMode  x = TARGET_ALPHA_MODE_KEEP)
inline
Gamma& synfig::Target::gamma ( )
inline
const Gamma& synfig::Target::gamma ( ) const
inline

Sets the target gamma.

References gamma_.

void synfig::Target::set_canvas ( etl::handle< Canvas c)
virtual

Sets the target canvas. Must be defined by derived targets.

Reimplemented in synfig::Target_Multi.

const etl::handle<Canvas>& synfig::Target::get_canvas ( ) const
inline
RendDesc& synfig::Target::rend_desc ( )
inline
const RendDesc& synfig::Target::rend_desc ( ) const
inline

Gets the target particular render description.

References desc.

virtual bool synfig::Target::set_rend_desc ( RendDesc d)
inlinevirtual

Sets the RendDesc for the Target to desc.

If there are any parts of desc that the render target is not capable of doing, the render target will adjust desc to fit its needs.

Parameters
dan RendDesc pointer.
Returns
true on success

Reimplemented in gif, png_trgt_spritesheet, mng_trgt, magickpp_trgt, jpeg_trgt, exr_trgt, png_trgt, ffmpeg_trgt, imagemagick_trgt, Target_LibAVCodec, cairo_png_trgt, yuv, dv_trgt, ppm, synfig::Target_Multi, and bmp.

References desc.

virtual bool synfig::Target::render ( ProgressCallback cb = NULL)
pure virtual

Renders the canvas to the target.

Implemented in synfig::Target_Cairo_Tile, synfig::Target_Tile, synfig::Target_Cairo, and synfig::Target_Scanline.

virtual bool synfig::Target::init ( ProgressCallback cb = NULL)
inlinevirtual

Initialization tasks of the derived target.

Returns
true if the initialization has no errors

Reimplemented in gif, mng_trgt, ffmpeg_trgt, magickpp_trgt, imagemagick_trgt, dv_trgt, yuv, and Target_LibAVCodec.

Target::Handle Target::create ( const String type,
const String filename,
synfig::TargetParam  params 
)
static

Creates a new Target described by type, outputting to a file described by filename.

References book().

Referenced by setup_job().

int Target::next_frame ( Time time)
virtual

Sets the time for the next frame at time.

It modifies the curr_frame_ member which has to be set to zero when next_frame is called for the first time

Parameters
timeThe time reference to be modified
Returns
The number of remainig frames to render
See Also
curr_frame_

Reimplemented in synfig::Target_Cairo_Tile, synfig::Target_Tile, synfig::Target_Cairo, and synfig::Target_Scanline.

References curr_frame_, desc, synfig::RendDesc::get_frame_end(), synfig::RendDesc::get_frame_start(), synfig::RendDesc::get_time_end(), and synfig::RendDesc::get_time_start().

Member Data Documentation

synfig::Target::Book * synfig::Target::book_
static

Target Book, indexed by the target's name.

synfig::Target::ExtBook * synfig::Target::ext_book_
static

Map of target names indexed by associated file extension.

RendDesc synfig::Target::desc
etl::handle<Canvas> synfig::Target::canvas

Canvas being rendered in this target module.

See Also
set_canvas()

Referenced by get_canvas(), and synfig::Target_Multi::set_canvas().

int synfig::Target::quality_

Render quality used for the render process of the target.

Referenced by get_quality(), and set_quality().

Gamma synfig::Target::gamma_

Gamma value used for the render process of the target.

Referenced by gamma().

TargetAlphaMode synfig::Target::alpha_mode

Tells how to handle alpha. Used by non alpha supported targets to decide if the background must be filled or not.

Referenced by get_alpha_mode(), and set_alpha_mode().

bool synfig::Target::avoid_time_sync_

When set to true, the target doesn't sync to canvas time.

Referenced by get_avoid_time_sync(), and set_avoid_time_sync().

int synfig::Target::curr_frame_

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