#include <layer.h>
Public Types | |
typedef Layer *(* | Factory )() |
Type that represents a pointer to a layer's constructor. | |
typedef std::map< String, BookEntry > | Book |
typedef std::map< String, ValueBase > | ParamList |
typedef etl::handle< Layer > | Handle |
typedef etl::loose_handle< Layer > | LooseHandle |
typedef etl::handle< const Layer > | ConstHandle |
typedef std::map< String, etl::rhandle< ValueNode > > | DynamicParamList |
typedef ParamVocab | Vocab |
A list type which describes all the parameters that a layer has. | |
Public Member Functions | |
sigc::signal< void > & | signal_status_changed () |
Status Changed. | |
sigc::signal< void, String > & | signal_param_changed () |
Parameter changed. | |
sigc::signal< void > & | signal_description_changed () |
Description Changed. | |
sigc::signal< void, int, etl::handle< Canvas > > & | signal_moved () |
Moved. | |
sigc::signal< void, String > & | signal_added_to_group () |
sigc::signal< void, String > & | signal_removed_from_group () |
virtual | ~Layer () |
virtual void | on_canvas_set () |
void | add_to_group (const String &) |
Adds this layer to the given layer group. | |
void | remove_from_group (const String &) |
Removes this layer from the given layer group. | |
void | remove_from_all_groups () |
Removes this layer from all layer groups. | |
String | get_group () const |
Gets the name of the group that this layer belongs to. | |
const DynamicParamList & | dynamic_param_list () const |
writeme | |
bool | connect_dynamic_param (const String ¶m, etl::loose_handle< ValueNode >) |
bool | disconnect_dynamic_param (const String ¶m) |
void | enable () |
Enables the layer for rendering (Making it active). | |
void | disable () |
Disables the layer for rendering. (Making it inactive). | |
void | set_active (bool x) |
Sets the 'active' flag for the Layer to the state described by x. | |
bool | active () const |
Returns that status of the 'active' flag. | |
int | get_depth () const |
Returns the position of the layer in the canvas. | |
float | get_z_depth () const |
float | get_z_depth (const synfig::Time &t) const |
void | set_z_depth (float x) |
void | set_canvas (etl::loose_handle< Canvas > canvas) |
Sets the Canvas that this Layer is a part of. | |
etl::loose_handle< Canvas > | get_canvas () const |
Returns a handle to the Canvas to which this Layer belongs. | |
const String & | get_description () const |
void | set_description (const String &x) |
const String | get_non_empty_description () const |
Returns the layer's description if it's not empty, else its local name. | |
const String | get_param_local_name (const String ¶m_name) const |
Returns the localised version of the given layer parameter. | |
virtual Rect | get_bounding_rect () const |
virtual Rect | get_full_bounding_rect (Context context) const |
virtual String | get_name () const |
Returns a string containing the name of the Layer. | |
virtual String | get_local_name () const |
Returns a string containing the localized name of the Layer. | |
virtual Vocab | get_param_vocab () const |
Gets the parameter vocabulary. | |
virtual String | get_version () const |
Gets the version string for this layer. | |
virtual etl::handle< Transform > | get_transform () const |
virtual bool | set_version (const String &ver) |
Sets the virtual version to use for backwards-compatibility. | |
virtual void | reset_version () |
Resets the virtual version. | |
virtual bool | set_param (const String ¶m, const ValueBase &value) |
Sets the parameter described by param to value. | |
virtual bool | set_param_list (const ParamList &) |
Sets a list of parameters. | |
virtual ValueBase | get_param (const String ¶m) const |
Get the value of the specified parameter. | |
virtual ParamList | get_param_list () const |
Get a list of all of the parameters and their values. | |
virtual void | set_time (Context context, Time time) const |
Sets the time for the selected Layer and those under it. | |
virtual void | set_time (Context context, Time time, const Point &point) const |
Sets the time for the selected Layer and those under it for a specific point. | |
virtual Color | get_color (Context context, const Point &pos) const |
Gets the color of the Canvas at pos. | |
virtual bool | accelerated_render (Context context, Surface *surface, int quality, const RendDesc &renddesc, ProgressCallback *cb) const |
Renders the Canvas to the given Surface in an accelerated manner. | |
virtual Handle | hit_check (Context context, const Point &point) const |
Checks to see if a part of the layer is directly under point. | |
virtual Handle | clone (const GUID &deriv_guid=GUID()) const |
Duplicates the Layer. | |
virtual bool | reads_context () const |
Returns true if the layer needs to be able to examine its context. | |
virtual Handle | simple_clone () const |
Duplicates the Layer without duplicating the value nodes. | |
Static Public Member Functions | |
static void | register_in_book (const BookEntry &) |
static Book & | book () |
static bool | subsys_init () |
static bool | subsys_stop () |
static Layer::LooseHandle | create (const String &type) |
Creates a Layer of type type. | |
Protected Member Functions | |
Layer () | |
virtual void | on_changed () |
This is called whenever a parameter is changed. | |
virtual void | get_times_vfunc (Node::time_set &set) const |
Called to figure out the animation time information. | |
Friends | |
class | ValueNode |
class | Context |
Classes | |
struct | BookEntry |
typedef Layer*(* synfig::Layer::Factory)() |
Type that represents a pointer to a layer's constructor.
typedef std::map<String,BookEntry> synfig::Layer::Book |
typedef std::map<String,ValueBase> synfig::Layer::ParamList |
typedef etl::handle<Layer> synfig::Layer::Handle |
Reimplemented in synfig::Layer_Bitmap.
typedef etl::loose_handle<Layer> synfig::Layer::LooseHandle |
typedef etl::handle<const Layer> synfig::Layer::ConstHandle |
typedef std::map<String,etl::rhandle<ValueNode> > synfig::Layer::DynamicParamList |
typedef ParamVocab synfig::Layer::Vocab |
Layer::Layer | ( | ) | [protected] |
References f.
synfig::Layer::~Layer | ( | ) | [virtual] |
References synfig::Node::begin_delete(), synfig::Node::remove_child(), and remove_from_all_groups().
void Layer::register_in_book | ( | const BookEntry & | entry | ) | [static] |
References book(), and synfig::Layer::BookEntry::name.
Layer::Book & Layer::book | ( | ) | [static] |
References _layer_book.
Referenced by clone(), create(), process_global_flags(), register_in_book(), and simple_clone().
bool Layer::subsys_init | ( | ) | [static] |
bool Layer::subsys_stop | ( | ) | [static] |
sigc::signal<void>& synfig::Layer::signal_status_changed | ( | ) | [inline] |
Status Changed.
sigc::signal<void,String>& synfig::Layer::signal_param_changed | ( | ) | [inline] |
Parameter changed.
sigc::signal<void>& synfig::Layer::signal_description_changed | ( | ) | [inline] |
Description Changed.
sigc::signal<void, int, etl::handle<Canvas> >& synfig::Layer::signal_moved | ( | ) | [inline] |
Moved.
sigc::signal<void, String>& synfig::Layer::signal_added_to_group | ( | ) | [inline] |
Referenced by add_to_group().
sigc::signal<void, String>& synfig::Layer::signal_removed_from_group | ( | ) | [inline] |
Referenced by remove_from_all_groups().
void synfig::Layer::on_canvas_set | ( | ) | [virtual] |
void Layer::add_to_group | ( | const String & | x | ) |
Adds this layer to the given layer group.
References remove_from_all_groups(), and signal_added_to_group().
void Layer::remove_from_group | ( | const String & | x | ) |
void Layer::remove_from_all_groups | ( | ) |
Removes this layer from all layer groups.
References signal_removed_from_group().
Referenced by add_to_group(), remove_from_group(), and ~Layer().
String Layer::get_group | ( | ) | const |
Gets the name of the group that this layer belongs to.
const DynamicParamList& synfig::Layer::dynamic_param_list | ( | ) | const [inline] |
writeme
Referenced by synfig::Layer_Duplicate::clone(), clone(), disconnect_dynamic_param(), synfig::Layer_Duplicate::get_duplicate_param(), get_z_depth(), synfig::optimize_layers(), Layer_TimeLoop::reset_version(), synfig::Layer_SphereDistort::set_param(), Region::set_param(), Outline::set_param(), and simple_clone().
bool Layer::disconnect_dynamic_param | ( | const String & | param | ) |
References synfig::Node::changed(), dynamic_param_list(), and synfig::Node::remove_child().
Referenced by Layer_TimeLoop::reset_version(), synfig::Layer_SphereDistort::set_param(), Region::set_param(), and Outline::set_param().
void synfig::Layer::enable | ( | ) | [inline] |
void synfig::Layer::disable | ( | ) | [inline] |
Disables the layer for rendering. (Making it inactive).
When a layer is disabled, it will be skipped when the canvas is rendered.
References set_active().
void Layer::set_active | ( | bool | x | ) |
Sets the 'active' flag for the Layer to the state described by x.
When a layer is disabled, it will be skipped when the canvas is rendered.
References synfig::Node::on_changed().
bool synfig::Layer::active | ( | ) | const [inline] |
Returns that status of the 'active' flag.
Referenced by clone(), get_full_bounding_rect(), and simple_clone().
int Layer::get_depth | ( | ) | const |
float synfig::Layer::get_z_depth | ( | ) | const [inline] |
float Layer::get_z_depth | ( | const synfig::Time & | t | ) | const |
void synfig::Layer::set_z_depth | ( | float | x | ) | [inline] |
void synfig::Layer::set_canvas | ( | etl::loose_handle< Canvas > | canvas | ) |
etl::loose_handle< synfig::Canvas > synfig::Layer::get_canvas | ( | ) | const |
Returns a handle to the Canvas to which this Layer belongs.
Referenced by Layer_Freetype::accelerated_render(), connect_dynamic_param(), get_depth(), synfig::Layer_PasteCanvas::get_local_name(), Import::get_param(), synfig::Layer_PasteCanvas::on_canvas_set(), Import::on_canvas_set(), synfig::Layer_Composite::set_param(), Import::set_param(), synfig::Layer_PasteCanvas::set_sub_canvas(), and synfig::Layer_PasteCanvas::update_renddesc().
const String& synfig::Layer::get_description | ( | ) | const [inline] |
Referenced by clone(), get_non_empty_description(), simple_clone(), and Outline::sync().
void Layer::set_description | ( | const String & | x | ) |
Referenced by Zoom::get_param_vocab(), Twirl::get_param_vocab(), Translate::get_param_vocab(), SuperSample::get_param_vocab(), Star::get_param_vocab(), SpiralGradient::get_param_vocab(), synfig::Layer_SphereDistort::get_param_vocab(), SimpleCircle::get_param_vocab(), Layer_Shade::get_param_vocab(), Rotate::get_param_vocab(), RadialGradient::get_param_vocab(), RadialBlur::get_param_vocab(), Plant::get_param_vocab(), Outline::get_param_vocab(), Noise::get_param_vocab(), Mandelbrot::get_param_vocab(), Layer_Freetype::get_param_vocab(), synfig::Layer_Shape::get_param_vocab(), synfig::Layer_PasteCanvas::get_param_vocab(), synfig::Layer_MotionBlur::get_param_vocab(), synfig::Layer_Duplicate::get_param_vocab(), synfig::Layer_Bitmap::get_param_vocab(), Julia::get_param_vocab(), InsideOut::get_param_vocab(), Import::get_param_vocab(), NoiseDistort::get_param_vocab(), CurveWarp::get_param_vocab(), CurveGradient::get_param_vocab(), Circle::get_param_vocab(), CheckerBoard::get_param_vocab(), synfig::BooleanCurve::get_param_vocab(), Blur_Layer::get_param_vocab(), and Layer_Bevel::get_param_vocab().
const String synfig::Layer::get_non_empty_description | ( | ) | const [inline] |
Returns the layer's description if it's not empty, else its local name.
References get_description(), and get_local_name().
Referenced by synfig::Layer_Composite::set_param().
Rect Layer::get_bounding_rect | ( | ) | const [virtual] |
Reimplemented in Layer_Freetype, synfig::Layer_SphereDistort, Warp, Circle, Rectangle, synfig::Layer_Bitmap, synfig::Layer_PasteCanvas, and synfig::Layer_Shape.
References synfig::Rect::full_plane().
Referenced by synfig::Layer_Composite::get_full_bounding_rect(), and get_full_bounding_rect().
Reimplemented in Layer_Bevel, synfig::Layer_Clamp, Rotate, Layer_Shade, synfig::Layer_Stretch, Translate, Warp, Zoom, Blur_Layer, synfig::Layer_ColorCorrect, Circle, Rectangle, and synfig::Layer_Composite.
References active(), get_bounding_rect(), and synfig::Context::get_full_bounding_rect().
String Layer::get_name | ( | ) | const [virtual] |
Returns a string containing the name of the Layer.
References synfig::ValueBase::get(), and get_param().
Referenced by clone(), synfig::Layer_Mime::get_local_name(), synfig::Layer_Composite::set_param(), and simple_clone().
String Layer::get_local_name | ( | ) | const [virtual] |
Returns a string containing the localized name of the Layer.
Reimplemented in synfig::Layer_Mime, and synfig::Layer_PasteCanvas.
References synfig::ValueBase::get(), and get_param().
Referenced by get_non_empty_description().
Layer::Vocab Layer::get_param_vocab | ( | void | ) | const [virtual] |
Gets the parameter vocabulary.
Reimplemented in FilledRect, Metaballs, SimpleCircle, Layer_Freetype, Layer_Bevel, synfig::BooleanCurve, synfig::Layer_Clamp, CurveWarp, Import, InsideOut, Julia, Mandelbrot, Rotate, Layer_Shade, synfig::Layer_SphereDistort, synfig::Layer_Stretch, SuperSample, Layer_TimeLoop, Translate, Twirl, Warp, XORPattern, Zoom, Blur_Layer, synfig::Layer_ColorCorrect, Halftone2, Halftone3, LumaKey, RadialBlur, CheckerBoard, Circle, Outline, Rectangle, Region, Star, ConicalGradient, CurveGradient, LinearGradient, RadialGradient, SpiralGradient, NoiseDistort, Noise, Plant, synfig::Layer_Bitmap, synfig::Layer_Composite, synfig::Layer_Duplicate, synfig::Layer_Mime, synfig::Layer_MotionBlur, synfig::Layer_PasteCanvas, synfig::Layer_Polygon, synfig::Layer_Shape, and synfig::Layer_SolidColor.
References _.
Referenced by get_param_list(), get_param_local_name(), and synfig::Layer_Composite::get_param_vocab().
String Layer::get_version | ( | ) | const [virtual] |
Gets the version string for this layer.
Reimplemented in synfig::Layer_Mime.
References synfig::ValueBase::get(), and get_param().
etl::handle< Transform > Layer::get_transform | ( | ) | const [virtual] |
Reimplemented in InsideOut, Rotate, synfig::Layer_SphereDistort, synfig::Layer_Stretch, Translate, Twirl, Warp, and Zoom.
bool Layer::set_version | ( | const String & | ver | ) | [virtual] |
Sets the virtual version to use for backwards-compatibility.
Reimplemented in Layer_Freetype, Layer_TimeLoop, Outline, Plant, and synfig::Layer_Mime.
void Layer::reset_version | ( | ) | [virtual] |
Resets the virtual version.
Reimplemented in Layer_Freetype, Layer_TimeLoop, and Outline.
Sets the parameter described by param to value.
param | The name of the parameter to set | |
value | What the parameter is to be set to. |
true
on success, false
upon rejection or failure. If it returns false
, then the Layer is assumed to remain unchanged. const String ¶m
Reimplemented in FilledRect, Metaballs, SimpleCircle, Layer_Freetype, Layer_Bevel, synfig::BooleanCurve, synfig::Layer_Clamp, CurveWarp, Import, InsideOut, Julia, Mandelbrot, Rotate, Layer_Shade, synfig::Layer_SphereDistort, synfig::Layer_Stretch, SuperSample, Layer_TimeLoop, Translate, Twirl, Warp, XORPattern, Zoom, Blur_Layer, synfig::Layer_ColorCorrect, Halftone2, Halftone3, LumaKey, RadialBlur, CheckerBoard, Circle, Outline, Rectangle, Region, Star, ConicalGradient, CurveGradient, LinearGradient, RadialGradient, SpiralGradient, NoiseDistort, Noise, Plant, synfig::Layer_Composite, synfig::Layer_Duplicate, synfig::Layer_Mime, synfig::Layer_MotionBlur, synfig::Layer_PasteCanvas, synfig::Layer_Polygon, synfig::Layer_Shape, and synfig::Layer_SolidColor.
References synfig::ValueBase::get(), and synfig::ValueBase::same_type_as().
Referenced by synfig::Layer_Composite::set_param(), and set_param_list().
bool Layer::set_param_list | ( | const ParamList & | list | ) | [virtual] |
Get the value of the specified parameter.
const String &
Reimplemented in FilledRect, Metaballs, SimpleCircle, Layer_Freetype, Layer_Bevel, synfig::BooleanCurve, synfig::Layer_Clamp, CurveWarp, Import, InsideOut, Julia, Mandelbrot, Rotate, Layer_Shade, synfig::Layer_SphereDistort, synfig::Layer_Stretch, SuperSample, Layer_TimeLoop, Translate, Twirl, Warp, XORPattern, Zoom, Blur_Layer, synfig::Layer_ColorCorrect, Halftone2, Halftone3, LumaKey, RadialBlur, CheckerBoard, Circle, Outline, Rectangle, Region, Star, ConicalGradient, CurveGradient, LinearGradient, RadialGradient, SpiralGradient, NoiseDistort, Noise, Plant, synfig::Layer_Bitmap, synfig::Layer_Composite, synfig::Layer_Duplicate, synfig::Layer_Mime, synfig::Layer_MotionBlur, synfig::Layer_PasteCanvas, synfig::Layer_Polygon, synfig::Layer_Shape, and synfig::Layer_SolidColor.
References get_z_depth().
Referenced by get_local_name(), get_name(), synfig::Layer_Composite::get_param(), get_param_list(), get_version(), and synfig::optimize_layers().
Layer::ParamList Layer::get_param_list | ( | ) | const [virtual] |
Get a list of all of the parameters and their values.
References get_param(), and get_param_vocab().
Referenced by clone(), synfig::optimize_layers(), and simple_clone().
Sets the time for the selected Layer and those under it.
Reimplemented in Import, Layer_TimeLoop, Outline, Region, NoiseDistort, Noise, synfig::Layer_Duplicate, synfig::Layer_MotionBlur, and synfig::Layer_PasteCanvas.
References synfig::Context::set_time().
Referenced by synfig::optimize_layers().
Sets the time for the selected Layer and those under it for a specific point.
const Point &
Reimplemented in Import, NoiseDistort, Noise, synfig::Layer_Duplicate, and synfig::Layer_MotionBlur.
References synfig::Context::set_time().
Gets the color of the Canvas at pos.
context | Context iterator referring to next Layer. | |
pos | Point which indicates where the Color should come from |
Reimplemented in FilledRect, Metaballs, SimpleCircle, Layer_Freetype, Layer_Bevel, synfig::BooleanCurve, synfig::Layer_Clamp, CurveWarp, InsideOut, Julia, Mandelbrot, Rotate, Layer_Shade, synfig::Layer_SphereDistort, synfig::Layer_Stretch, Layer_TimeLoop, Translate, Twirl, Warp, XORPattern, Zoom, Blur_Layer, synfig::Layer_ColorCorrect, Halftone2, Halftone3, LumaKey, RadialBlur, CheckerBoard, Circle, Rectangle, ConicalGradient, CurveGradient, LinearGradient, RadialGradient, SpiralGradient, NoiseDistort, Noise, synfig::Layer_Bitmap, synfig::Layer_Duplicate, synfig::Layer_Mime, synfig::Layer_MotionBlur, synfig::Layer_PasteCanvas, synfig::Layer_Shape, and synfig::Layer_SolidColor.
References synfig::Context::get_color().
bool Layer::accelerated_render | ( | Context | context, | |
Surface * | surface, | |||
int | quality, | |||
const RendDesc & | renddesc, | |||
ProgressCallback * | cb | |||
) | const [virtual] |
Renders the Canvas to the given Surface in an accelerated manner.
context | Context iterator referring to next Layer. | |
surface | Pointer to Surface to render to. | |
quality | The requested quality-level to render at. | |
renddesc | The associated RendDesc. | |
cb | Pointer to callback object. May be NULL if there is no callback. |
true
on success, false
on failure Reimplemented in FilledRect, Metaballs, Layer_Freetype, Layer_Bevel, synfig::BooleanCurve, synfig::Layer_Clamp, CurveWarp, Rotate, Layer_Shade, synfig::Layer_SphereDistort, synfig::Layer_Stretch, SuperSample, Layer_TimeLoop, Translate, Warp, Zoom, Blur_Layer, synfig::Layer_ColorCorrect, Halftone2, Halftone3, LumaKey, RadialBlur, CheckerBoard, Circle, Rectangle, ConicalGradient, CurveGradient, LinearGradient, RadialGradient, SpiralGradient, Noise, Plant, synfig::Layer_Bitmap, synfig::Layer_Composite, synfig::Layer_Duplicate, synfig::Layer_Mime, synfig::Layer_MotionBlur, synfig::Layer_PasteCanvas, synfig::Layer_Shape, and synfig::Layer_SolidColor.
References _, synfig::ProgressCallback::error(), synfig::render(), and synfig::surface_target().
synfig::Layer::Handle Layer::hit_check | ( | synfig::Context | context, | |
const Point & | point | |||
) | const [virtual] |
Checks to see if a part of the layer is directly under point.
Reimplemented in FilledRect, Metaballs, SimpleCircle, CurveWarp, InsideOut, Rotate, synfig::Layer_SphereDistort, synfig::Layer_Stretch, Translate, Twirl, Warp, XORPattern, Zoom, Halftone2, Halftone3, LumaKey, CheckerBoard, Circle, Rectangle, ConicalGradient, CurveGradient, LinearGradient, RadialGradient, SpiralGradient, NoiseDistort, Noise, synfig::Layer_Bitmap, synfig::Layer_PasteCanvas, synfig::Layer_Shape, and synfig::Layer_SolidColor.
References synfig::Context::hit_check().
Layer::Handle Layer::clone | ( | const GUID & | deriv_guid = GUID() |
) | const [virtual] |
Duplicates the Layer.
Reimplemented in synfig::Layer_Duplicate.
References active(), book(), synfig::ValueNode_Const::create(), create(), dynamic_param_list(), get_description(), synfig::Node::get_guid(), get_name(), get_param_list(), and synfig::ValueBase::TYPE_CANVAS.
Referenced by synfig::Layer_Duplicate::clone().
bool Layer::reads_context | ( | ) | const [virtual] |
Returns true if the layer needs to be able to examine its context.
context to render itself, other than for simple blending. For example, the blur layer will return true - it can't do its job if it can't see its context, and the circle layer will return false - rendering a circle doesn't depend on the underlying context until the final blend operation.
Reimplemented in Layer_Bevel, Layer_Shade, Twirl, Blur_Layer, Halftone2, Halftone3, LumaKey, RadialBlur, NoiseDistort, synfig::Layer_Duplicate, and synfig::Layer_MotionBlur.
Referenced by synfig::Layer_Composite::set_param().
Layer::Handle Layer::simple_clone | ( | ) | const [virtual] |
Duplicates the Layer without duplicating the value nodes.
References active(), book(), create(), dynamic_param_list(), get_description(), get_name(), and get_param_list().
void Layer::on_changed | ( | ) | [protected, virtual] |
This is called whenever a parameter is changed.
Reimplemented from synfig::Node.
References synfig::Time::end(), and synfig::Node::on_changed().
void Layer::get_times_vfunc | ( | Node::time_set & | set | ) | const [protected, virtual] |
Called to figure out the animation time information.
Implements synfig::Node.
Reimplemented in synfig::Layer_PasteCanvas.
Referenced by synfig::Layer_PasteCanvas::get_times_vfunc().
Layer::LooseHandle synfig::Layer::create | ( | const String & | type | ) | [static] |
Creates a Layer of type type.
If the Layer type is unknown, then a Mime layer is created in its place.
type | A string describing the name of the layer to construct. |
References book().
Referenced by clone(), synfig::open_canvas_as(), synfig::optimize_layers(), process_global_flags(), and simple_clone().
friend class ValueNode [friend] |
friend class Context [friend] |
Referenced by synfig::Layer_Composite::accelerated_render().