Merge "Add utc test cases" into tizen
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / devel-api / shader-effects / iris-effect.h
1 #ifndef __DALI_TOOLKIT_SHADER_EFFECT_IRIS_H__
2 #define __DALI_TOOLKIT_SHADER_EFFECT_IRIS_H__
3
4 /*
5  * Copyright (c) 2015 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 // EXTERNAL INCLUDES
22 #include <dali/public-api/shader-effects/shader-effect.h>
23
24 namespace Dali
25 {
26
27 namespace Toolkit
28 {
29
30 /**
31  * @brief IrisEffect is a custom shader effect to achieve iris effects in Image actors
32  */
33 class DALI_IMPORT_API IrisEffect : public ShaderEffect
34 {
35
36 public:
37
38   /**
39    * @brief Create an uninitialized IrisEffect; this can be initialized with IrisEffect::New().
40    *
41    * Calling member functions with an uninitialized Dali::Object is not allowed.
42    */
43   IrisEffect();
44
45   /**
46    * @brief Destructor
47    *
48    * This is non-virtual since derived Handle types must not contain data or virtual methods.
49    */
50   ~IrisEffect();
51
52   /**
53    * @brief Create an initialized IrisEffect.
54    *
55    * @return A handle to a newly allocated Dali resource.
56    */
57   static IrisEffect New();
58
59   /**
60    * @brief Set the radius of the iris effect in texture coordinate distance,
61    * i.e. 0.0 (no circle) to 1.0 (complete circle), to > 1.0 (extending
62    * outside of texture).
63    *
64    * @note For Atlas Textures results may be unpredictable.
65    *
66    * @param [in] radius The new radius.
67    */
68   void SetRadius(float radius);
69
70   /**
71    * @brief Set the blend factor of the iris effect.
72    *
73    * The lower the value, the larger the blending portion
74    * (between Opaque & Transparent)
75    *
76    * Blending will account for 1 / blendFactor of the radius
77    * of the texture.
78    *
79    * @param [in] value The new blend Factor.
80    */
81   void SetBlendFactor(float value);
82
83   /**
84    * @brief Sets the center point of the iris (in texture coordinates).
85    *
86    * @param[in] center The center point.
87    */
88   void SetCenter( const Vector2& center );
89
90   /**
91    * @brief Get the name for the radius property which can be used in Animation APIs.
92    *
93    * @return A std::string containing the property name
94    */
95   const std::string& GetRadiusPropertyName() const;
96
97   /**
98    * @brief Get the name for the blend factor property.
99    *
100    * @return A std::string containing the property name
101    */
102   const std::string& GetBlendFactorPropertyName() const;
103
104   /**
105    * @brief Get the name for the center property.
106    *
107    * @return A std::string containing the property name
108    */
109   const std::string& GetCenterPropertyName() const;
110
111
112 private: // Not intended for application developers
113   DALI_INTERNAL IrisEffect(ShaderEffect handle);
114 };
115
116 }
117 }
118
119 #endif