1 #ifndef DALI_TOOLKIT_DEVEL_ANIMATED_GRADIENT_VISUAL_PROPERTIES_H
2 #define DALI_TOOLKIT_DEVEL_ANIMATED_GRADIENT_VISUAL_PROPERTIES_H
5 * Copyright (c) 2020 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-toolkit/public-api/toolkit-property-index-ranges.h>
33 * @brief AnimatedGradientVisual is to render a smooth transition of colors to the control's quad with animation.
35 namespace DevelAnimatedGradientVisual
38 * @brief AnimatedGradientVisual Property
43 * @brief AnimatedGradientVisual Property
48 * @brief The form of gradient.
49 * @details Name "gradientType", type GradientType::Type (Property::INTEGER) or Property::STRING.
50 * @note If not supplied, default is GradientType::LINEAR.
51 * @see GradientType::Type
53 GRADIENT_TYPE = VISUAL_PROPERTY_START_INDEX,
56 * @brief The coordinate system inside of control's quad.
57 * @details Name "unitType", type UnitType::Type (Property::INTEGER) or Property::STRING.
58 * @note If not supplied, default is UnitType::OBJECT_BOUNDING_BOX.
64 * @brief The policy of color when gradient coordinate is not between 0 and 1.
65 * @details Name "spreadType", type SpreadType::Type (Property::INTEGER) or Property::STRING.
66 * @note If not supplied, default is SpreadType::REFLECT.
67 * @see SpreadType::Type
72 * @brief The position of a gradient coordinate is 0. If GRADIENT_TYPE is RADIAL, than it will be center of circle.
73 * @details Name "startPosition", type Property::Vector2 or Property::Map which index is AnimatedGradientVisual::AnimationParameter::Property
74 * @note If not supplied, default is Vector2( -0.5f, 0.0f ).
75 * @note This can be animated when you use type as Property::Map which index is AnimatedGradientVisual::AnimationParameter::Property
80 * @brief The color of a gradient coordinate is 0.
81 * @details Name "startColor", type Property::Vector4 or Property::Map which index is AnimatedGradientVisual::AnimationParameter::Property.
82 * @note If not supplied, default is Vector4( 143.0f, 170.0f, 220.0f, 255.0f ) / 255.0f.
83 * @note This can be animated when you use type as Property::Map which index is AnimatedGradientVisual::AnimationParameter::Property.
88 * @brief The position of a gradient coordinate is 1.
89 * @details Name "endPosition", type Property::Vector2 or Property::Map which index is AnimatedGradientVisual::AnimationParameter::Property.
90 * @note If not supplied, default is Vector2( 0.5f, 0.0f ).
91 * @note This can be animated when you use type as Property::Map which index is AnimatedGradientVisual::AnimationParameter::Property.
96 * @brief The color of a gradient coordinate is 1.
97 * @details Name "endColor", type Property::Vector4 or Property::Map which index is AnimatedGradientVisual::AnimationParameter::Property.
98 * @note If not supplied, default is Vector4( 255.0f, 163.0f, 163.0f, 255.0f ) / 255.0f.
99 * @note This can be animated when you use type as Property::Map which index is AnimatedGradientVisual::AnimationParameter::Property
104 * @brief The center of rotate START_POSITION and END_POSITION.
105 * @details Name "rotateCenter", type Property::Vector2 or Property::Map which index is AnimatedGradientVisual::AnimationParameter::Property.
106 * @note If not supplied, default is Vector2( 0.0f, 0.0f ).
107 * @note This can be animated when you use type as Property::Map which index is AnimatedGradientVisual::AnimationParameter::Property
112 * @brief The amount of rotate START_POSITION and END_POSITION in radian.
113 * @details Name "rotateAmount", type Property::FLOAT or Property::Map which index is AnimatedGradientVisual::AnimationParameter::Property.
114 * @note If not supplied, default is 0.0f.
115 * @note This can be animated when you use type as Property::Map which index is AnimatedGradientVisual::AnimationParameter::Property
120 * @brief The offset of gradient coordinate. The point will have a color where (gradient coordinate + offset).
121 * @details Name "offset", type Property::FLOAT or Property::Map which index is AnimatedGradientVisual::AnimationParameter::Property.
122 * @note If not supplied, default is Animation from 0.0f to 2.0f, with duration 3.0f seconds.
123 * @note This can be animated when you use type as Property::Map which index is AnimatedGradientVisual::AnimationParameter::Property.
128 } // namespace Property
131 * @brief The type of gradient form. It decide the method of calculate gradient coordinate.
132 * - If GradientType::Type is LINEAR, gradient coordinate is dot product with the line which contain START_POSITION and END_POSITION.
133 * - If GradientType::Type is RADIAL, gradient coordinate is euclidean distance from START_POSITION.
135 namespace GradientType
138 * @brief The type of gradient form. It decide the method of calculate gradient coordinate.
139 * - If GradientType::Type is LINEAR, gradient coordinate is dot product with the line which contain START_POSITION and END_POSITION.
140 * - If GradientType::Type is RADIAL, gradient coordinate is euclidean distance from START_POSITION.
144 LINEAR, ///< Draw gradient linear form.
145 RADIAL ///< Draw gradient radial form.
148 } // namespace GradientType
151 * @brief The type of coordinate system for certain attributes of the points in a gradients.
152 * This applies to the START_POSITION, END_POSITION, and ROTATE_CENTER.
157 * @brief The type of coordinate system for certain attributes of the points in a gradients.
158 * This applies to the START_POSITION, END_POSITION, and ROTATE_CENTER.
162 OBJECT_BOUNDING_BOX, ///< Use positions coordinate in bottom-left(-0.5,-0.5) ~ top-right(0.5,0.5).
163 USER_SPACE, ///< Use positions coordinate in bottom-left(-ActorSize.xy * 0.5) ~ top-right(ActorSize.xy * 0.5).
166 } // namespace UnitType
169 * @brief The policies that define what happens if the gradient coordinate is not between 0 and 1.
174 * @brief The policies that define what happens if the gradient coordinate is not between 0 and 1.
178 REFLECT, ///< Reflect the gradient pattern start-to-end, end-to-start, start-to-end etc.
179 REPEAT, ///< Repeat the gradient pattern start-to-end, start-to-end, start-to-end etc.
180 CLAMP, ///< Use the terminal colors of gradient.
183 } // namespace SpreadType
186 * @brief AnimatedGradientVisual::AnimationParameter is information of each properties animation.
187 * Value animate from start to target during duration seconds.
188 * Each start/target value type for AnimatedGradientVisual Property is :
189 * - START_POSITION, END_POSITION, ROTATE_CENTER is Property::Vector2
190 * - START_COLOR, END_COLOR is Property::Vector4
191 * - ROTATE_AMOUNT, OFFSET is Property::FLOAT
192 * You can set the animation information to AnimatedGradientVisual Property by using Property::MAP.
194 namespace AnimationParameter
197 * @brief AnimatedGradientVisual::AnimationParameter Property
203 * @brief The start value of this animation.
204 * @details Name "startValue", type depends on AnimatedGradientVisual Property.
205 * @note If not supplied, default is Property::Value( 0.0f ).
207 START = DevelAnimatedGradientVisual::Property::OFFSET + 1,
210 * @brief The target value of this animation.
211 * @details Name "targetValue", type depends on AnimatedGradientVisual Property.
212 * @note If not supplied, default is Property::Value( 0.0f ).
217 * @brief The direction of this animation.
218 * @details Name "directionType", type DirectionType::Type (Property::INTEGER) or Property::STRING.
219 * @note If not supplied, default is DirectionType::FORWARD.
220 * @see DirectionType::Type
225 * @brief The duration of this animation in seconds.
226 * @details Name "duration", type Property::FLOAT.
227 * @note If not supplied, default is 3.0f.
232 * @brief The delay of this animation in seconds.
233 * If delay is positive, wait the animation 'delay' seconds.
234 * If delay is negative, skip the animation '-delay' seconds.
235 * @details Name "delay", type Property::FLOAT.
236 * @note If not supplied, default is 0.0f.
241 * @brief The repeat count of this animation.
242 * If repeat is negative, animate unlimited loop.
243 * If repeat is zero, animation will no run.
244 * If repeat is positive, animate 'repeat' times.
245 * @details Name "repeat", type Property::INTEGER.
246 * @note If not supplied, default is 0.
251 * @brief The delay before each loop of this animation in seconds.
252 * @details Name "repeatDelay", type Property::FLOAT.
253 * @note If not supplied, default is 0.0f.
258 * @brief The motion of this animation.
259 * @details Name "motionType", type MotionType::Type (Property::INTEGER) or Property::STRING.
260 * @note If not supplied, default is MotionType::LOOP.
261 * @see MotionType::Type
266 * @brief The easing option of this animation.
267 * @details Name "easingType", type EasingType::Type (Property::INTEGER) or Property::STRING.
268 * @note If not supplied, default is EasingType::LINEAR.
269 * @see EasingType::Type
275 * @brief The type of animation direction
277 namespace DirectionType
280 * @brief The type of animation direction
284 FORWARD, ///< Animate value from START to TARGET
285 BACKWARD, ///< Animate value frome TARGET to START
288 } // namespace DirectionType
291 * @brief The type of animation motion
296 * @brief The type of animation motion
300 LOOP, ///< Animate loopingmode restart
301 MIRROR, ///< Animate loopingmode auto_reverse
304 } // namespace MotionType
307 * @brief The type of animation easing
312 * @brief The type of animation easing
316 LINEAR, ///< Easing animation linear
317 IN, ///< Ease-in animation (slow start -> fast finish)
318 OUT, ///< Ease-out animation (fast start -> slow finish)
319 IN_OUT, ///< Ease-in and Ease-out animation (slow start -> slow finish)
322 } // namespace EasingType
324 } // namespace AnimationParameter
326 } // namespace DevelAnimatedGradientVisual
332 } // namespace Toolkit