synfig-core
1.0.3
|
Used to produce rendered animations of the documents. More...
#include <target.h>
Classes | |
struct | BookEntry |
Public Types | |
typedef etl::handle< Target > | Handle |
typedef etl::loose_handle< Target > | LooseHandle |
typedef etl::handle< const Target > | ConstHandle |
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, String > | ExtBook |
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. | |
Gamma & | gamma () |
const Gamma & | gamma () 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. | |
RendDesc & | rend_desc () |
Gets the target particular render description. | |
const RendDesc & | rend_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 Book & | book () |
static ExtBook & | ext_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< Canvas > | canvas |
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 Book * | book_ |
Target Book, indexed by the target's name. | |
static ExtBook * | ext_book_ |
Map of target names indexed by associated file extension. |
Protected Member Functions | |
Target () | |
Default constructor. |
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.
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) |
typedef std::map<String,BookEntry> synfig::Target::Book |
Book of types of targets indexed by the name of the Target.
typedef std::map<String,String> synfig::Target::ExtBook |
Book of types of targets indexed by the file extension.
|
protected |
Default constructor.
|
inlinevirtual |
|
inline |
|
static |
References book_.
Referenced by create(), OptionsProcessor::process_info_options(), and setup_job().
|
static |
Referenced by setup_job().
|
static |
Initializes the Target module by creating a book of targets names and its creators
References book_, synfig::Target_Null_Tile::create(), synfig::Target_Null::create(), and default_gamma_.
Referenced by synfig::Main::Main().
|
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().
|
inline |
|
inline |
Sets the target quality.
References quality_.
|
inline |
Sets the target avoid time synchronization.
References avoid_time_sync_.
|
inline |
Gets the target avoid time synchronization.
References avoid_time_sync_.
|
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().
|
inline |
Sets how to handle alpha.
References alpha_mode.
Referenced by bmp::bmp(), dv_trgt::dv_trgt(), ffmpeg_trgt::ffmpeg_trgt(), jpeg_trgt::jpeg_trgt(), ppm::ppm(), and yuv::yuv().
|
inline |
References gamma_.
Referenced by yuv::end_frame(), bmp::end_scanline(), ppm::end_scanline(), dv_trgt::end_scanline(), imagemagick_trgt::end_scanline(), png_trgt::end_scanline(), ffmpeg_trgt::end_scanline(), jpeg_trgt::end_scanline(), mng_trgt::end_scanline(), exr_trgt::exr_trgt(), mng_trgt::init(), cairo_png_trgt::put_surface(), png_trgt::start_frame(), and png_trgt_spritesheet::write_png_file().
|
virtual |
Sets the target canvas. Must be defined by derived targets.
Reimplemented in synfig::Target_Multi.
|
inline |
Gets the target canvas.
References canvas.
Referenced by gif::end_frame(), ffmpeg_trgt::init(), mng_trgt::init(), png_trgt::start_frame(), and png_trgt_spritesheet::write_png_file().
|
inline |
Gets the target particular render description.
References desc.
Referenced by gif::end_frame(), synfig::Target_Tile::next_tile(), synfig::Target_Cairo_Tile::next_tile(), bmp::start_frame(), synfig::Target_Tile::total_tiles(), and synfig::Target_Cairo_Tile::total_tiles().
|
inline |
Gets the target particular render description.
References desc.
|
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.
d | an RendDesc pointer. |
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.
|
pure virtual |
Renders the canvas to the target.
Implemented in synfig::Target_Cairo_Tile, synfig::Target_Tile, synfig::Target_Cairo, and synfig::Target_Scanline.
|
inlinevirtual |
Initialization tasks of the derived target.
Reimplemented in gif, mng_trgt, ffmpeg_trgt, magickpp_trgt, imagemagick_trgt, dv_trgt, yuv, and Target_LibAVCodec.
|
static |
Creates a new Target described by type, outputting to a file described by filename.
References book().
Referenced by setup_job().
|
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
time | The time reference to be modified |
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().
|
static |
Target Book, indexed by the target's name.
|
static |
Map of target names indexed by associated file extension.
RendDesc synfig::Target::desc |
Adjusted Render description set by set_rend_desc()
Referenced by synfig::Target_Scanline::add_frame(), yuv::end_frame(), exr_trgt::end_frame(), gif::end_frame(), synfig::Target_Multi::end_scanline(), bmp::end_scanline(), ppm::end_scanline(), dv_trgt::end_scanline(), imagemagick_trgt::end_scanline(), png_trgt::end_scanline(), ffmpeg_trgt::end_scanline(), exr_trgt::end_scanline(), jpeg_trgt::end_scanline(), mng_trgt::end_scanline(), yuv::init(), dv_trgt::init(), imagemagick_trgt::init(), ffmpeg_trgt::init(), mng_trgt::init(), gif::init(), next_frame(), cairo_png_trgt::obtain_surface(), rend_desc(), synfig::Target_Multi::set_canvas(), bmp::set_rend_desc(), ppm::set_rend_desc(), synfig::Target_Multi::set_rend_desc(), dv_trgt::set_rend_desc(), yuv::set_rend_desc(), cairo_png_trgt::set_rend_desc(), imagemagick_trgt::set_rend_desc(), ffmpeg_trgt::set_rend_desc(), png_trgt::set_rend_desc(), exr_trgt::set_rend_desc(), jpeg_trgt::set_rend_desc(), mng_trgt::set_rend_desc(), png_trgt_spritesheet::set_rend_desc(), gif::set_rend_desc(), set_rend_desc(), synfig::Target_Null::start_frame(), bmp::start_frame(), ppm::start_frame(), dv_trgt::start_frame(), imagemagick_trgt::start_frame(), ffmpeg_trgt::start_frame(), png_trgt::start_frame(), exr_trgt::start_frame(), jpeg_trgt::start_frame(), png_trgt_spritesheet::start_scanline(), and png_trgt_spritesheet::write_png_file().
etl::handle<Canvas> synfig::Target::canvas |
Canvas being rendered in this target module.
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_ |
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 current frame being rendered.
Referenced by next_frame(), synfig::Target_Cairo_Tile::Target_Cairo_Tile(), synfig::Target_Scanline::Target_Scanline(), and synfig::Target_Tile::Target_Tile().