Change-Id: I602e070cd948e17edec3b25b1de52b9f49e08ea7
Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
#include <dali/public-api/signals/callback.h>
#include <string.h>
#include <dali/public-api/signals/callback.h>
#include <string.h>
+// INTERNAL HEADERS
+#include <dali-toolkit/internal/image-loader/async-image-loader-impl.h>
+
namespace Dali
{
namespace Toolkit
namespace Dali
{
namespace Toolkit
}
bool ImageAtlas::Upload(Vector4& textureRect,
}
bool ImageAtlas::Upload(Vector4& textureRect,
- const std::string& url,
ImageDimensions size,
FittingMode::Type fittingMode,
bool orientationCorrection,
ImageDimensions size,
FittingMode::Type fittingMode,
bool orientationCorrection,
ImageDimensions zero;
if(size == zero) // image size not provided
{
ImageDimensions zero;
if(size == zero) // image size not provided
{
- dimensions = Dali::GetClosestImageSize(url);
+ dimensions = Dali::GetClosestImageSize(url.GetUrl());
if(dimensions == zero) // Fail to read the image & broken image file exists
{
if(!mBrokenImageUrl.empty())
if(dimensions == zero) // Fail to read the image & broken image file exists
{
if(!mBrokenImageUrl.empty())
unsigned int packPositionY = 0;
if(mPacker.Pack(dimensions.GetWidth(), dimensions.GetHeight(), packPositionX, packPositionY))
{
unsigned int packPositionY = 0;
if(mPacker.Pack(dimensions.GetWidth(), dimensions.GetHeight(), packPositionX, packPositionY))
{
- unsigned short loadId = mAsyncLoader.Load(url, size, fittingMode, SamplingMode::BOX_THEN_LINEAR, orientationCorrection);
+ unsigned short loadId = GetImplementation(mAsyncLoader).Load(url, size, fittingMode, SamplingMode::BOX_THEN_LINEAR, orientationCorrection, DevelAsyncImageLoader::PreMultiplyOnLoad::OFF);
mLoadingTaskInfoContainer.PushBack(new LoadingTaskInfo(loadId, packPositionX, packPositionY, dimensions.GetWidth(), dimensions.GetHeight(), atlasUploadObserver));
// apply the half pixel correction
textureRect.x = (static_cast<float>(packPositionX) + 0.5f) / mWidth; // left
mLoadingTaskInfoContainer.PushBack(new LoadingTaskInfo(loadId, packPositionX, packPositionY, dimensions.GetWidth(), dimensions.GetHeight(), atlasUploadObserver));
// apply the half pixel correction
textureRect.x = (static_cast<float>(packPositionX) + 0.5f) / mWidth; // left
#include <dali-toolkit/devel-api/image-loader/image-atlas.h>
#include <dali-toolkit/internal/image-loader/atlas-packer.h>
#include <dali-toolkit/public-api/image-loader/async-image-loader.h>
#include <dali-toolkit/devel-api/image-loader/image-atlas.h>
#include <dali-toolkit/internal/image-loader/atlas-packer.h>
#include <dali-toolkit/public-api/image-loader/async-image-loader.h>
+#include <dali-toolkit/internal/visuals/visual-url.h>
* @copydoc Toolkit::ImageAtlas::Upload( Vector4&, const std::string&, ImageDimensions,FittingMode::Type, bool )
*/
bool Upload(Vector4& textureRect,
* @copydoc Toolkit::ImageAtlas::Upload( Vector4&, const std::string&, ImageDimensions,FittingMode::Type, bool )
*/
bool Upload(Vector4& textureRect,
- const std::string& url,
ImageDimensions size,
FittingMode::Type fittingMode,
bool orientationCorrection,
ImageDimensions size,
FittingMode::Type fittingMode,
bool orientationCorrection,
// EXTERNAL HEADER
#include <dali/devel-api/adaptor-framework/image-loading.h>
// EXTERNAL HEADER
#include <dali/devel-api/adaptor-framework/image-loading.h>
+// INTERNAL HEADERS
+#include <dali-toolkit/internal/image-loader/image-atlas-impl.h>
+
namespace Dali
{
namespace Toolkit
namespace Dali
{
namespace Toolkit
}
TextureSet ImageAtlasManager::Add(Vector4& textureRect,
}
TextureSet ImageAtlasManager::Add(Vector4& textureRect,
- const std::string& url,
ImageDimensions& size,
FittingMode::Type fittingMode,
bool orientationCorrection,
ImageDimensions& size,
FittingMode::Type fittingMode,
bool orientationCorrection,
ImageDimensions zero;
if(size == zero)
{
ImageDimensions zero;
if(size == zero)
{
- dimensions = Dali::GetClosestImageSize(url);
+ dimensions = Dali::GetClosestImageSize(url.GetUrl());
}
// big image, atlasing is not applied
}
// big image, atlasing is not applied
unsigned int i = 0;
for(AtlasContainer::iterator iter = mAtlasList.begin(); iter != mAtlasList.end(); ++iter)
{
unsigned int i = 0;
for(AtlasContainer::iterator iter = mAtlasList.begin(); iter != mAtlasList.end(); ++iter)
{
- if((*iter).Upload(textureRect, url, size, fittingMode, orientationCorrection, atlasUploadObserver))
+ if(GetImplementation(*iter).Upload(textureRect, url, size, fittingMode, orientationCorrection, atlasUploadObserver))
{
return mTextureSetList[i];
}
{
return mTextureSetList[i];
}
- mAtlasList.back().Upload(textureRect, url, size, fittingMode, orientationCorrection, atlasUploadObserver);
+ GetImplementation(mAtlasList.back()).Upload(textureRect, url, size, fittingMode, orientationCorrection, atlasUploadObserver);
return mTextureSetList.back();
}
return mTextureSetList.back();
}
// INTERNAL INCLUDES
#include <dali-toolkit/devel-api/image-loader/image-atlas.h>
// INTERNAL INCLUDES
#include <dali-toolkit/devel-api/image-loader/image-atlas.h>
+#include <dali-toolkit/internal/visuals/visual-url.h>
* @return The texture set containing the image.
*/
TextureSet Add(Vector4& textureRect,
* @return The texture set containing the image.
*/
TextureSet Add(Vector4& textureRect,
- const std::string& url,
ImageDimensions& size,
FittingMode::Type fittingMode = FittingMode::DEFAULT,
bool orientationCorrection = true,
ImageDimensions& size,
FittingMode::Type fittingMode = FittingMode::DEFAULT,
bool orientationCorrection = true,
return mObserverList.Count();
}
return mObserverList.Count();
}
-void NPatchData::SetUrl(const std::string url)
+void NPatchData::SetUrl(const VisualUrl& url)
-std::string NPatchData::GetUrl() const
+VisualUrl NPatchData::GetUrl() const
// INTERNAL INCLUDES
#include <dali-toolkit/devel-api/utility/npatch-utilities.h>
#include <dali-toolkit/internal/visuals/texture-manager-impl.h>
// INTERNAL INCLUDES
#include <dali-toolkit/devel-api/utility/npatch-utilities.h>
#include <dali-toolkit/internal/visuals/texture-manager-impl.h>
+#include <dali-toolkit/internal/visuals/visual-url.h>
*
* @param [in] url NPatch image url
*/
*
* @param [in] url NPatch image url
*/
- void SetUrl(const std::string url);
+ void SetUrl(const VisualUrl& url);
/**
* @brief Retrieve the image url.
*
* @return Return the image url.
*/
/**
* @brief Retrieve the image url.
*
* @return Return the image url.
*/
- std::string GetUrl() const;
+ VisualUrl GetUrl() const;
/**
* @brief Set texture set on the cache data
/**
* @brief Set texture set on the cache data
NPatchDataId mId;
ObserverListType mObserverList; ///< Container used to store all observer clients of this Texture
NPatchDataId mId;
ObserverListType mObserverList; ///< Container used to store all observer clients of this Texture
- std::string mUrl; ///< Url of the N-Patch
+ VisualUrl mUrl; ///< Url of the N-Patch
TextureSet mTextureSet; ///< Texture containing the cropped image
NPatchUtility::StretchRanges mStretchPixelsX; ///< X stretch pixels
NPatchUtility::StretchRanges mStretchPixelsY; ///< Y stretch pixels
TextureSet mTextureSet; ///< Texture containing the cropped image
NPatchUtility::StretchRanges mStretchPixelsX; ///< X stretch pixels
NPatchUtility::StretchRanges mStretchPixelsY; ///< Y stretch pixels
return mCurrentNPatchDataId++;
}
return mCurrentNPatchDataId++;
}
-std::size_t NPatchLoader::Load(TextureManager& textureManager, TextureUploadObserver* textureObserver, const std::string& url, const Rect<int>& border, bool& preMultiplyOnLoad, bool synchronousLoading)
+std::size_t NPatchLoader::Load(TextureManager& textureManager, TextureUploadObserver* textureObserver, const VisualUrl& url, const Rect<int>& border, bool& preMultiplyOnLoad, bool synchronousLoading)
- std::size_t hash = CalculateHash(url);
+ std::size_t hash = CalculateHash(url.GetUrl());
OwnerContainer<NPatchData*>::SizeType index = UNINITIALIZED_ID;
const OwnerContainer<NPatchData*>::SizeType count = mCache.Count();
OwnerContainer<NPatchData*>::SizeType index = UNINITIALIZED_ID;
const OwnerContainer<NPatchData*>::SizeType count = mCache.Count();
if(mCache[index]->GetHash() == hash)
{
// hash match, check url as well in case of hash collision
if(mCache[index]->GetHash() == hash)
{
// hash match, check url as well in case of hash collision
- if(mCache[index]->GetUrl() == url)
+ if(mCache[index]->GetUrl().GetUrl() == url.GetUrl())
{
// Use cached data
if(mCache[index]->GetBorder() == border)
{
// Use cached data
if(mCache[index]->GetBorder() == border)
#include <dali-toolkit/devel-api/utility/npatch-utilities.h>
#include <dali-toolkit/internal/visuals/npatch-data.h>
#include <dali-toolkit/internal/visuals/texture-manager-impl.h>
#include <dali-toolkit/devel-api/utility/npatch-utilities.h>
#include <dali-toolkit/internal/visuals/npatch-data.h>
#include <dali-toolkit/internal/visuals/texture-manager-impl.h>
+#include <dali-toolkit/internal/visuals/visual-url.h>
* @param [in] synchronousLoading True if the image will be loaded in synchronous time.
* @return id of the texture.
*/
* @param [in] synchronousLoading True if the image will be loaded in synchronous time.
* @return id of the texture.
*/
- std::size_t Load(TextureManager& textureManager, TextureUploadObserver* textureObserver, const std::string& url, const Rect<int>& border, bool& preMultiplyOnLoad, bool synchronousLoading);
+ std::size_t Load(TextureManager& textureManager, TextureUploadObserver* textureObserver, const VisualUrl& url, const Rect<int>& border, bool& preMultiplyOnLoad, bool synchronousLoading);
/**
* @brief Set loaded PixelBuffer and its information
/**
* @brief Set loaded PixelBuffer and its information
if(mId == NPatchData::INVALID_NPATCH_DATA_ID && mImageUrl.IsLocalResource())
{
bool preMultiplyOnLoad = IsPreMultipliedAlphaEnabled() && !mImpl->mCustomShader ? true : false;
if(mId == NPatchData::INVALID_NPATCH_DATA_ID && mImageUrl.IsLocalResource())
{
bool preMultiplyOnLoad = IsPreMultipliedAlphaEnabled() && !mImpl->mCustomShader ? true : false;
- mId = mLoader.Load(textureManager, this, mImageUrl.GetUrl(), mBorder, preMultiplyOnLoad, synchronousLoading);
+ mId = mLoader.Load(textureManager, this, mImageUrl, mBorder, preMultiplyOnLoad, synchronousLoading);
const NPatchData* data;
if(mLoader.GetNPatchData(mId, data) && data->GetLoadingState() == NPatchData::LoadingState::LOAD_COMPLETE)
const NPatchData* data;
if(mLoader.GetNPatchData(mId, data) && data->GetLoadingState() == NPatchData::LoadingState::LOAD_COMPLETE)
#include <string>
// INTERNAL HEADERS
#include <string>
// INTERNAL HEADERS
+#include <dali-toolkit/internal/image-loader/async-image-loader-impl.h>
#include <dali-toolkit/internal/image-loader/image-atlas-impl.h>
#include <dali-toolkit/internal/visuals/image-atlas-manager.h>
#include <dali-toolkit/internal/visuals/rendering-addon.h>
#include <dali-toolkit/internal/image-loader/image-atlas-impl.h>
#include <dali-toolkit/internal/visuals/image-atlas-manager.h>
#include <dali-toolkit/internal/visuals/rendering-addon.h>
uint32_t frameIndex)
{
mLoadingInfoContainer.push_back(AsyncLoadingInfo(textureId));
uint32_t frameIndex)
{
mLoadingInfoContainer.push_back(AsyncLoadingInfo(textureId));
- auto id = DevelAsyncImageLoader::LoadAnimatedImage(mLoader, animatedImageLoading, frameIndex);
+ auto id = GetImplementation(mLoader).LoadAnimatedImage(animatedImageLoading, frameIndex);
mLoadingInfoContainer.back().loadId = id;
}
mLoadingInfoContainer.back().loadId = id;
}
DevelAsyncImageLoader::PreMultiplyOnLoad preMultiplyOnLoad)
{
mLoadingInfoContainer.push_back(AsyncLoadingInfo(textureId));
DevelAsyncImageLoader::PreMultiplyOnLoad preMultiplyOnLoad)
{
mLoadingInfoContainer.push_back(AsyncLoadingInfo(textureId));
- auto id = DevelAsyncImageLoader::Load(mLoader, url.GetUrl(), desiredSize, fittingMode, samplingMode, orientationCorrection, preMultiplyOnLoad);
+ auto id = GetImplementation(mLoader).Load(url, desiredSize, fittingMode, samplingMode, orientationCorrection, preMultiplyOnLoad);
mLoadingInfoContainer.back().loadId = id;
}
mLoadingInfoContainer.back().loadId = id;
}
DevelAsyncImageLoader::PreMultiplyOnLoad preMultiplyOnLoad)
{
mLoadingInfoContainer.push_back(AsyncLoadingInfo(textureId));
DevelAsyncImageLoader::PreMultiplyOnLoad preMultiplyOnLoad)
{
mLoadingInfoContainer.push_back(AsyncLoadingInfo(textureId));
- auto id = DevelAsyncImageLoader::ApplyMask(mLoader, pixelBuffer, maskPixelBuffer, contentScale, cropToMask, preMultiplyOnLoad);
+ auto id = GetImplementation(mLoader).ApplyMask(pixelBuffer, maskPixelBuffer, contentScale, cropToMask, preMultiplyOnLoad);
mLoadingInfoContainer.back().loadId = id;
}
mLoadingInfoContainer.back().loadId = id;
}