synfig-core  1.0.3
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
synfig::Layer_Composite Class Reference

Base class for layers that put stuff on top of lower layers. More...

#include <layer_composite.h>

Inheritance diagram for synfig::Layer_Composite:
synfig::Layer synfig::Node Blur_Layer CheckerBoard Circle ConicalGradient CurveGradient FilledRect Halftone2 Halftone3 Layer_Bevel Layer_Freetype Layer_Shade LinearGradient LumaKey Metaballs Noise NoiseDistort Plant RadialBlur RadialGradient Rectangle SimpleCircle SpiralGradient synfig::Layer_Bitmap synfig::Layer_Duplicate synfig::Layer_MeshTransform synfig::Layer_MotionBlur synfig::Layer_PasteCanvas synfig::Layer_Shape synfig::Layer_SolidColor synfig::Layer_Sound Twirl XORPattern

Public Member Functions

float get_amount () const
 Gets the amount of the layer.
Layer_Compositeset_amount (float x)
 Sets the amount of the layer and returns this layer.
Color::BlendMethod get_blend_method () const
 Gets the blend method of the layer.
Layer_Compositeset_blend_method (Color::BlendMethod x)
 Sets the blend method of the layer and returns this layer.
virtual bool is_solid_color () const
 Returns true is amount is 1 and blend method is straight.
bool is_disabled () const
 Returns true if the amount is zero.
virtual Vocab get_param_vocab () const
 Gets the parameter vocabulary. To be overrided by the derived.
virtual bool set_param (const String &param, const ValueBase &value)
 Sets the value for the given parameter.
virtual ValueBase get_param (const String &param) const
 Gets the value of the given parameter.
virtual Rect get_full_bounding_rect (Context context) const
virtual bool accelerated_render (Context context, Surface *surface, int quality, const RendDesc &renddesc, ProgressCallback *cb) const
 Renders the layer composited on the context and puts it on the target surface.
virtual bool accelerated_cairorender (Context context, cairo_t *cr, int quality, const RendDesc &renddesc, ProgressCallback *cb) const
- Public Member Functions inherited from synfig::Layer
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 DynamicParamListdynamic_param_list () const
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.
bool optimized () const
 flag to prevent re-apply optimization features
void set_optimized (bool x)
 set flag to prevent re-apply optimization features
void set_exclude_from_rendering (bool x)
 Sets the 'exclude_from_rendering' flag for the Layer.
bool get_exclude_from_rendering () const
 Returns that status of the 'exclude_from_rendering' flag.
int get_depth () const
 Returns the position of the layer in the canvas.
float get_z_depth () const
 Gets the non animated z depth of the layer.
float get_z_depth (const synfig::Time &t) const
 Gets the z depth of the layer at a time t.
float get_true_z_depth (const synfig::Time &t=Time(0)) const
 Gets the true z depth of the layer (index + parameter)
void set_z_depth (float x)
 Sets the z depth of the layer (non animated)
void set_canvas (etl::loose_handle< Canvas > canvas)
 Sets the Canvas that this Layer is a part of.
etl::loose_handle< Canvasget_canvas () const
 Returns a handle to the Canvas to which this Layer belongs.
const Stringget_description () const
 Returns the description of the layer.
String get_string () const
void set_description (const String &x)
 Sets the description of the layer.
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 &param_name) const
 Returns the localised version of the given layer parameter.
Layer::LooseHandle get_parent_paste_canvas_layer () const
 Returns a handle to the Parent PasteCanvas layer or NULL if layer belongs to root canvas.
virtual Rect get_bounding_rect () 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 String get_version () const
 Gets the version string for this layer.
virtual etl::handle< Transformget_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_list (const ParamList &)
 Sets a list of parameters.
virtual ParamList get_param_list () const
 Get a list of all of the parameters and their values.
virtual void set_time (IndependentContext context, Time time) const
 Sets the time for the Layer and those under it.
