# 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:

List of all members.

## Public Member Functions

float | get_amount () const
Layer_Composite & | set_amount (float x)
Color::BlendMethod | get_blend_method () const
Layer_Composite & | set_blend_method (Color::BlendMethod x)
virtual bool | is_solid_color () const
bool | is_disabled () const
virtual Vocab | get_param_vocab () const
| Gets the parameter vocabulary.
virtual bool | set_param (const String &param, const 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 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 Canvas to the given Surface in an accelerated manner.

## Protected Member Functions

| Layer_Composite (float amount=1.0, Color::BlendMethod blend_method=Color::BLEND_COMPOSITE)

## Protected Attributes

bool | converted_blend_
bool | transparent_color_

## Detailed Description

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

## Constructor & Destructor Documentation

synfig::Layer_Composite::Layer_Composite | ( | float | amount = `1.0`,
|  | Color::BlendMethod | blend_method = `Color::BLEND_COMPOSITE` |
| ) |  |  | `[inline, protected]`

## Member Function Documentation

float synfig::Layer_Composite::get_amount | ( |  | ) | const`[inline]`

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

Layer_Composite& synfig::Layer_Composite::set_amount | ( | float | x | ) | `[inline]`

Referenced by synfig::optimize_layers(), and Import::set_param().

Color::BlendMethod synfig::Layer_Composite::get_blend_method | ( |  | ) | const`[inline]`

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

Layer_Composite& synfig::Layer_Composite::set_blend_method | ( | Color::BlendMethod | x | ) | `[inline]`

Referenced by CheckerBoard::CheckerBoard(), Halftone2::Halftone2(), Halftone3::Halftone3(), Layer_Freetype::Layer_Freetype(), LumaKey::LumaKey(), NoiseDistort::NoiseDistort(), synfig::optimize_layers(), Layer_Shade::set_param(), Rectangle::set_param(), Layer_Freetype::set_param(), synfig::Layer_SolidColor::set_param(), synfig::Layer_Shape::set_param(), and CheckerBoard::set_param().

virtual bool synfig::Layer_Composite::is_solid_color | ( |  | ) | const`[inline, virtual]`

Reimplemented in Rectangle.

References synfig::Color::BLEND_STRAIGHT.

Referenced by synfig::Layer_Shape::accelerated_render(), synfig::Layer_PasteCanvas::accelerated_render(), Halftone3::accelerated_render(), Halftone2::accelerated_render(), Circle::accelerated_render(), Layer_Shade::get_full_bounding_rect(), and Circle::get_full_bounding_rect().

bool synfig::Layer_Composite::is_disabled | ( |  | ) | const`[inline]`

Referenced by Rectangle::accelerated_render(), Plant::accelerated_render(), Layer_Freetype::accelerated_render(), Circle::accelerated_render(), Plant::get_bounding_rect(), LumaKey::get_bounding_rect(), NoiseDistort::get_bounding_rect(), Rectangle::get_color(), Circle::get_color(), Layer_Shade::get_full_bounding_rect(), get_full_bounding_rect(), Blur_Layer::get_full_bounding_rect(), Layer_Bevel::get_full_bounding_rect(), and Rectangle::hit_check().

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

Gets the parameter vocabulary.

Reimplemented from synfig::Layer.

Reimplemented in FilledRect, Metaballs, SimpleCircle, Layer_Freetype, Layer_Bevel, synfig::BooleanCurve, Import, Layer_Shade, Twirl, XORPattern, Blur_Layer, Halftone2, Halftone3, LumaKey, RadialBlur, CheckerBoard, Circle, Outline, Rectangle, Region, Star, ConicalGradient, CurveGradient, LinearGradient, RadialGradient, SpiralGradient, NoiseDistort, Noise, Plant, synfig::Layer_Bitmap, synfig::Layer_Duplicate, synfig::Layer_MotionBlur, synfig::Layer_PasteCanvas, synfig::Layer_Polygon, synfig::Layer_Shape, and synfig::Layer_SolidColor.

References _, and synfig::Layer::get_param_vocab().

Referenced by synfig::Layer_SolidColor::get_param_vocab(), synfig::Layer_Shape::get_param_vocab(), synfig::Layer_PasteCanvas::get_param_vocab(), synfig::Layer_Duplicate::get_param_vocab(), and synfig::Layer_Bitmap::get_param_vocab().

bool Layer_Composite::set_param | ( | const String & | param,
|  | const 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.

Reimplemented in FilledRect, Metaballs, SimpleCircle, Layer_Freetype, Layer_Bevel, synfig::BooleanCurve, Import, Layer_Shade, Twirl, XORPattern, Blur_Layer, Halftone2, Halftone3, LumaKey, RadialBlur, CheckerBoard, Circle, Outline, Rectangle, Region, Star, ConicalGradient, CurveGradient, LinearGradient, RadialGradient, SpiralGradient, NoiseDistort, Noise, Plant, synfig::Layer_Duplicate, synfig::Layer_MotionBlur, synfig::Layer_PasteCanvas, synfig::Layer_Polygon, synfig::Layer_Shape, and synfig::Layer_SolidColor.

References synfig::Color::BLEND_COMPOSITE, synfig::Color::BLEND_END, synfig::Color::BLEND_STRAIGHT, converted_blend_, synfig::ValueBase::get(), synfig::Layer::get_canvas(), synfig::Layer::get_name(), synfig::Layer::get_non_empty_description(), get_param(), synfig::Layer::reads_context(), synfig::ValueBase::same_type_as(), synfig::Layer::set_param(), transparent_color_, and synfig::warning().

Referenced by synfig::Layer_SolidColor::set_param(), synfig::Layer_Shape::set_param(), synfig::Layer_PasteCanvas::set_param(), synfig::Layer_MotionBlur::set_param(), synfig::Layer_Duplicate::set_param(), and synfig::Layer_Bitmap::set_param().

ValueBase Layer_Composite::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.

Reimplemented in FilledRect, Metaballs, SimpleCircle, Layer_Freetype, Layer_Bevel, synfig::BooleanCurve, Import, Layer_Shade, Twirl, XORPattern, Blur_Layer, Halftone2, Halftone3, LumaKey, RadialBlur, CheckerBoard, Circle, Outline, Rectangle, Region, Star, ConicalGradient, CurveGradient, LinearGradient, RadialGradient, SpiralGradient, NoiseDistort, Noise, Plant, synfig::Layer_Bitmap, synfig::Layer_Duplicate, synfig::Layer_MotionBlur, synfig::Layer_PasteCanvas, synfig::Layer_Polygon, synfig::Layer_Shape, and synfig::Layer_SolidColor.

References get_amount(), get_blend_method(), and synfig::Layer::get_param().

Referenced by synfig::Layer_SolidColor::get_param(), synfig::Layer_Shape::get_param(), synfig::Layer_PasteCanvas::get_param(), synfig::Layer_MotionBlur::get_param(), synfig::Layer_Duplicate::get_param(), synfig::Layer_Bitmap::get_param(), and set_param().

Rect Layer_Composite::get_full_bounding_rect | ( | Context | context | ) | const`[virtual]`

Reimplemented from synfig::Layer.

Reimplemented in Layer_Bevel, Layer_Shade, Blur_Layer, Circle, and Rectangle.

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]`

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.

Reimplemented in FilledRect, Metaballs, Layer_Freetype, Layer_Bevel, synfig::BooleanCurve, Layer_Shade, Blur_Layer, Halftone2, Halftone3, LumaKey, RadialBlur, CheckerBoard, Circle, Rectangle, ConicalGradient, CurveGradient, LinearGradient, RadialGradient, SpiralGradient, Noise, Plant, synfig::Layer_Bitmap, synfig::Layer_Duplicate, synfig::Layer_MotionBlur, synfig::Layer_PasteCanvas, synfig::Layer_Shape, and synfig::Layer_SolidColor.

References _, synfig::Context::accelerated_render(), synfig::Color::BLEND_STRAIGHT, synfig::Layer::Context, synfig::ProgressCallback::error(), synfig::RendDesc::get_br(), synfig::RendDesc::get_tl(), synfig::render(), and synfig::surface_target().

## Member Data Documentation

bool synfig::Layer_Composite::converted_blend_ `[protected]`

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

bool synfig::Layer_Composite::transparent_color_ `[protected]`

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

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

- layer_composite.h
- layer_composite.cpp