1 #ifndef __DALI_TOOLKIT_INTERNAL_LINEAR_GRADIENT_H__
2 #define __DALI_TOOLKIT_INTERNAL_LINEAR_GRADIENT_H__
5 * Copyright (c) 2015 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.
21 #include <dali-toolkit/internal/controls/renderers/gradient/gradient.h>
23 #include <dali/public-api/math/vector2.h>
35 * Linear gradients change color evenly along a straight line.
36 * The gradient is defined by an axis (the gradient line) at any specified angles.
38 class LinearGradient : public Gradient
44 * @param[in] startPosition The starting point onto which the 0% gradient stops are mapped.
45 * @param[in] endPosition The ending point r onto which the 100% gradient stops are mapped.
47 LinearGradient( const Vector2& startPosition, const Vector2& endPosition );
52 virtual ~LinearGradient();
55 * Set the starting and ending points of the vector onto which the gradient stops are mapped.
56 * @param[in] startPosition The starting point of the gradient vector.
57 * @param[in] endPosition The ending point of the gradient vector.
59 void SetStartAndEndPosition( const Vector2& startPosition, const Vector2& endPosition );
62 * Get the stating point of the gradient vector.
63 * @return The stating point of the gradient vector.
65 const Vector2& GetStartPosition() const;
68 * Get the ending point of the gradient vector.
69 * @return The ending point of the gradient vector.
71 const Vector2& GetEndPosition() const;
76 LinearGradient( const LinearGradient& gradient );
79 LinearGradient& operator=( const LinearGradient& handle );
83 Vector2 mStartPosition;
87 } // namespace Internal
89 } // namespace Toolkit
93 #endif /* __DALI_TOOLKIT_INTERNAL_LINEAR_GRADIENT_H__ */