// INTERNAL INCLUDES
#include <dali-toolkit/internal/visuals/visual-base-impl.h>
+#include <dali-toolkit/internal/visuals/visual-url.h>
namespace Dali
{
*
* The following property is essential
*
- * | %Property Name | Type |
- * |--------------------------|------------------|
- * | url | STRING |
+ * | %Property Name | Type |
+ * |------------------- |-------------------|
+ * | url | STRING |
+ * | pixelArea | VECTOR4 |
+ * | wrapModeU | INTEGER OR STRING |
+ * | wrapModeV | INTEGER OR STRING |
*
+ * where pixelArea is a rectangular area.
+ * In its Vector4 value, the first two elements indicate the top-left position of the area,
+ * and the last two elements are the area width and height respectively.
+ * If not specified, the default value is [0.0, 0.0, 1.0, 1.0], i.e. the entire area of the image.
+ *
+ * where wrapModeU and wrapModeV separately decide how the texture should be sampled when the u and v coordinate exceeds the range of 0.0 to 1.0.
+ * Its value should be one of the following wrap mode:
+ * "DEFAULT"
+ * "CLAMP_TO_EDGE"
+ * "REPEAT"
+ * "MIRRORED_REPEAT"
*/
class AnimatedImageVisual : public Visual::Base, public ConnectionTracker
* @param[in] properties A Property::Map containing settings for this visual
* @return A smart-pointer to the newly allocated visual.
*/
- static AnimatedImageVisualPtr New( VisualFactoryCache& factoryCache, const std::string& imageUrl, const Property::Map& properties );
+ static AnimatedImageVisualPtr New( VisualFactoryCache& factoryCache, const VisualUrl& imageUrl, const Property::Map& properties );
/**
* @brief Create the animated image visual using the image URL.
* @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
* @param[in] imageUrl The URL to animated image resource to use
*/
- static AnimatedImageVisualPtr New( VisualFactoryCache& factoryCache, const std::string& imageUrl );
+ static AnimatedImageVisualPtr New( VisualFactoryCache& factoryCache, const VisualUrl& imageUrl );
public: // from Visual
*/
virtual void DoCreatePropertyMap( Property::Map& map ) const;
+ /**
+ * @copydoc Visual::Base::CreateInstancePropertyMap
+ */
+ virtual void DoCreateInstancePropertyMap( Property::Map& map ) const;
+
protected:
/**
Timer mFrameDelayTimer;
Dali::Vector<Vector4> mTextureRectContainer;
Dali::Vector<uint32_t> mFrameDelayContainer;
- std::string mImageUrl;
+ Vector4 mPixelArea;
+ VisualUrl mImageUrl;
+
ImageDimensions mImageSize;
uint32_t mCurrentFrameIndex;
+ Dali::WrapMode::Type mWrapModeU:3;
+ Dali::WrapMode::Type mWrapModeV:3;
};
} // namespace Internal