1 #ifndef __DALI_TOOLKIT_IMAGE_REGION_EFFECT_H__
2 #define __DALI_TOOLKIT_IMAGE_REGION_EFFECT_H__
5 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
7 // Licensed under the Flora License, Version 1.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://floralicense.org/license/
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 * @addtogroup CAPI_DALI_FRAMEWORK
26 #include <dali/dali.h>
28 namespace Dali DALI_IMPORT_API
35 * ImageRegionEffect is a custom shader effect to show only a region of an Image actor
37 class ImageRegionEffect : public ShaderEffect
42 * Create an uninitialized ImageRegionEffect; this can be initialized with ImageRegionEffect::New()
43 * Calling member functions with an uninitialized Dali::Object is not allowed.
50 virtual ~ImageRegionEffect();
53 * Create an initialized ~ImageRegionEffect.
54 * @return A handle to a newly allocated Dali resource.
56 static ImageRegionEffect New();
59 * Set the top-left corner of the image region.
60 * The coordinates are in percentage, (0,0) being the top-left and (1,1) the bottom right of the original image.
61 * @param [in] point The top-left corner of the region.
63 void SetTopLeft(const Vector2& point);
66 * Set the bottom-right corner of the image region.
67 * The coordinates are in percentage, (0,0) being the top-left and (1,1) the bottom right of the original image.
68 * @param [in] point The bottom-right corner of the region.
70 void SetBottomRight(const Vector2& point);
73 * Get the name for the top-left point property
74 * which can be used in Animation API's
75 * @return A std::string containing the property name
77 const std::string& GetTopLeftPropertyName() const;
80 * Get the name for the bottom-right point property
81 * which can be used in Animation API's
82 * @return A std::string containing the property name
84 const std::string& GetBottomRightPropertyName() const;
86 private: // Not intended for application developers
87 ImageRegionEffect(ShaderEffect handle);
90 } // namespace Toolkit
97 #endif // __DALI_TOOLKIT_IMAGE_REGION_EFFECT_H__