/*
- * Copyright (c) 2019 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.
*/
// CLASS HEADER
-#include <dali/devel-api/adaptor-framework/gif-loading.h>
+#include <dali/internal/imaging/common/gif-loading.h>
// EXTERNAL INCLUDES
#include <sys/types.h>
namespace Dali
{
+namespace Internal
+{
+
+namespace Adaptor
+{
+
namespace
{
#if defined(DEBUG_ENABLED)
ImageProperties imageProperties;
};
-std::unique_ptr<GifLoading> GifLoading::New( const std::string &url, bool isLocalResource )
+AnimatedImageLoadingPtr GifLoading::New( const std::string &url, bool isLocalResource )
{
- return std::unique_ptr<GifLoading>( new GifLoading( url, isLocalResource ) );
+ return AnimatedImageLoadingPtr( new GifLoading( url, isLocalResource ) );
}
GifLoading::GifLoading( const std::string &url, bool isLocalResource )
delete mImpl;
}
-bool GifLoading::LoadNextNFrames( int frameStartIndex, int count, std::vector<Dali::PixelData> &pixelData )
+bool GifLoading::LoadNextNFrames( uint32_t frameStartIndex, int count, std::vector<Dali::PixelData> &pixelData )
{
int error;
bool ret = false;
return ret;
}
-bool GifLoading::LoadAllFrames( std::vector<Dali::PixelData> &pixelData, Dali::Vector<uint32_t> &frameDelays )
-{
- if( LoadFrameDelays( frameDelays ) )
- {
- return LoadNextNFrames( 0, mImpl->loaderInfo.animated.frameCount, pixelData );
- }
- return false;
-}
-
-ImageDimensions GifLoading::GetImageSize()
+ImageDimensions GifLoading::GetImageSize() const
{
return ImageDimensions( mImpl->imageProperties.w, mImpl->imageProperties.h );
}
-int GifLoading::GetImageCount()
+uint32_t GifLoading::GetImageCount() const
{
return mImpl->loaderInfo.animated.frameCount;
}
-bool GifLoading::LoadFrameDelays( Dali::Vector<uint32_t> &frameDelays )
+uint32_t GifLoading::GetFrameInterval( uint32_t frameIndex ) const
{
- frameDelays.Clear();
+ return mImpl->loaderInfo.animated.frames[frameIndex].info.delay * 10;
+}
- for( auto &&elem : mImpl->loaderInfo.animated.frames )
- {
- // Read frame delay time, multiply 10 to change time unit to milliseconds
- frameDelays.PushBack( elem.info.delay * 10 );
- }
+} // namespace Adaptor
- return true;
-}
+} // namespace Internal
-} // namespace Dali
+} // namespace Dali
\ No newline at end of file