synfig-core
1.0.3
|
writeme More...
#include <layer_shape.h>
Public Member Functions | |
~Layer_Shape () | |
void | clear () |
Clears out any data. | |
void | move_to (Real x, Real y) |
void | line_to (Real x, Real y) |
void | conic_to (Real x1, Real y1, Real x, Real y) |
void | conic_to_smooth (Real x, Real y) |
void | curve_to (Real x1, Real y1, Real x2, Real y2, Real x, Real y) |
void | curve_to_smooth (Real x2, Real y2, Real x, Real y) |
void | close () |
void | endpath () |
virtual bool | set_param (const String ¶m, const synfig::ValueBase &value) |
Sets the value for the given parameter. | |
virtual ValueBase | get_param (const String ¶m) const |
Gets the value of the given parameter. | |
virtual Vocab | get_param_vocab () const |
Gets the parameter vocabulary. To be overrided by the derived. | |
virtual Color | get_color (Context context, const Point &pos) const |
Gets the blend color of the Layer in the context at pos. | |
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 |
virtual synfig::Layer::Handle | hit_check (synfig::Context context, const synfig::Point &point) const |
Checks to see if a part of the layer is directly under point. | |
virtual Rect | get_bounding_rect () const |
bool | shape_to_cairo (cairo_t *cr) const |
bool | feather_cairo_surface (cairo_surface_t *surface, RendDesc renddesc, int quality) const |
Public Member Functions inherited from synfig::Layer_Composite | |
float | get_amount () const |
Gets the amount of the layer. | |
Layer_Composite & | set_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_Composite & | set_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 Rect | get_full_bounding_rect (Context context) 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 DynamicParamList & | dynamic_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< Canvas > | get_canvas () const |
Returns a handle to the Canvas to which this Layer belongs. | |
const String & | get_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 ¶m_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 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< 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_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 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 | 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 ¶m, etl::loose_handle< ValueNode >) |
Connects the parameter to another Value Node. | |
virtual bool | disconnect_dynamic_param (const String ¶m) |
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 GUID & | get_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_set & | get_times () const |
Returns the cached times values for all the children. | |
RWLock & | get_rw_lock () const |
Writeme! |
Protected Member Functions | |
Layer_Shape (const Real &a=1.0, const Color::BlendMethod m=Color::BLEND_COMPOSITE) | |
Protected Member Functions inherited from synfig::Layer_Composite | |
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 | |
ValueBase | param_color |
Parameter: (Color) Color of the shape. | |
ValueBase | param_origin |
Parameter: (Point) Origin of the shape definition. | |
ValueBase | param_invert |
Parameter: (bool) Whether the shape is inverted or not. | |
ValueBase | param_antialias |
Parameter: (bool) Whether the shape has antialiased edge. | |
ValueBase | param_blurtype |
Parameter: (Blur::Type) The type of blur used for the feather. | |
ValueBase | param_feather |
Parameter: (Real) Amount of feather of the shape. | |
ValueBase | param_winding_style |
Parameter: (WindingStyle) How shape is rendered when crosses it self. | |
Protected Attributes inherited from synfig::Layer_Composite | |
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< Layer > | Handle |
typedef etl::loose_handle< Layer > | LooseHandle |
typedef etl::handle< const Layer > | ConstHandle |
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 Book & | book () |
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 |
writeme
|
protected |
Layer_Shape::~Layer_Shape | ( | ) |
void Layer_Shape::clear | ( | ) |
Referenced by synfig::Layer_Polygon::add_polygon().
References isnan.
Referenced by synfig::Layer_Polygon::add_polygon().
void Layer_Shape::close | ( | ) |
Referenced by synfig::Layer_Polygon::add_polygon().
void Layer_Shape::endpath | ( | ) |
|
virtual |
Sets the value for the given parameter.
Reimplemented from synfig::Layer_Composite.
Reimplemented in Advanced_Outline, synfig::Layer_Polygon, Outline, Star, Region, synfig::BooleanCurve, and synfig::Layer_Skeleton.
References synfig::Color::BLEND_ALPHA_OVER, synfig::Layer_Composite::converted_blend_, synfig::ValueBase::get(), synfig::Color::get_a(), synfig::ValueBase::get_type(), IMPORT_VALUE, IMPORT_VALUE_PLUS, param_antialias, param_blurtype, param_color, param_feather, param_invert, param_origin, param_winding_style, synfig::ValueBase::set(), synfig::Color::set_a(), synfig::Layer_Composite::set_blend_method(), and synfig::Layer_Composite::transparent_color_.
Gets the value of the given parameter.
If it is unknown then call the ancestor's get param member to see if it can handle that parameter's string.
Reimplemented from synfig::Layer_Composite.
Reimplemented in Advanced_Outline, synfig::Layer_Polygon, Outline, Star, Region, synfig::BooleanCurve, and synfig::Layer_Skeleton.
References EXPORT_NAME, EXPORT_VALUE, EXPORT_VERSION, param_antialias, param_blurtype, param_color, param_feather, param_invert, param_origin, and param_winding_style.
|
virtual |
Gets the parameter vocabulary. To be overrided by the derived.
First fills the returning vocabulary with the ancestor class
Now inserts the two parameters that this layer knows.
Reimplemented from synfig::Layer_Composite.
Reimplemented in Advanced_Outline, synfig::Layer_Polygon, Outline, Star, Region, synfig::BooleanCurve, and synfig::Layer_Skeleton.
References _, Blur::BOX, Blur::CROSS, Blur::DISC, Blur::FASTGAUSSIAN, Blur::GAUSSIAN, synfig::Layer_Composite::get_param_vocab(), and synfig::Layer::set_description().
Referenced by synfig::Layer_Polygon::get_param_vocab().
Gets the blend color of the Layer in the context at pos.
context | Context iterator referring to next Layer. |
pos | Point which indicates where the Color should come from |
Reimplemented from synfig::Layer.
Reimplemented in synfig::BooleanCurve.
References synfig::Color::alpha(), synfig::Color::blend(), synfig::Color::BLEND_STRAIGHT, synfig::ValueBase::get(), synfig::Layer_Composite::get_amount(), synfig::Layer_Composite::get_blend_method(), synfig::Context::get_color(), synfig::intersect(), param_blurtype, param_color, param_feather, param_invert, and param_origin.
|
virtual |
Renders the layer composited on the context and puts it on the target surface.
Reimplemented from synfig::Layer_Composite.
Reimplemented in synfig::BooleanCurve.
References std::abs(), synfig::Context::accelerated_render(), synfig::ProgressCallback::amount_complete(), synfig::Color::blend(), synfig::Surface::blit_to(), Blur::BOX, synfig::Surface::clear(), Blur::CROSS, Blur::DISC, synfig::Rect::expand(), Blur::FASTGAUSSIAN, Blur::GAUSSIAN, GAUSSIAN_ADJUSTMENT, synfig::ValueBase::get(), synfig::Layer_Composite::get_amount(), synfig::Layer_Composite::get_blend_method(), synfig::RendDesc::get_br(), synfig::RendDesc::get_h(), synfig::RendDesc::get_ph(), synfig::RendDesc::get_pw(), synfig::RendDesc::get_tl(), synfig::RendDesc::get_w(), synfig::Layer_Composite::is_solid_color(), param_blurtype, param_color, param_feather, param_invert, param_origin, synfig::Rect::set_point(), synfig::RendDesc::set_subwindow(), synfig::RendDesc::set_wh(), and synfig::warning().
|
virtual |
Reimplemented from synfig::Layer_Composite.
References std::abs(), synfig::Context::accelerated_cairorender(), Blur::BOX, cairo_paint_with_alpha_operator(), cairo_renddesc_untransform(), Blur::CROSS, Blur::DISC, synfig::ProgressCallback::error(), Blur::FASTGAUSSIAN, feather_cairo_surface(), Blur::GAUSSIAN, GAUSSIAN_ADJUSTMENT, synfig::ValueBase::get(), synfig::Color::get_a(), synfig::Layer_Composite::get_amount(), synfig::Color::get_b(), synfig::Layer_Composite::get_blend_method(), synfig::RendDesc::get_br(), synfig::Color::get_g(), synfig::RendDesc::get_h(), synfig::Color::get_r(), synfig::RendDesc::get_tl(), synfig::RendDesc::get_w(), synfig::Layer_Composite::is_solid_color(), param_antialias, param_blurtype, param_color, param_feather, param_invert, param_origin, param_winding_style, synfig::RendDesc::set_subwindow(), and shape_to_cairo().
|
virtual |
Checks to see if a part of the layer is directly under point.
Reimplemented from synfig::Layer.
References synfig::Color::BLEND_ALPHA_OVER, synfig::Color::BLEND_BEHIND, synfig::ValueBase::get(), synfig::Color::get_a(), synfig::Layer_Composite::get_amount(), synfig::Layer_Composite::get_blend_method(), synfig::Context::hit_check(), synfig::info(), synfig::intersect(), synfig::Color::is_onto(), param_color, param_invert, and param_origin.
|
virtual |
Returns the rectangle that includes the layer
Reimplemented from synfig::Layer.
References synfig::Rect::expand(), synfig::Rect::full_plane(), synfig::ValueBase::get(), synfig::Rect::get_max(), synfig::Rect::get_min(), param_feather, param_invert, param_origin, and zero().
bool Layer_Shape::shape_to_cairo | ( | cairo_t * | cr | ) | const |
References synfig::error(), synfig::info(), and synfig::warning().
Referenced by accelerated_cairorender().
bool Layer_Shape::feather_cairo_surface | ( | cairo_surface_t * | surface, |
RendDesc | renddesc, | ||
int | quality | ||
) | const |
References synfig::CairoColor::ceil, synfig::Color::clamped(), synfig::ValueBase::get(), synfig::RendDesc::get_br(), synfig::RendDesc::get_h(), synfig::RendDesc::get_tl(), synfig::RendDesc::get_w(), synfig::info(), synfig::CairoSurface::map_cairo_image(), param_blurtype, param_color, param_feather, synfig::CairoColor::premult_alpha(), synfig::Color::set_a(), and synfig::CairoSurface::unmap_cairo_image().
Referenced by accelerated_cairorender().
|
protected |
Parameter: (Color) Color of the shape.
Referenced by accelerated_cairorender(), accelerated_render(), feather_cairo_surface(), get_color(), get_param(), hit_check(), and set_param().
|
protected |
Parameter: (Point) Origin of the shape definition.
Referenced by accelerated_cairorender(), accelerated_render(), get_bounding_rect(), get_color(), get_param(), hit_check(), and set_param().
|
protected |
Parameter: (bool) Whether the shape is inverted or not.
Referenced by accelerated_cairorender(), accelerated_render(), get_bounding_rect(), get_color(), get_param(), hit_check(), and set_param().
|
protected |
Parameter: (bool) Whether the shape has antialiased edge.
Referenced by accelerated_cairorender(), get_param(), and set_param().
|
protected |
Parameter: (Blur::Type) The type of blur used for the feather.
Referenced by accelerated_cairorender(), accelerated_render(), feather_cairo_surface(), get_color(), get_param(), and set_param().
|
protected |
Parameter: (Real) Amount of feather of the shape.
Referenced by accelerated_cairorender(), accelerated_render(), feather_cairo_surface(), get_bounding_rect(), get_color(), get_param(), and set_param().
|
protected |
Parameter: (WindingStyle) How shape is rendered when crosses it self.
Referenced by accelerated_cairorender(), get_param(), and set_param().