#define DALI_TOOLKIT_INTERNAL_ANIMATED_IMAGE_VISUAL_H
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
*/
// EXTERNAL INCLUDES
+#include <dali/devel-api/actors/actor-devel.h>
+#include <dali/public-api/adaptor-framework/window.h>
#include <dali/devel-api/adaptor-framework/animated-image-loading.h>
#include <dali/public-api/adaptor-framework/timer.h>
#include <dali/public-api/common/dali-vector.h>
* @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
* @param[in] shaderFactory The ImageVisualShaderFactory object
* @param[in] imageUrl The URL to animated image resource to use
+ * @param[in] size The width and height of the image. The visual size will be used if these are 0.
*/
- static AnimatedImageVisualPtr New(VisualFactoryCache& factoryCache, ImageVisualShaderFactory& shaderFactory, const VisualUrl& imageUrl);
+ static AnimatedImageVisualPtr New(VisualFactoryCache& factoryCache, ImageVisualShaderFactory& shaderFactory, const VisualUrl& imageUrl, ImageDimensions size = ImageDimensions());
public: // from Visual
/**
*
* @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
* @param[in] shaderFactory The ImageVisualShaderFactory object
+ * @param[in] desiredSize The width and height of the image. The visual size will be used if these are 0.
*/
- AnimatedImageVisual(VisualFactoryCache& factoryCache, ImageVisualShaderFactory& shaderFactory);
+ AnimatedImageVisual(VisualFactoryCache& factoryCache, ImageVisualShaderFactory& shaderFactory, ImageDimensions desiredSize);
/**
* @brief A reference counted object may only be deleted by calling Unreference().
* @brief Called when the next frame is ready.
* @param[in] textureSet the texture set to apply
* @param[in] interval interval(ms) for the frame
+ * @param[in] preMultiplied whether the texture is premultied alpha or not.
*/
- void FrameReady(TextureSet textureSet, uint32_t interval) override;
+ void FrameReady(TextureSet textureSet, uint32_t interval, bool preMultiplied) override;
/**
* @brief Display the next frame. It is called when the mFrameDelayTimer ticks.
*/
void CheckMaskTexture();
+ /**
+ * @brief Callback when the visibility of the actor is changed.
+ */
+ void OnControlVisibilityChanged(Actor actor, bool visible, DevelActor::VisibilityChange::Type type);
+
+ /**
+ * @brief Callback when the visibility of the window is changed.
+ */
+ void OnWindowVisibilityChanged(Window window, bool visible);
+
// Undefined
AnimatedImageVisual(const AnimatedImageVisual& animatedImageVisual);
private:
Timer mFrameDelayTimer;
+ WeakHandle<Window> mPlacementWindow;
WeakHandle<Actor> mPlacementActor;
ImageVisualShaderFactory& mImageVisualShaderFactory;
Dali::Toolkit::ImageVisual::LoadPolicy::Type mLoadPolicy;
Dali::Toolkit::ImageVisual::ReleasePolicy::Type mReleasePolicy;
TextureManager::MaskingDataPointer mMaskingData;
+ Dali::ImageDimensions mDesiredSize;
// Shared variables
uint32_t mFrameCount; // Number of frames
DevelAnimatedImageVisual::Action::Type mActionStatus;
- Dali::WrapMode::Type mWrapModeU : 3;
- Dali::WrapMode::Type mWrapModeV : 3;
- DevelImageVisual::StopBehavior::Type mStopBehavior : 2;
- bool mStartFirstFrame : 1;
- bool mIsJumpTo : 1;
+ Dali::WrapMode::Type mWrapModeU : 3;
+ Dali::WrapMode::Type mWrapModeV : 3;
+ Dali::FittingMode::Type mFittingMode : 3;
+ Dali::SamplingMode::Type mSamplingMode : 4;
+ DevelImageVisual::StopBehavior::Type mStopBehavior : 2;
+ bool mStartFirstFrame : 1;
+ bool mIsJumpTo : 1;
};
} // namespace Internal