3e90f5f9f5fdb090aaa74491d156961db36f8c74
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / renderers / gradient / radial-gradient.h
1 #ifndef __DALI_TOOLKIT_INTERNAL_RADIAL_GRADIENT_H__
2 #define __DALI_TOOLKIT_INTERNAL_RADIAL_GRADIENT_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 #include <dali-toolkit/internal/controls/renderers/gradient/gradient.h>
22
23 #include <dali/public-api/math/vector2.h>
24
25 namespace Dali
26 {
27
28 namespace Toolkit
29 {
30
31 namespace Internal
32 {
33
34 /**
35  * Radial gradients change color circularly.
36  * The color transition starts from the center of the circle and distribute outwardly.
37  */
38 class RadialGradient : public Gradient
39 {
40 public:
41
42   /**
43    * Contructor.
44    * @param[in] center The center of the gradient circle onto which the 0% gradient stop is mapped.
45    * @param[in] radius The radius of the outmost circle onto which the 100% gradient stop is mapped.
46    */
47   RadialGradient( const Vector2& center, float radius );
48
49   /**
50    * Destructor.
51    */
52   virtual ~RadialGradient();
53
54   /**
55    * Set the center and radius of the outermost circle for the radial gradient.
56    * @param[in] center The center of the gradient circle onto which the 0% gradient stop is mapped.
57    * @param[in] radius The radius of the outmost circle onto which the 100% gradient stop is mapped.
58    */
59   void SetCenterAndRadius( const Vector2& center, float radius );
60
61   /**
62    * Get the center of the gradient circle.
63    * @return The center of the gradient circle.
64    */
65   const Vector2& GetCenter() const;
66
67   /**
68    * Get the radius of the outmost gradient circle.
69    * @return The radius of the outmost gradient circle.
70    */
71   float GetRadius() const;
72
73 private:
74
75   Vector2 mCenter;
76   float   mRadius;
77 };
78
79 } // namespace Internal
80
81 } // namespace Toolkit
82
83 } // namespace Dali
84
85 #endif /* __DALI_TOOLKIT_INTERNAL_RADIAL_GRADIENT_H__ */