1 #ifndef __DALI_BLENDING_OPTIONS_H__
2 #define __DALI_BLENDING_OPTIONS_H__
5 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.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://www.apache.org/licenses/LICENSE-2.0
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.
22 #include <dali/public-api/actors/blending.h>
23 #include <dali/public-api/math/vector4.h>
31 // This is an optimization to avoid storing 6 separate blending values
32 struct BlendingOptions
35 * Create some default blending options.
40 * Non-virtual destructor.
45 * Set the blending options.
46 * @param[in] A bitmask of blending options.
48 void SetBitmask( unsigned int bitmask );
51 * Retrieve the blending options as a bitmask.
52 * @return A bitmask of blending options.
54 unsigned int GetBitmask() const;
57 * @copydoc Dali::RenderableActor::SetBlendFunc()
59 void SetBlendFunc( BlendingFactor::Type srcFactorRgb, BlendingFactor::Type destFactorRgb,
60 BlendingFactor::Type srcFactorAlpha, BlendingFactor::Type destFactorAlpha );
63 * @copydoc Dali::RenderableActor::GetBlendFunc()
65 BlendingFactor::Type GetBlendSrcFactorRgb() const;
68 * @copydoc Dali::RenderableActor::GetBlendFunc()
70 BlendingFactor::Type GetBlendDestFactorRgb() const;
73 * @copydoc Dali::RenderableActor::GetBlendFunc()
75 BlendingFactor::Type GetBlendSrcFactorAlpha() const;
78 * @copydoc Dali::RenderableActor::GetBlendFunc()
80 BlendingFactor::Type GetBlendDestFactorAlpha() const;
83 * @copydoc Dali::RenderableActor::SetBlendEquation()
85 void SetBlendEquation( BlendingEquation::Type equationRgb, BlendingEquation::Type equationAlpha );
88 * @copydoc Dali::RenderableActor::GetBlendEquation()
90 BlendingEquation::Type GetBlendEquationRgb() const;
93 * @copydoc Dali::RenderableActor::GetBlendEquation()
95 BlendingEquation::Type GetBlendEquationAlpha() const;
98 * Set the blend color.
99 * @param[in] color The blend color.
100 * @return True if the blend color changed, otherwise it was already the same color.
102 void SetBlendColor( const Vector4& color );
105 * Query the blend color.
106 * The blend color, or NULL if no blend color was set.
108 const Vector4* GetBlendColor() const;
112 // Undefined copy constructor.
113 BlendingOptions(const BlendingOptions& typePath);
115 // Undefined copy constructor.
116 BlendingOptions& operator=(const BlendingOptions& rhs);
120 unsigned int mBitmask; ///< A bitmask of blending options
122 Vector4* mBlendColor; ///< A heap-allocated color (owned)
126 } // namespace Internal
130 #endif // __DALI_BLENDING_OPTIONS_H__