1 #ifndef __DALI_TOOLKIT_SHADER_EFFECT_IRIS_H__
2 #define __DALI_TOOLKIT_SHADER_EFFECT_IRIS_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 * @addtogroup CAPI_DALI_TOOLKIT_SHADER_EFFECTS_MODULE
27 #include <dali/dali.h>
29 namespace Dali DALI_IMPORT_API
36 * @brief IrisEffect is a custom shader effect to achieve iris effects in Image actors
38 class IrisEffect : public ShaderEffect
44 * @brief Create an uninitialized IrisEffect; this can be initialized with IrisEffect::New().
46 * Calling member functions with an uninitialized Dali::Object is not allowed.
53 * This is non-virtual since derived Handle types must not contain data or virtual methods.
58 * @brief Create an initialized IrisEffect.
60 * @return A handle to a newly allocated Dali resource.
62 static IrisEffect New();
65 * @brief Set the radius of the iris effect in texture coordinate distance,
66 * i.e. 0.0 (no circle) to 1.0 (complete circle), to > 1.0 (extending
67 * outside of texture).
69 * @note For Atlas Textures results may be unpredictable.
71 * @param [in] radius The new radius.
73 void SetRadius(float radius);
76 * @brief Set the blend factor of the iris effect.
78 * The lower the value, the larger the blending portion
79 * (between Opaque & Transparent)
81 * Blending will account for 1 / blendFactor of the radius
84 * @param [in] value The new blend Factor.
86 void SetBlendFactor(float value);
89 * @brief Sets the center point of the iris (in texture coordinates).
91 * @param[in] center The center point.
93 void SetCenter( const Vector2& center );
96 * @brief Get the name for the radius property which can be used in Animation APIs.
98 * @return A std::string containing the property name
100 const std::string& GetRadiusPropertyName() const;
103 * @brief Get the name for the blend factor property.
105 * @return A std::string containing the property name
107 const std::string& GetBlendFactorPropertyName() const;
110 * @brief Get the name for the center property.
112 * @return A std::string containing the property name
114 const std::string& GetCenterPropertyName() const;
117 private: // Not intended for application developers
118 IrisEffect(ShaderEffect handle);