#define DALI_TOOLKIT_INTERNAL_ANIMATED_IMAGE_VISUAL_H
/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include <dali/public-api/math/vector4.h>
#include <dali/public-api/object/weak-handle.h>
#include <dali/public-api/adaptor-framework/timer.h>
-#include <dali/devel-api/adaptor-framework/gif-loading.h>
+#include <dali/devel-api/adaptor-framework/animated-image-loading.h>
// INTERNAL INCLUDES
#include <dali-toolkit/internal/visuals/visual-base-impl.h>
#include <dali-toolkit/internal/visuals/visual-url.h>
#include <dali-toolkit/internal/visuals/animated-image/image-cache.h>
#include <dali-toolkit/devel-api/visuals/animated-image-visual-actions-devel.h>
+#include <dali-toolkit/devel-api/visuals/image-visual-properties-devel.h>
namespace Dali
{
*
* @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
* @param[in] shaderFactory The ImageVisualShaderFactory object
- * @param[in] imageUrl The URL to gif resource to use
+ * @param[in] imageUrl The URL to animated image resource to use
* @param[in] properties A Property::Map containing settings for this visual
* @return A smart-pointer to the newly allocated visual.
*/
/**
* @copydoc Visual::Base::GetNaturalSize
*/
- virtual void GetNaturalSize( Vector2& naturalSize );
+ void GetNaturalSize( Vector2& naturalSize ) override;
/**
* @copydoc Visual::Base::CreatePropertyMap
*/
- virtual void DoCreatePropertyMap( Property::Map& map ) const;
+ void DoCreatePropertyMap( Property::Map& map ) const override;
/**
* @copydoc Visual::Base::CreateInstancePropertyMap
*/
- virtual void DoCreateInstancePropertyMap( Property::Map& map ) const;
+ void DoCreateInstancePropertyMap( Property::Map& map ) const override;
/**
* @copydoc Visual::Base::OnDoAction
*/
- virtual void OnDoAction( const Dali::Property::Index actionName, const Dali::Property::Value& attributes ) override;
+ void OnDoAction( const Dali::Property::Index actionName, const Dali::Property::Value& attributes ) override;
protected:
/**
* @brief A reference counted object may only be deleted by calling Unreference().
*/
- virtual ~AnimatedImageVisual();
+ ~AnimatedImageVisual() override;
/**
* @copydoc Visual::Base::DoSetProperties
*/
- virtual void DoSetProperties( const Property::Map& propertyMap );
+ void DoSetProperties( const Property::Map& propertyMap ) override;
/**
* Helper method to set individual values by index key.
void DoSetProperty( Property::Index index, const Property::Value& value );
/**
- * @copydoc Visual::Base::DoSetOnStage
+ * @copydoc Visual::Base::DoSetOnScene
*/
- virtual void DoSetOnStage( Actor& actor );
+ void DoSetOnScene( Actor& actor ) override;
/**
- * @copydoc Visual::Base::DoSetOffStage
+ * @copydoc Visual::Base::DoSetOffScene
*/
- virtual void DoSetOffStage( Actor& actor );
+ void DoSetOffScene( Actor& actor ) override;
/**
* @copydoc Visual::Base::OnSetTransform
*/
- virtual void OnSetTransform();
+ void OnSetTransform() override;
private:
/**
* Called when the next frame is ready.
* @param[in] textureSet the texture set to apply
*/
- void FrameReady( TextureSet textureSet );
+ void FrameReady( TextureSet textureSet ) override;
/**
* Display the next frame. It is called when the mFrameDelayTimer ticks.
bool DisplayNextFrame();
/**
- * Initialize the gif variables.
- * @param[in] imageUrl The url of the animated gif
+ * Initialize the animated image variables.
+ * @param[in] imageUrl The url of the animated image
*/
- void InitializeGif( const VisualUrl& imageUrl );
+ void InitializeAnimatedImage( const VisualUrl& imageUrl );
// Undefined
AnimatedImageVisual( const AnimatedImageVisual& animatedImageVisual );
WeakHandle<Actor> mPlacementActor;
ImageVisualShaderFactory& mImageVisualShaderFactory;
- // Variables for GIF player
- Dali::Vector<uint32_t> mFrameDelayContainer;
+ // Variables for Animated Image player
Vector4 mPixelArea;
VisualUrl mImageUrl;
- std::unique_ptr<Dali::GifLoading> mGifLoading; // Only needed for animated gifs
- uint32_t mCurrentFrameIndex; // Frame index into textureRects
+ Dali::AnimatedImageLoading mAnimatedImageLoading; // Only needed for animated image
+ uint32_t mFrameIndexForJumpTo; // Frame index into textureRects
// Variables for Multi-Image player
ImageCache::UrlList* mImageUrls;
Dali::WrapMode::Type mWrapModeU:3;
Dali::WrapMode::Type mWrapModeV:3;
DevelAnimatedImageVisual::Action::Type mActionStatus:3;
+ DevelImageVisual::StopBehavior::Type mStopBehavior:2;
bool mStartFirstFrame:1;
+ bool mIsJumpTo:1;
};
} // namespace Internal