virtual void set_time (IndependentContext 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 blend color of the Layer in the context at pos.
virtual CairoColor get_cairocolor (Context context, const Point &pos) const
virtual void set_render_method (Context context, RenderMethod x)
 Sets the render method to the layer. Not all layers uses this virtual member.
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 (etl::loose_handle< Canvas > canvas, 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.
virtual bool connect_dynamic_param (const String &param, etl::loose_handle< ValueNode >)
 Connects the parameter to another Value Node.
virtual bool disconnect_dynamic_param (const String &param)
 Disconnects the parameter from any Value Node.
Real get_parent_canvas_grow_value () const
 Retrieves the grow value from its parent canvas.
virtual void fill_sound_processor (SoundProcessor &soundProcessor) const
- Public Member Functions inherited from synfig::Node
sigc::signal< void > & signal_deleted ()
sigc::signal< void > & signal_changed ()
sigc::signal< void, GUID > & signal_guid_changed ()
 GUID Changed.
virtual ~Node ()
void changed ()
const GUIDget_guid () const
 Gets the GUID for this Node.
virtual void set_guid (const GUID &x)
 Sets the GUID for this Node.
int get_time_last_changed () const
 Gets the time when the Node was changed.
void add_child (Node *x)
 Adds the parameter as the child of the current Node.
void remove_child (Node *x)
 Removes the parameter as a child of the current Node.
int parent_count () const
 Returns how many parenst has the current Node.
const time_setget_times () const
 Returns the cached times values for all the children.
RWLockget_rw_lock () const
 Writeme!

Protected Member Functions

 Layer_Composite (Real amount=1.0, Color::BlendMethod blend_method=Color::BLEND_COMPOSITE)
 Default constructor. Not used directly.
- Protected Member Functions inherited from synfig::Layer
 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.
- Protected Member Functions inherited from synfig::Node
 Node ()
void begin_delete ()
virtual void on_guid_changed (GUID guid)

Protected Attributes

bool converted_blend_
bool transparent_color_

Additional Inherited Members

- Public Types inherited from synfig::Layer
typedef Layer *(* Factory )()
 Type that represents a pointer to a Layer's constructor.
typedef std::map< String,
BookEntry
Book
 Book of types of layers indexed by layer type name.
typedef std::map< String,
ValueBase
ParamList
 Map of Value Base parameters indexed by name.
typedef etl::handle< LayerHandle
typedef etl::loose_handle< LayerLooseHandle
typedef etl::handle< const LayerConstHandle
typedef std::map< String,
etl::rhandle< ValueNode > > 
DynamicParamList
 Map of parameters that are animated Value Nodes indexed by the param name.
typedef ParamVocab Vocab
 A list type which describes all the parameters that a layer has.
- Static Public Member Functions inherited from synfig::Layer
static void register_in_book (const BookEntry &)
static Bookbook ()
static bool subsys_init ()
static bool subsys_stop ()
 Stops the layer system by deleting the book of registered layers.
static bool render_transformed (const Layer *layer, Context context, Surface *surface, int quality, const RendDesc &renddesc, ProgressCallback *cb, const char *file, int line)
static Layer::LooseHandle create (const String &type)
 Creates a Layer of type type.
- Public Attributes inherited from synfig::Node
std::set< Node * > parent_set

Detailed Description

Base class for layers that put stuff on top of lower layers.

Constructor & Destructor Documentation

Layer_Composite::Layer_Composite ( Real  amount = 1.0,
Color::BlendMethod  blend_method = Color::BLEND_COMPOSITE 
)
protected

Default constructor. Not used directly.

References SET_INTERPOLATION_DEFAULTS, and SET_STATIC_DEFAULTS.

Member Function Documentation

float synfig::Layer_Composite::get_amount ( ) const
inline

Gets the amount of the layer.

References synfig::ValueBase::get().

Referenced by Blur_Layer::accelerated_cairorender(), synfig::Layer_Duplicate::accelerated_cairorender(), synfig::Layer_SolidColor::accelerated_cairorender(), Layer_Shade::accelerated_cairorender(), RadialBlur::accelerated_cairorender(), SimpleCircle::accelerated_cairorender(), LumaKey::accelerated_cairorender(), CheckerBoard::accelerated_cairorender(), Rectangle::accelerated_cairorender(), ConicalGradient::accelerated_cairorender(), SpiralGradient::accelerated_cairorender(), Layer_Bevel::accelerated_cairorender(), RadialGradient::accelerated_cairorender(), synfig::Layer_Bitmap::accelerated_cairorender(), LinearGradient::accelerated_cairorender(), Halftone2::accelerated_cairorender(), CurveGradient::accelerated_cairorender(), Halftone3::accelerated_cairorender(), synfig::Layer_Shape::accelerated_cairorender(), Circle::accelerated_cairorender(), Plant::accelerated_cairorender(), synfig::Layer_PasteCanvas::accelerated_cairorender(), Blur_Layer::accelerated_render(), synfig::Layer_Duplicate::accelerated_render(), synfig::Layer_SolidColor::accelerated_render(), Layer_Shade::accelerated_render(), RadialBlur::accelerated_render(), CheckerBoard::accelerated_render(), Rectangle::accelerated_render(), ConicalGradient::accelerated_render(), SpiralGradient::accelerated_render(), Layer_Bevel::accelerated_render(), Metaballs::accelerated_render(), RadialGradient::accelerated_render(), FilledRect::accelerated_render(), synfig::Layer_Bitmap::accelerated_render(), LinearGradient::accelerated_render(), Halftone2::accelerated_render(), CurveGradient::accelerated_render(), Halftone3::accelerated_render(), Noise::accelerated_render(), synfig::Layer_Shape::accelerated_render(), Circle::accelerated_render(), Plant::accelerated_render(), synfig::Layer_PasteCanvas::accelerated_render(), Metaballs::get_cairocolor(), NoiseDistort::get_cairocolor(), Noise::get_cairocolor(), synfig::Layer_Duplicate::get_color(), Blur_Layer::get_color(), synfig::Layer_SolidColor::get_color(), LumaKey::get_color(), Layer_Shade::get_color(), CheckerBoard::get_color(), XORPattern::get_color(), SimpleCircle::get_color(), Rectangle::get_color(), Metaballs::get_color(), ConicalGradient::get_color(), SpiralGradient::get_color(), Layer_Bevel::get_color(), RadialGradient::get_color(), NoiseDistort::get_color(), Halftone2::get_color(), LinearGradient::get_color(), CurveGradient::get_color(), Halftone3::get_color(), Noise::get_color(), Circle::get_color(), synfig::Layer_Shape::get_color(), synfig::Layer_PasteCanvas::get_color(), synfig::Layer_SolidColor::hit_check(), XORPattern::hit_check(), CheckerBoard::hit_check(), ConicalGradient::hit_check(), SpiralGradient::hit_check(), RadialGradient::hit_check(), Metaballs::hit_check(), NoiseDistort::hit_check(), LinearGradient::hit_check(), CurveGradient::hit_check(), Noise::hit_check(), synfig::Layer_Shape::hit_check(), Circle::hit_check(), synfig::Layer_PasteCanvas::hit_check(), Rectangle::is_solid_color(), synfig::optimize_layers(), and Import::set_time().

Layer_Composite& synfig::Layer_Composite::set_amount ( float  x)
inline

Sets the amount of the layer and returns this layer.

References synfig::ValueBase::set().

Referenced by Import::set_param().

Color::BlendMethod synfig::Layer_Composite::get_blend_method ( ) const
inline

Gets the blend method of the layer.

References synfig::ValueBase::get().

Referenced by Blur_Layer::accelerated_cairorender(), synfig::Layer_Duplicate::accelerated_cairorender(), synfig::Layer_SolidColor::accelerated_cairorender(), Layer_Shade::accelerated_cairorender(), RadialBlur::accelerated_cairorender(), SimpleCircle::accelerated_cairorender(), CheckerBoard::accelerated_cairorender(), Rectangle::accelerated_cairorender(), ConicalGradient::accelerated_cairorender(), SpiralGradient::accelerated_cairorender(), Layer_Bevel::accelerated_cairorender(), FilledRect::accelerated_cairorender(), RadialGradient::accelerated_cairorender(), synfig::Layer_Bitmap::accelerated_cairorender(), Halftone2::accelerated_cairorender(), LinearGradient::accelerated_cairorender(), CurveGradient::accelerated_cairorender(), Halftone3::accelerated_cairorender(), Circle::accelerated_cairorender(), synfig::Layer_Shape::accelerated_cairorender(), Plant::accelerated_cairorender(), synfig::Layer_PasteCanvas::accelerated_cairorender(), Blur_Layer::accelerated_render(), synfig::Layer_Duplicate::accelerated_render(), synfig::Layer_SolidColor::accelerated_render(), Layer_Shade::accelerated_render(), RadialBlur::accelerated_render(), CheckerBoard::accelerated_render(), Rectangle::accelerated_render(), Metaballs::accelerated_render(), ConicalGradient::accelerated_render(), SpiralGradient::accelerated_render(), Layer_Bevel::accelerated_render(), FilledRect::accelerated_render(), RadialGradient::accelerated_render(), synfig::Layer_Bitmap::accelerated_render(), Halftone2::accelerated_render(), LinearGradient::accelerated_render(), CurveGradient::accelerated_render(), Halftone3::accelerated_render(), Noise::accelerated_render(), Circle::accelerated_render(), synfig::Layer_Shape::accelerated_render(), Plant::accelerated_render(), synfig::Layer_PasteCanvas::accelerated_render(), NoiseDistort::get_bounding_rect(), Plant::get_bounding_rect(), Metaballs::get_cairocolor(), NoiseDistort::get_cairocolor(), Noise::get_cairocolor(), synfig::Layer_Duplicate::get_color(), Blur_Layer::get_color(), synfig::Layer_SolidColor::get_color(), LumaKey::get_color(), Layer_Shade::get_color(), CheckerBoard::get_color(), XORPattern::get_color(), SimpleCircle::get_color(), Rectangle::get_color(), Metaballs::get_color(), SpiralGradient::get_color(), ConicalGradient::get_color(), Layer_Bevel::get_color(), RadialGradient::get_color(), FilledRect::get_color(), NoiseDistort::get_color(), Halftone2::get_color(), LinearGradient::get_color(), CurveGradient::get_color(), Halftone3::get_color(), Noise::get_color(), Circle::get_color(), synfig::Layer_Shape::get_color(), synfig::Layer_PasteCanvas::get_color(), Blur_Layer::get_full_bounding_rect(), Layer_Shade::get_full_bounding_rect(), Layer_Bevel::get_full_bounding_rect(), get_full_bounding_rect(), synfig::Layer_PasteCanvas::get_full_bounding_rect(), synfig::Layer_SolidColor::hit_check(), XORPattern::hit_check(), CheckerBoard::hit_check(), Rectangle::hit_check(), SpiralGradient::hit_check(), ConicalGradient::hit_check(), RadialGradient::hit_check(), Metaballs::hit_check(), NoiseDistort::hit_check(), FilledRect::hit_check(), CurveGradient::hit_check(), LinearGradient::hit_check(), Noise::hit_check(), synfig::Layer_Shape::hit_check(), Circle::hit_check(), Rectangle::is_solid_color(), and synfig::optimize_layers().

Layer_Composite& synfig::Layer_Composite::set_blend_method ( Color::BlendMethod  x)
inline
virtual bool synfig::Layer_Composite::is_solid_color ( ) const
inlinevirtual
bool synfig::Layer_Composite::is_disabled ( ) const
inline
Layer::Vocab Layer_Composite::get_param_vocab ( void  ) const
virtual
bool Layer_Composite::set_param ( const String param,
const ValueBase value 
)
virtual
ValueBase Layer_Composite::get_param ( const String param) const
virtual
Rect Layer_Composite::get_full_bounding_rect ( Context  context) const
virtual

Returns the rectangle that includes the context of the layer and the intersection of the layer in case it is active and not onto

Reimplemented from synfig::Layer.

Reimplemented in synfig::Layer_PasteCanvas, Circle, Layer_Bevel, Rectangle, synfig::Layer_MeshTransform, Layer_Shade, and Blur_Layer.

References get_blend_method(), synfig::Layer::get_bounding_rect(), synfig::Context::get_full_bounding_rect(), is_disabled(), and synfig::Color::is_onto().

bool Layer_Composite::accelerated_render ( Context  context,
Surface surface,
int  quality,
const RendDesc renddesc,
ProgressCallback cb 
) const
virtual
bool Layer_Composite::accelerated_cairorender ( Context  context,
cairo_t *  cr,
int  quality,
const RendDesc renddesc,
ProgressCallback cb 
) const
virtual

Member Data Documentation

bool synfig::Layer_Composite::converted_blend_
protected

Converted blend is used to check if an old version of canvas is used in the composition. Old Straight was used as new Composite

Todo:
verify this

Referenced by synfig::Layer_SolidColor::set_param(), Layer_Shade::set_param(), CheckerBoard::set_param(), Rectangle::set_param(), set_param(), and synfig::Layer_Shape::set_param().

bool synfig::Layer_Composite::transparent_color_
protected

Transparent color is used for old canvas versions. Old Straight plus transparent color seems to be the same new than alpha over.

Referenced by synfig::Layer_SolidColor::set_param(), Layer_Shade::set_param(), CheckerBoard::set_param(), Rectangle::set_param(), set_param(), and synfig::Layer_Shape::set_param().


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