1 #ifndef __DALI_BLENDING_OPTIONS_H__
2 #define __DALI_BLENDING_OPTIONS_H__
5 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
7 // Licensed under the Flora License, Version 1.0 (the License);
8 // you may not use this file except in compliance with the License.
9 // You may obtain a copy of the License at
11 // http://floralicense.org/license/
13 // Unless required by applicable law or agreed to in writing, software
14 // distributed under the License is distributed on an AS IS BASIS,
15 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 // See the License for the specific language governing permissions and
17 // limitations under the License.
21 #include <dali/public-api/actors/blending.h>
22 #include <dali/public-api/math/vector4.h>
30 // This is an optimization to avoid storing 6 separate blending values
31 struct BlendingOptions
34 * Create some default blending options.
39 * Non-virtual destructor.
44 * Set the blending options.
45 * @param[in] A bitmask of blending options.
47 void SetBitmask( unsigned int bitmask );
50 * Retrieve the blending options as a bitmask.
51 * @return A bitmask of blending options.
53 unsigned int GetBitmask() const;
56 * @copydoc Dali::RenderableActor::SetBlendFunc()
58 void SetBlendFunc( BlendingFactor::Type srcFactorRgb, BlendingFactor::Type destFactorRgb,
59 BlendingFactor::Type srcFactorAlpha, BlendingFactor::Type destFactorAlpha );
62 * @copydoc Dali::RenderableActor::GetBlendFunc()
64 BlendingFactor::Type GetBlendSrcFactorRgb() const;
67 * @copydoc Dali::RenderableActor::GetBlendFunc()
69 BlendingFactor::Type GetBlendDestFactorRgb() const;
72 * @copydoc Dali::RenderableActor::GetBlendFunc()
74 BlendingFactor::Type GetBlendSrcFactorAlpha() const;
77 * @copydoc Dali::RenderableActor::GetBlendFunc()
79 BlendingFactor::Type GetBlendDestFactorAlpha() const;
82 * @copydoc Dali::RenderableActor::SetBlendEquation()
84 void SetBlendEquation( BlendingEquation::Type equationRgb, BlendingEquation::Type equationAlpha );
87 * @copydoc Dali::RenderableActor::GetBlendEquation()
89 BlendingEquation::Type GetBlendEquationRgb() const;
92 * @copydoc Dali::RenderableActor::GetBlendEquation()
94 BlendingEquation::Type GetBlendEquationAlpha() const;
97 * Set the blend color.
98 * @param[in] color The blend color.
99 * @return True if the blend color changed, otherwise it was already the same color.
101 bool SetBlendColor( const Vector4& color );
104 * Query the blend color.
105 * The blend color, or NULL if no blend color was set.
107 const Vector4* GetBlendColor() const;
111 // Undefined copy constructor.
112 BlendingOptions(const BlendingOptions& typePath);
114 // Undefined copy constructor.
115 BlendingOptions& operator=(const BlendingOptions& rhs);
119 unsigned int mBitmask; ///< A bitmask of blending options
121 Vector4* mOptionalColor; ///< A heap-allocated color (owned)
124 } // namespace Internal
128 #endif // __DALI_BLENDING_OPTIONS_H__