1 #ifndef DALI_CANVAS_RENDERER_RADIAL_GRADIENT_H
2 #define DALI_CANVAS_RENDERER_RADIAL_GRADIENT_H
5 * Copyright (c) 2021 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/public-api/object/base-handle.h>
25 #include <dali/devel-api/adaptor-framework/canvas-renderer-gradient.h>
26 #include <dali/devel-api/adaptor-framework/canvas-renderer.h>
27 #include <dali/public-api/dali-adaptor-common.h>
32 * @addtogroup dali_adaptor_framework
36 namespace Internal DALI_INTERNAL
42 } // namespace Adaptor
43 } // namespace DALI_INTERNAL
46 * @brief A class representing the radial gradient fill of the Shape object.
48 class DALI_ADAPTOR_API CanvasRenderer::RadialGradient : public CanvasRenderer::Gradient
52 * @brief Creates an initialized handle to a new CanvasRenderer::RadialGradient.
53 * @return A handle to a newly allocated RadialGradient
55 static RadialGradient New();
59 * @brief Creates an empty handle. Use CanvasRenderer::RadialGradient::New() to create an initialized object.
69 * @brief This copy constructor is required for (smart) pointer semantics.
71 * @param[in] handle A reference to the copied handle
73 RadialGradient(const RadialGradient& handle) = default;
77 * @brief Sets the radial gradient bounds.
78 * The radial gradient bounds are defined as a circle centered in a given point of a given radius.
79 * @param[in] centerPoint The point of the center of the bounding circle.
80 * @param[in] radius The radius of the bounding circle.
81 * @return Returns True when it's successful. False otherwise.
83 bool SetBounds(Vector2 centerPoint, float radius);
86 * @brief Gets the radial gradient bounds.
87 * @param[out] centerPoint The point used to determine the gradient bounds.
88 * @param[out] radius The radius of the bounding circle.
89 * @return Returns True when it's successful. False otherwise.
91 bool GetBounds(Vector2& centerPoint, float& radius) const;
93 public: // Not intended for application developers
96 * @brief The constructor.
97 * @note Not intended for application developers.
99 * @param[in] pointer A pointer to a newly allocated CanvasRenderer::RadialGradient
101 explicit DALI_INTERNAL RadialGradient(Internal::Adaptor::RadialGradient* impl);
110 #endif // DALI_CANVAS_RENDERER_RADIAL_GRADIENT_H