1 #ifndef DALI_TOOLKIT_DEVEL_ANIMATED_GRADIENT_VISUAL_PROPERTIES_H
2 #define DALI_TOOLKIT_DEVEL_ANIMATED_GRADIENT_VISUAL_PROPERTIES_H
5 * Copyright (c) 2017 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>
35 * @brief AnimatedGradientVisual is to render a smooth transition of colors to the control's quad with animation.
37 namespace DevelAnimatedGradientVisual
41 * @brief AnimatedGradientVisual Property
47 * @brief AnimatedGradientVisual Property
52 * @brief The form of gradient.
53 * @details Name "gradientType", type GradientType::Type (Property::INTEGER) or Property::STRING.
54 * @note If not supplied, default is GradientType::LINEAR.
55 * @see GradientType::Type
57 GRADIENT_TYPE = VISUAL_PROPERTY_START_INDEX,
60 * @brief The coordinate system inside of control's quad.
61 * @details Name "unitType", type UnitType::Type (Property::INTEGER) or Property::STRING.
62 * @note If not supplied, default is UnitType::OBJECT_BOUNDING_BOX.
68 * @brief The policy of color when gradient coordinate is not between 0 and 1.
69 * @details Name "spreadType", type SpreadType::Type (Property::INTEGER) or Property::STRING.
70 * @note If not supplied, default is SpreadType::REFLECT.
71 * @see SpreadType::Type
76 * @brief The position of a gradient coordinate is 0. If GRADIENT_TYPE is RADIAL, than it will be center of circle.
77 * @details Name "startPosition", type Property::Vector2 or Property::Map which index is AnimatedGradientVisual::AnimationParameter::Property
78 * @note If not supplied, default is Vector2( -0.5f, 0.0f ).
79 * @note This can be animated when you use type as Property::Map which index is AnimatedGradientVisual::AnimationParameter::Property
84 * @brief The color of a gradient coordinate is 0.
85 * @details Name "startColor", type Property::Vector4 or Property::Map which index is AnimatedGradientVisual::AnimationParameter::Property.
86 * @note If not supplied, default is Vector4( 143.0f, 170.0f, 220.0f, 255.0f ) / 255.0f.
87 * @note This can be animated when you use type as Property::Map which index is AnimatedGradientVisual::AnimationParameter::Property.
92 * @brief The position of a gradient coordinate is 1.
93 * @details Name "endPosition", type Property::Vector2 or Property::Map which index is AnimatedGradientVisual::AnimationParameter::Property.
94 * @note If not supplied, default is Vector2( 0.5f, 0.0f ).
95 * @note This can be animated when you use type as Property::Map which index is AnimatedGradientVisual::AnimationParameter::Property.
100 * @brief The color of a gradient coordinate is 1.
101 * @details Name "endColor", type Property::Vector4 or Property::Map which index is AnimatedGradientVisual::AnimationParameter::Property.
102 * @note If not supplied, default is Vector4( 255.0f, 163.0f, 163.0f, 255.0f ) / 255.0f.
103 * @note This can be animated when you use type as Property::Map which index is AnimatedGradientVisual::AnimationParameter::Property
108 * @brief The center of rotate START_POSITION and END_POSITION.
109 * @details Name "rotateCenter", type Property::Vector2 or Property::Map which index is AnimatedGradientVisual::AnimationParameter::Property.
110 * @note If not supplied, default is Vector2( 0.0f, 0.0f ).
111 * @note This can be animated when you use type as Property::Map which index is AnimatedGradientVisual::AnimationParameter::Property
116 * @brief The amount of rotate START_POSITION and END_POSITION in radian.
117 * @details Name "rotateAmount", type Property::FLOAT or Property::Map which index is AnimatedGradientVisual::AnimationParameter::Property.
118 * @note If not supplied, default is 0.0f.
119 * @note This can be animated when you use type as Property::Map which index is AnimatedGradientVisual::AnimationParameter::Property
124 * @brief The offset of gradient coordinate. The point will have a color where (gradient coordinate + offset).
125 * @details Name "offset", type Property::FLOAT or Property::Map which index is AnimatedGradientVisual::AnimationParameter::Property.
126 * @note If not supplied, default is Animation from 0.0f to 2.0f, with duration 3.0f seconds.
127 * @note This can be animated when you use type as Property::Map which index is AnimatedGradientVisual::AnimationParameter::Property.
132 } // namespace Property
135 * @brief The type of gradient form. It decide the method of calculate gradient coordinate.
136 * - If GradientType::Type is LINEAR, gradient coordinate is dot product with the line which contain START_POSITION and END_POSITION.
137 * - If GradientType::Type is RADIAL, gradient coordinate is euclidean distance from START_POSITION.
139 namespace GradientType
143 * @brief The type of gradient form. It decide the method of calculate gradient coordinate.
144 * - If GradientType::Type is LINEAR, gradient coordinate is dot product with the line which contain START_POSITION and END_POSITION.
145 * - If GradientType::Type is RADIAL, gradient coordinate is euclidean distance from START_POSITION.
149 LINEAR, ///< Draw gradient linear form.
150 RADIAL ///< Draw gradient radial form.
153 } // namespace GradientType
156 * @brief The type of coordinate system for certain attributes of the points in a gradients.
157 * This applies to the START_POSITION, END_POSITION, and ROTATE_CENTER.
163 * @brief The type of coordinate system for certain attributes of the points in a gradients.
164 * This applies to the START_POSITION, END_POSITION, and ROTATE_CENTER.
168 OBJECT_BOUNDING_BOX, ///< Use positions coordinate in bottom-left(-0.5,-0.5) ~ top-right(0.5,0.5).
169 USER_SPACE, ///< Use positions coordinate in bottom-left(-ActorSize.xy * 0.5) ~ top-right(ActorSize.xy * 0.5).
172 } // namespace UnitType
175 * @brief The policies that define what happens if the gradient coordinate is not between 0 and 1.
181 * @brief The policies that define what happens if the gradient coordinate is not between 0 and 1.
185 REFLECT, ///< Reflect the gradient pattern start-to-end, end-to-start, start-to-end etc.
186 REPEAT, ///< Repeat the gradient pattern start-to-end, start-to-end, start-to-end etc.
187 CLAMP, ///< Use the terminal colors of gradient.
190 } // namespace SpreadType
193 * @brief AnimatedGradientVisual::AnimationParameter is information of each properties animation.
194 * Value animate from start to target during duration seconds.
195 * Each start/target value type for AnimatedGradientVisual Property is :
196 * - START_POSITION, END_POSITION, ROTATE_CENTER is Property::Vector2
197 * - START_COLOR, END_COLOR is Property::Vector4
198 * - ROTATE_AMOUNT, OFFSET is Property::FLOAT
199 * You can set the animation information to AnimatedGradientVisual Property by using Property::MAP.
201 namespace AnimationParameter
205 * @brief AnimatedGradientVisual::AnimationParameter Property
211 * @brief The start value of this animation.
212 * @details Name "startValue", type depends on AnimatedGradientVisual Property.
213 * @note If not supplied, default is Property::Value( 0.0f ).
215 START = DevelAnimatedGradientVisual::Property::OFFSET + 1,
218 * @brief The target value of this animation.
219 * @details Name "targetValue", type depends on AnimatedGradientVisual Property.
220 * @note If not supplied, default is Property::Value( 0.0f ).
225 * @brief The direction of this animation.
226 * @details Name "directionType", type DirectionType::Type (Property::INTEGER) or Property::STRING.
227 * @note If not supplied, default is DirectionType::FORWARD.
228 * @see DirectionType::Type
233 * @brief The duration of this animation in seconds.
234 * @details Name "duration", type Property::FLOAT.
235 * @note If not supplied, default is 3.0f.
240 * @brief The delay of this animation in seconds.
241 * If delay is positive, wait the animation 'delay' seconds.
242 * If delay is negative, skip the animation '-delay' seconds.
243 * @details Name "delay", type Property::FLOAT.
244 * @note If not supplied, default is 0.0f.
249 * @brief The repeat count of this animation.
250 * If repeat is negative, animate unlimited loop.
251 * If repeat is zero, animation will no run.
252 * If repeat is positive, animate 'repeat' times.
253 * @details Name "repeat", type Property::INTEGER.
254 * @note If not supplied, default is 0.
259 * @brief The delay before each loop of this animation in seconds.
260 * @details Name "repeatDelay", type Property::FLOAT.
261 * @note If not supplied, default is 0.0f.
266 * @brief The motion of this animation.
267 * @details Name "motionType", type MotionType::Type (Property::INTEGER) or Property::STRING.
268 * @note If not supplied, default is MotionType::LOOP.
269 * @see MotionType::Type
274 * @brief The easing option of this animation.
275 * @details Name "easingType", type EasingType::Type (Property::INTEGER) or Property::STRING.
276 * @note If not supplied, default is EasingType::LINEAR.
277 * @see EasingType::Type
283 * @brief The type of animation direction
285 namespace DirectionType
289 * @brief The type of animation direction
293 FORWARD, ///< Animate value from START to TARGET
294 BACKWARD, ///< Animate value frome TARGET to START
297 } // namespace DirectionType
300 * @brief The type of animation motion
306 * @brief The type of animation motion
310 LOOP, ///< Animate loopingmode restart
311 MIRROR, ///< Animate loopingmode auto_reverse
314 } // namespace MotionType
317 * @brief The type of animation easing
323 * @brief The type of animation easing
327 LINEAR, ///< Easing animation linear
328 IN, ///< Ease-in animation (slow start -> fast finish)
329 OUT, ///< Ease-out animation (fast start -> slow finish)
330 IN_OUT, ///< Ease-in and Ease-out animation (slow start -> slow finish)
333 } // namespace EasingType
335 } // namespace AnimationParameter
337 } // namespace DevelAnimatedGradientVisual
343 } // namespace Toolkit