It allows the user let the layer itself use the blend method defined by the layer by default.
For example, blur layer uses Straight blend method by default and Bevel uses Onto.
The default blend methods by layer can be discussed or changed later.
/* === M E T H O D S ======================================================= */
XORPattern::XORPattern():
- Layer_Composite (1.0,Color::BLEND_STRAIGHT),
+ Layer_Composite(1.0,Color::BLEND_COMPOSITE),
origin(0.125,0.125),
size(0.25,0.25)
{
/* === E N T R Y P O I N T ================================================= */
FilledRect::FilledRect():
- Layer_Composite(1.0,Color::BLEND_STRAIGHT),
+ Layer_Composite(1.0,Color::BLEND_COMPOSITE),
color(Color::black()),
point1(0,0),
point2(1,1),
/* === E N T R Y P O I N T ================================================= */
Metaballs::Metaballs():
- Layer_Composite(1.0,Color::BLEND_STRAIGHT),
+ Layer_Composite(1.0,Color::BLEND_COMPOSITE),
gradient(Color::black(), Color::white()),
threshold(0),
threshold2(1),
/* === E N T R Y P O I N T ================================================= */
SimpleCircle::SimpleCircle():
- Layer_Composite(1.0,Color::BLEND_STRAIGHT),
+ Layer_Composite(1.0,Color::BLEND_COMPOSITE),
color(Color::black()),
center(0,0),
radius(0.5)
}
Blur_Layer::Blur_Layer():
- Layer_Composite (1.0,Color::BLEND_STRAIGHT),
+ Layer_Composite(1.0,Color::BLEND_STRAIGHT),
size(0.1,0.1),
type(Blur::FASTGAUSSIAN)
{
/* === E N T R Y P O I N T ================================================= */
RadialBlur::RadialBlur():
+ Layer_Composite(1.0,Color::BLEND_STRAIGHT),
origin (0,0),
size (0.2),
fade_out(false)
/* === M E T H O D S ======================================================= */
CheckerBoard::CheckerBoard():
- Layer_Composite (1.0,Color::BLEND_STRAIGHT),
+ Layer_Composite (1.0,Color::BLEND_COMPOSITE),
color (Color::black()),
origin (Point(0.125,0.125)),
size (Point(0.25,0.25))
-{
-
- set_blend_method(Color::BLEND_STRAIGHT);
-}
+{}
inline bool
CheckerBoard::point_test(const synfig::Point& getpos)const
/* -- F U N C T I O N S ----------------------------------------------------- */
Circle::Circle():
- Layer_Composite (1.0,Color::BLEND_STRAIGHT),
+ Layer_Composite (1.0,Color::BLEND_COMPOSITE),
color (Color::black()),
origin (0,0),
radius (1),
/* === E N T R Y P O I N T ================================================= */
Rectangle::Rectangle():
- Layer_Composite(1.0,Color::BLEND_STRAIGHT),
+ Layer_Composite(1.0,Color::BLEND_COMPOSITE),
color(Color::black()),
point1(0,0),
point2(1,1),
/* === E N T R Y P O I N T ================================================= */
ConicalGradient::ConicalGradient():
- Layer_Composite(1.0,Color::BLEND_STRAIGHT),
+ Layer_Composite(1.0,Color::BLEND_COMPOSITE),
gradient(Color::black(),Color::white()),
center(0,0),
angle(Angle::zero()),
CurveGradient::CurveGradient():
+ Layer_Composite(1.0,Color::BLEND_COMPOSITE),
origin(0,0),
width(0.25),
gradient(Color::black(), Color::white()),
LinearGradient::LinearGradient():
+ Layer_Composite(1.0,Color::BLEND_COMPOSITE),
p1(1,1),
p2(-1,-1),
gradient(Color::black(), Color::white()),
/* === E N T R Y P O I N T ================================================= */
RadialGradient::RadialGradient():
- Layer_Composite(1.0,Color::BLEND_STRAIGHT),
+ Layer_Composite(1.0,Color::BLEND_COMPOSITE),
gradient(Color::black(),Color::white()),
center(0,0),
radius(0.5),
/* === E N T R Y P O I N T ================================================= */
SpiralGradient::SpiralGradient():
- Layer_Composite(1.0,Color::BLEND_STRAIGHT),
+ Layer_Composite(1.0,Color::BLEND_COMPOSITE),
gradient(Color::black(),Color::white()),
center(0,0),
radius(0.5),
/* === M E T H O D S ======================================================= */
Noise::Noise():
+ Layer_Composite(1.0,Color::BLEND_COMPOSITE),
size(1,1),
gradient(Color::black(), Color::white())
{
BLEND_ALPHA_DARKEN=15, //!< \deprecated If A is more opaque than B, use B
BLEND_ALPHA_OVER=19, //!< \deprecated multiply alphas and then straight blends using the amount
- BLEND_END=22 //!< \internal
+ BLEND_END=22, //!< \internal
+ BLEND_BY_LAYER=999 //! Used to let the layer decides what Blend Method use by
+ //! default when the layer is created
};
/* Other */
/* === M E T H O D S ======================================================= */
Layer_Polygon::Layer_Polygon():
- Layer_Shape (1.0,Color::BLEND_COMPOSITE),
- vector_list (0)
+ Layer_Shape(1.0,Color::BLEND_COMPOSITE),
+ vector_list(0)
{
vector_list.push_back(Point(0,0.5));
vector_list.push_back(Point(-0.333333,0));
/* === E N T R Y P O I N T ================================================= */
Layer_SolidColor::Layer_SolidColor():
- Layer_Composite(1.0,Color::BLEND_STRAIGHT),
+ Layer_Composite(1.0,Color::BLEND_COMPOSITE),
color(Color::black())
{
}
widget_blend_method=manage(new Widget_Enum());
widget_blend_method->show();
widget_blend_method->signal_activate().connect(sigc::mem_fun(*this,&studio::Widget_Defaults::on_blend_method_changed));
- widget_blend_method->set_param_desc(ParamDesc(Color::BLEND_COMPOSITE,"blend_method"));
+ widget_blend_method->set_param_desc(
+ ParamDesc(Color::BLEND_COMPOSITE,"blend_method")
+ .add_enum_value(Color::BLEND_BY_LAYER,"bylayer", _("By Layer Default"))
+ );
attach(*widget_blend_method,0, 2, 2, 3, Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK|Gtk::FILL, 1, 1);
tooltips_.set_tip(*widget_blend_method,_("Default Blend Method"));
layer->set_param("gradient",synfigapp::Main::get_gradient());
if(name!="zoom")
layer->set_param("amount",synfigapp::Main::get_opacity());
- layer->set_param("blend_method",synfigapp::Main::get_blend_method());
+ if(synfigapp::Main::get_blend_method() != Color::BLEND_BY_LAYER)
+ layer->set_param("blend_method",synfigapp::Main::get_blend_method());
{
// Grab the layer's list of parameters