Add 'ExclusiveArch: armv7l' limit build to arm architecture
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / public-api / shader-effects / distance-field-effect.h
1 #ifndef __DALI_TOOLKIT_SHADER_EFFECT_DISTANCEFIELD_H__
2 #define __DALI_TOOLKIT_SHADER_EFFECT_DISTANCEFIELD_H__
3
4 //
5 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
6 //
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
10 //
11 //     http://floralicense.org/license/
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 // INTERNAL INCLUDES
21 #include <dali/dali.h>
22
23 namespace Dali DALI_IMPORT_API
24 {
25
26 namespace Toolkit
27 {
28
29 /**
30  * DistanceFieldEffect is a custom shader effect to achieve distance field on Image actors
31  */
32 class DistanceFieldEffect : public ShaderEffect
33 {
34 public:
35
36   /**
37    * Create an uninitialized DistanceFieldEffect; this can be initialized with DistanceFieldEffect::New()
38    * Calling member functions with an uninitialized Dali::Object is not allowed.
39    */
40   DistanceFieldEffect();
41
42   /**
43    * Virtual destructor.
44    */
45   virtual ~DistanceFieldEffect();
46
47   /**
48    * Create an initialized DistanceFieldEffect.
49    * @return A handle to a newly allocated Dali resource.
50    */
51   static DistanceFieldEffect New();
52
53   /**
54    * Set the shadow state
55    * @param[in] shadowEnable value - true, enable shadow.
56    * @note Shadow cannot be used with glow/and or outline.
57    */
58   void SetShadow(bool shadowEnable);
59
60   /**
61    * Set the shadow color multiplier (e.g. output RGB)
62    * @param[in] color Shadow color value
63    */
64   void SetShadowColor(const Vector4& color);
65
66   /**
67    * Set the shadow offset
68    * @param[in] color shadow offset value
69    */
70   void SetShadowOffset(const Vector2& color);
71
72   /**
73    * Set the glow state
74    * @param[in] glowEnable value - true, enable glow.
75    */
76
77   void SetGlow(bool glowEnable);
78
79   /**
80    * Set the glow color multiplier (e.g. output RGB)
81    * @param[in] color Glow color value
82    */
83   void SetGlowColor(const Vector4& color);
84
85   /**
86    * Set the glow boundary factor
87    * @param[in] glowBoundary glow boundary
88    */
89   void SetGlowBoundary(float glowBoundary);
90
91   /**
92    * Set the outline state
93    * @param[in] outlineEnable value - true, enable outline.
94    */
95
96   void SetOutline(bool outlineEnable);
97
98   /**
99    * Set the outline color multiplier (e.g. output RGB)
100    * @param[in] color Outline color value
101    */
102   void SetOutlineColor(const Vector4& color);
103
104   /**
105    * Sets the outline parameters.
106    * @param[in] outlineParams  Thickness of outline. The outline thickness is determined by two parameters.
107    *              params[0] (0-1) Specifies the distance field value for the center of the outline.
108    *                      0 <= params[0] <= 1
109    *              params[1] (0-1) Specifies the softness/width/anti-aliasing of the outlines inner edge.
110    *                      0 <= params[0] <= 1
111    */
112   void SetOutlineParams(const Vector2& outlineParams);
113
114   /**
115    * Set soft edge smoothing
116    * @param[in] smoothing Specify the distance field value for the center of the edge.
117    *                      0 <= params <= 1
118    */
119   void SetSmoothingEdge(float smoothing);
120
121   /**
122    * Get the name for the outline-enable property
123    * @return A std::string containing the property name
124    */
125   const std::string& GetOutlineEnablePropertyName() const;
126
127   /**
128    * Get the name for the glow-enable property
129    * @return A std::string containing the property name
130    */
131   const std::string& GetGlowEnablePropertyName() const;
132
133   /**
134    * Get the name for the shadow-enable property
135    * @return A std::string containing the property name
136    */
137   const std::string& GetShadowEnablePropertyName() const;
138
139   /**
140    * Get the name for the radius property
141    * @return A std::string containing the property name
142    */
143   const std::string& GetColorPropertyName() const;
144
145   /**
146    * Get the name for the smoothing property
147    * @return A std::string containing the property name
148    */
149   const std::string& GetSmoothingPropertyName() const;
150
151   /**
152    * Get the name for the outline color property
153    * @return A std::string containing the property name
154    */
155   const std::string& GetOutlineColorPropertyName() const;
156
157   /**
158    * Get the name for the outline size property
159    * @return A std::string containing the property name
160    */
161   const std::string& GetOutlineSizePropertyName() const;
162
163   /**
164    * Get the name for the shadow color property
165    * @return A std::string containing the property name
166    */
167   const std::string& GetShadowColorPropertyName() const;
168
169   /**
170    * Get the name for the shadow offset property
171    * @return A std::string containing the property name
172    */
173   const std::string& GetShadowOffsetPropertyName() const;
174
175   /**
176    * Get the name for the glow color property
177    * @return A std::string containing the property name
178    */
179   const std::string& GetGlowColorPropertyName() const;
180
181   /**
182    * Get the name for the glow boundary property
183    * @return A std::string containing the property name
184    */
185   const std::string& GetGlowBoundaryPropertyName() const;
186
187 private:
188   DistanceFieldEffect(ShaderEffect handle);
189
190 };
191
192 } // namespace Toolkit
193
194 } // namespace Dali
195
196 #endif // __DALI_TOOLKIT_SHADER_EFFECT_SPOT_H__