# synfig::Layer_Shape Class Reference

writeme More...

`#include <layer_shape.h>`

Inheritance diagram for synfig::Layer_Shape:

List of all members.

## 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 &param, const synfig::ValueBase &value)
| Sets the parameter described by param to value.
virtual ValueBase | get_param (const String &param) const
| Get the value of the specified parameter.
virtual Vocab | get_param_vocab () const
| Gets the parameter vocabulary.
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 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

## Protected Member Functions

| Layer_Shape (const Real &a=1.0, const Color::BlendMethod m=Color::BLEND_COMPOSITE)

## Detailed Description

writeme

## Constructor & Destructor Documentation

Layer_Shape::Layer_Shape | ( | const Real & | a = `1.0`,
|  | const Color::BlendMethod | m = `Color::BLEND_COMPOSITE` |
| ) |  |  | `[protected]`

Layer_Shape::~Layer_Shape | ( |  | ) |

## Member Function Documentation

void Layer_Shape::clear | ( |  | ) |

Clears out any data.

Also clears out the Intersector

Reimplemented in synfig::Layer_Polygon.

Referenced by synfig::Layer_Polygon::clear(), and synfig::Layer_Polygon::set_param().

void Layer_Shape::move_to | ( | Real | x,
|  | Real | y |
| ) |  |  |

Referenced by synfig::Layer_Polygon::add_polygon().

void Layer_Shape::line_to | ( | Real | x,
|  | Real | y |
| ) |  |  |

Referenced by synfig::Layer_Polygon::add_polygon().

void Layer_Shape::conic_to | ( | Real | x1,
|  | Real | y1,
|  | Real | x,
|  | Real | y |
| ) |  |  |

void Layer_Shape::conic_to_smooth | ( | Real | x,
|  | Real | y |
| ) |  |  |

void Layer_Shape::curve_to | ( | Real | x1,
|  | Real | y1,
|  | Real | x2,
|  | Real | y2,
|  | Real | x,
|  | Real | y |
| ) |  |  |

void Layer_Shape::curve_to_smooth | ( | Real | x2,
|  | Real | y2,
|  | Real | x,
|  | Real | y |
| ) |  |  |

void Layer_Shape::close | ( |  | ) |

Referenced by synfig::Layer_Polygon::add_polygon().

void Layer_Shape::endpath | ( |  | ) |

bool Layer_Shape::set_param | ( | const String & | param,
|  | const synfig::ValueBase & | value |
| ) |  |  | `[virtual]`

Sets the parameter described by param to value.

Parameters:

  | param | The name of the parameter to set
  | value | What the parameter is to be set to.

Returns:
  `true` on success, `false` upon rejection or failure. If it returns `false`, then the Layer is assumed to remain unchanged.

See also:
  get_param()

Todo:
  param should be of the type `const String &param`

Reimplemented from synfig::Layer_Composite.

Reimplemented in synfig::BooleanCurve, Outline, Region, Star, and synfig::Layer_Polygon.

References synfig::Color::BLEND_ALPHA_OVER, synfig::Layer_Composite::converted_blend_, synfig::Color::get_a(), IMPORT, IMPORT_AS, IMPORT_PLUS, synfig::Color::set_a(), synfig::Layer_Composite::set_blend_method(), synfig::Layer_Composite::set_param(), and synfig::Layer_Composite::transparent_color_.

Referenced by synfig::Layer_Polygon::set_param(), and synfig::BooleanCurve::set_param().

ValueBase Layer_Shape::get_param | ( | const String & | param | ) | const`[virtual]`

Get the value of the specified parameter.

Returns:
  The requested parameter value, or (upon failure) a NIL ValueBase.

See also:
  set_param()

Todo:
  param should be of the type `const String &`

Reimplemented from synfig::Layer_Composite.

Reimplemented in synfig::BooleanCurve, Outline, Region, Star, and synfig::Layer_Polygon.

References EXPORT, EXPORT_NAME, EXPORT_VERSION, and synfig::Layer_Composite::get_param().

Referenced by synfig::Layer_Polygon::get_param(), and synfig::BooleanCurve::get_param().

Layer::Vocab Layer_Shape::get_param_vocab | ( | void |  | ) | const`[virtual]`

Gets the parameter vocabulary.

Reimplemented from synfig::Layer_Composite.

Reimplemented in synfig::BooleanCurve, Outline, Region, Star, and synfig::Layer_Polygon.

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(), and synfig::BooleanCurve::get_param_vocab().

Color Layer_Shape::get_color | ( | Context | context,
|  | const Point & | pos |
| ) |  |  | const`[virtual]`

Gets the color of the Canvas at pos.

Parameters:

  | context | Context iterator referring to next Layer.
  | pos | Point which indicates where the Color should come from

See also:
  Handle::get_color()

Reimplemented from synfig::Layer.

Reimplemented in synfig::BooleanCurve.

References synfig::Color::alpha(), synfig::Color::blend(), synfig::Color::BLEND_STRAIGHT, synfig::Layer_Composite::get_amount(), synfig::Layer_Composite::get_blend_method(), synfig::Context::get_color(), and synfig::intersect().

bool Layer_Shape::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.

Parameters:

  | 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.

Returns:
  `true` on success, `false` on failure

See also:
  Handle::accelerated_render()

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::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(), synfig::Rect::set_point(), synfig::RendDesc::set_subwindow(), synfig::RendDesc::set_wh(), and synfig::warning().

synfig::Layer::Handle Layer_Shape::hit_check | ( | synfig::Context | context,
|  | const synfig::Point & | point |
| ) |  |  | const`[virtual]`

Checks to see if a part of the layer is directly under point.

Parameters:

  | context | Context iterator referring to next Layer.
  | point | The point to check

Returns:
  The handle of the layer under point. If there is not a layer under point, then returns an empty handle.

Reimplemented from synfig::Layer.

References synfig::Color::BLEND_ALPHA_OVER, synfig::Color::BLEND_BEHIND, synfig::Color::get_a(), synfig::Layer_Composite::get_amount(), synfig::Layer_Composite::get_blend_method(), synfig::Context::hit_check(), synfig::info(), synfig::intersect(), and synfig::Color::is_onto().

Rect Layer_Shape::get_bounding_rect | ( |  | ) | const`[virtual]`

Reimplemented from synfig::Layer.

References synfig::Rect::expand(), synfig::Rect::full_plane(), synfig::Rect::get_max(), synfig::Rect::get_min(), and zero().

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

- layer_shape.h
- layer_shape.cpp