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