synfig-core
1.0.3
|
This is a Target class that implements the render fucntion for a line by line render procedure. More...
#include <target_scanline.h>
Public Types | |
typedef etl::handle < Target_Scanline > | Handle |
typedef etl::loose_handle < Target_Scanline > | LooseHandle |
typedef etl::handle< const Target_Scanline > | ConstHandle |
Public Types inherited from synfig::Target | |
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 | |
Target_Scanline () | |
Default constructor (threads = 2 current frame = 0) | |
virtual bool | render (ProgressCallback *cb=NULL) |
Renders the canvas to the target. | |
virtual bool | start_frame (ProgressCallback *cb=NULL)=0 |
Marks the start of a frame. | |
virtual int | next_frame (Time &time) |
virtual void | end_frame ()=0 |
Marks the end of a frame. | |
virtual Color * | start_scanline (int scanline)=0 |
Marks the start of a scanline. | |
virtual bool | end_scanline ()=0 |
Marks the end of a scanline. | |
void | set_threads (int x) |
Sets the number of threads. | |
int | get_threads () const |
Gets the number of threads. | |
bool | add_frame (const synfig::Surface *surface) |
Puts the rendered surface onto the target. | |
Public Member Functions inherited from synfig::Target | |
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 | init (ProgressCallback *cb=NULL) |
Initialization tasks of the derived target. |
Additional Inherited Members | |
Static Public Member Functions inherited from synfig::Target | |
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 inherited from synfig::Target | |
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 inherited from synfig::Target | |
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 inherited from synfig::Target | |
Target () | |
Default constructor. |
This is a Target class that implements the render fucntion for a line by line render procedure.
typedef etl::handle<Target_Scanline> synfig::Target_Scanline::Handle |
typedef etl::loose_handle<Target_Scanline> synfig::Target_Scanline::LooseHandle |
typedef etl::handle<const Target_Scanline> synfig::Target_Scanline::ConstHandle |
Target_Scanline::Target_Scanline | ( | ) |
Default constructor (threads = 2 current frame = 0)
References synfig::Target::curr_frame_.
|
virtual |
Renders the canvas to the target.
Implements synfig::Target.
References _, synfig::Context::accelerated_render(), synfig::ProgressCallback::amount_complete(), synfig::SuperCallback::amount_complete(), synfig::Color::blend(), synfig::Canvas::create(), synfig::ProgressCallback::error(), synfig::RendDesc::get_h(), synfig::info(), synfig::optimize_layers(), PIXEL_RENDERING_LIMIT, synfig::render(), synfig::render_threaded(), synfig::Context::set_render_method(), synfig::RendDesc::set_subwindow(), synfig::SOFTWARE, synfig::TARGET_ALPHA_MODE_EXTRACT, synfig::TARGET_ALPHA_MODE_FILL, synfig::TARGET_ALPHA_MODE_KEEP, and synfig::TARGET_ALPHA_MODE_REDUCE.
|
pure virtual |
Marks the start of a frame.
true
on success, false
upon an error. Implemented in gif, mng_trgt, png_trgt_spritesheet, magickpp_trgt, jpeg_trgt, exr_trgt, png_trgt, ffmpeg_trgt, imagemagick_trgt, dv_trgt, Target_LibAVCodec, yuv, ppm, bmp, synfig::Target_Null, and synfig::Target_Multi.
Referenced by add_frame().
|
virtual |
Returns the number of peniding frames to render. If it is zero it stops rendering frames.
Reimplemented from synfig::Target.
|
pure virtual |
Marks the end of a frame.
Implemented in gif, mng_trgt, png_trgt_spritesheet, magickpp_trgt, jpeg_trgt, exr_trgt, png_trgt, ffmpeg_trgt, imagemagick_trgt, dv_trgt, Target_LibAVCodec, yuv, ppm, bmp, synfig::Target_Null, and synfig::Target_Multi.
Referenced by add_frame().
|
pure virtual |
Marks the start of a scanline.
scanline | Which scanline is going to be rendered. |
Implemented in gif, mng_trgt, png_trgt_spritesheet, magickpp_trgt, jpeg_trgt, exr_trgt, ffmpeg_trgt, png_trgt, imagemagick_trgt, dv_trgt, yuv, Target_LibAVCodec, ppm, bmp, synfig::Target_Null, and synfig::Target_Multi.
Referenced by add_frame().
|
pure virtual |
Marks the end of a scanline.
Takes the data that was put at the address returned to by start_scanline() and does whatever it is supposed to do with it.
true
on success, false
on failure. Implemented in gif, mng_trgt, png_trgt_spritesheet, magickpp_trgt, jpeg_trgt, exr_trgt, ffmpeg_trgt, png_trgt, imagemagick_trgt, dv_trgt, yuv, Target_LibAVCodec, ppm, bmp, synfig::Target_Null, and synfig::Target_Multi.
Referenced by add_frame().
|
inline |
Sets the number of threads.
|
inline |
Gets the number of threads.
bool Target_Scanline::add_frame | ( | const synfig::Surface * | surface | ) |
Puts the rendered surface onto the target.
Reimplemented in synfig::Target_Multi.
References synfig::Color::blend(), synfig::Target::desc, end_frame(), end_scanline(), synfig::Target::get_alpha_mode(), synfig::RendDesc::get_bg_color(), start_frame(), start_scanline(), synfig::TARGET_ALPHA_MODE_EXTRACT, synfig::TARGET_ALPHA_MODE_FILL, synfig::TARGET_ALPHA_MODE_KEEP, and synfig::TARGET_ALPHA_MODE_REDUCE.