1 #ifndef __DALI_TOOLKIT_CAROUSEL_EFFECT_H__
2 #define __DALI_TOOLKIT_CAROUSEL_EFFECT_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.
22 #include <dali/public-api/shader-effects/shader-effect.h>
31 * CarouselEffect is a custom shader effect to achieve Carousel effects in actors
33 * A Carousel has a Radius property which can be +ve (appear as if viewing from the outside of
35 * or -ve (appear as if viewing from the inside of a cylinder/sphere).
37 * It can be a horizontal or vertical (cylindrical) or both (spherical). The AnglePerUnit
38 * property provides this functionality as a Vector2.
40 * Finally, the carousel's center position can be specified as a Screen coordinate (top-left being
43 class DALI_IMPORT_API CarouselEffect : public ShaderEffect
48 * Create an uninitialized CarouselEffect; this can be initialized with CarouselEffect::New()
49 * Calling member functions with an uninitialized Dali::Object is not allowed.
56 * This is non-virtual since derived Handle types must not contain data or virtual methods.
61 * Create an initialized CarouselEffect.
62 * @return A handle to a newly allocated Dali resource.
64 static CarouselEffect New();
67 * Set the radius of the Carousel effect.
68 * A positive Radius will bend toward the camera,
69 * while a negative Radius will bend away from the camera.
70 * @param[in] radius The new radius.
72 void SetRadius( float radius);
75 * Sets the center point of the carousel (in screen coordinates)
76 * this is where the peek of the carousel should appear.
77 * this defaults to top-left corner (0.0f, 0.0f).
79 * @param[in] center The center point.
81 void SetCenter( const Vector2& center );
84 * Set the angle deviation of Carousel in degrees per
85 * geometric unit for each axis. For example if you
86 * wish for the horizontal angle deviation to vary from +/- 10
87 * degrees, then a Value of 20.0f / stageWidth for the X
88 * component should be specified.
90 * @param[in] angle the Angle Spread in X and Y axes.
92 void SetAnglePerUnit( const Vector2& angle );
95 * Get the name for the radius property
96 * @return A std::string containing the property name
98 const std::string& GetRadiusPropertyName() const;
101 * Get the name for the center property
102 * @return A std::string containing the property name
104 const std::string& GetCenterPropertyName() const;
107 * Get the name for the angle spread property
108 * @return A std::string containing the property name
110 const std::string& GetAnglePerUnitPropertyName() const;
113 private: // Not intended for application developers
114 DALI_INTERNAL CarouselEffect(ShaderEffect handle);
117 } // namespace Toolkit
121 #endif // __DALI_TOOLKIT_CAROUSEL_EFFECT_H__