Merge "Update Object's public header comments" into devel/master
[platform/core/uifw/dali-core.git] / dali / internal / common / blending-options.h
1 #ifndef __DALI_BLENDING_OPTIONS_H__
2 #define __DALI_BLENDING_OPTIONS_H__
3
4 /*
5  * Copyright (c) 2014 Samsung Electronics Co., Ltd.
6  *
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
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
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.
18  *
19  */
20
21 // INTERNAL INCLUDES
22 #include <dali/public-api/actors/blending.h>
23 #include <dali/public-api/math/vector4.h>
24
25 namespace Dali
26 {
27
28 namespace Internal
29 {
30
31 // This is an optimization to avoid storing 6 separate blending values
32 struct BlendingOptions
33 {
34   /**
35    * Create some default blending options.
36    */
37   BlendingOptions();
38
39   /**
40    * Non-virtual destructor.
41    */
42   ~BlendingOptions();
43
44   /**
45    * Set the blending options.
46    * @param[in] A bitmask of blending options.
47    */
48   void SetBitmask( unsigned int bitmask );
49
50   /**
51    * Retrieve the blending options as a bitmask.
52    * @return A bitmask of blending options.
53    */
54   unsigned int GetBitmask() const;
55
56   /**
57    * @copydoc Dali::RenderableActor::SetBlendFunc()
58    */
59   void SetBlendFunc( BlendingFactor::Type srcFactorRgb,   BlendingFactor::Type destFactorRgb,
60                      BlendingFactor::Type srcFactorAlpha, BlendingFactor::Type destFactorAlpha );
61
62   /**
63    * @copydoc Dali::RenderableActor::GetBlendFunc()
64    */
65   BlendingFactor::Type GetBlendSrcFactorRgb() const;
66
67   /**
68    * @copydoc Dali::RenderableActor::GetBlendFunc()
69    */
70   BlendingFactor::Type GetBlendDestFactorRgb() const;
71
72   /**
73    * @copydoc Dali::RenderableActor::GetBlendFunc()
74    */
75   BlendingFactor::Type GetBlendSrcFactorAlpha() const;
76
77   /**
78    * @copydoc Dali::RenderableActor::GetBlendFunc()
79    */
80   BlendingFactor::Type GetBlendDestFactorAlpha() const;
81
82   /**
83    * @copydoc Dali::RenderableActor::SetBlendEquation()
84    */
85   void SetBlendEquation( BlendingEquation::Type equationRgb, BlendingEquation::Type equationAlpha );
86
87   /**
88    * @copydoc Dali::RenderableActor::GetBlendEquation()
89    */
90   BlendingEquation::Type GetBlendEquationRgb() const;
91
92   /**
93    * @copydoc Dali::RenderableActor::GetBlendEquation()
94    */
95   BlendingEquation::Type GetBlendEquationAlpha() const;
96
97   /**
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.
101    */
102   void SetBlendColor( const Vector4& color );
103
104   /**
105    * Query the blend color.
106    * The blend color, or NULL if no blend color was set.
107    */
108   const Vector4* GetBlendColor() const;
109
110 private:
111
112   // Undefined copy constructor.
113   BlendingOptions(const BlendingOptions& typePath);
114
115   // Undefined copy constructor.
116   BlendingOptions& operator=(const BlendingOptions& rhs);
117
118 private:
119
120   unsigned int mBitmask; ///< A bitmask of blending options
121
122   Vector4* mBlendColor; ///< A heap-allocated color (owned)
123
124 };
125
126 } // namespace Internal
127
128 } // namespace Dali
129
130 #endif // __DALI_BLENDING_OPTIONS_H__