From bd49f8f66e4f28239a051ea640c3aafa0476c235 Mon Sep 17 00:00:00 2001 From: dooglus Date: Wed, 23 Jan 2008 19:58:41 +0000 Subject: [PATCH] Define new static member Color::is_straight(BlendMethod) to determine whether a blend method is 'straight' or not (ie. 'straight', 'straight onto'). Possibly one of alpha_{lighten|darken} will need adding to this as well. git-svn-id: http://svn.voria.com/code@1436 1f10aa63-cdf2-0310-b900-c93c546f37ac --- synfig-core/trunk/src/synfig/color.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/synfig-core/trunk/src/synfig/color.h b/synfig-core/trunk/src/synfig/color.h index 7c8a356..6c38c6a 100644 --- a/synfig-core/trunk/src/synfig/color.h +++ b/synfig-core/trunk/src/synfig/color.h @@ -524,6 +524,14 @@ public: || x==BLEND_HARD_LIGHT ; } + + //! a blending method is considered 'straight' if transparent pixels in the upper layer can affect the result of the blend + static bool is_straight(BlendMethod x) + { + return x==BLEND_STRAIGHT + || x==BLEND_STRAIGHT_ONTO + ; + } /*protected: value_type& operator[](const int i) -- 2.7.4