#include <string>
// INTERNAL INCLUDES
+#include "image-loading.h"
#include "bitmap-loader-impl.h"
-#include "image-loaders/image-loader.h"
namespace Dali
{
}
BitmapLoader::BitmapLoader(const std::string& url,
- ImageDimensions size,
- FittingMode::Type fittingMode,
- SamplingMode::Type samplingMode,
- bool orientationCorrection)
-: mResourceType( size, fittingMode, samplingMode, orientationCorrection ),
- mBitmap(NULL),
+ ImageDimensions size,
+ FittingMode::Type fittingMode,
+ SamplingMode::Type samplingMode,
+ bool orientationCorrection )
+: mPixelData(),
mUrl(url),
- mIsLoaded( false )
+ mSize( size ),
+ mFittingMode( fittingMode ),
+ mSamplingMode( samplingMode ),
+ mOrientationCorrection( orientationCorrection )
{
}
void BitmapLoader::Load()
{
- IntrusivePtr<Dali::RefObject> resource = TizenPlatform::ImageLoader::LoadResourceSynchronously( mResourceType, mUrl );
-
- mBitmap = static_cast<Integration::Bitmap*>(resource.Get());
- mIsLoaded = true;
+ mPixelData = Dali::LoadImageFromFile( mUrl, mSize, mFittingMode, mSamplingMode, mOrientationCorrection );
}
bool BitmapLoader::IsLoaded()
{
- return mIsLoaded;
-}
-
-unsigned char* BitmapLoader::GetPixelData() const
-{
- if( mIsLoaded )
- {
- return mBitmap->GetBuffer();
- }
-
- return NULL;
+ return mPixelData ? true : false ;
}
-unsigned int BitmapLoader::GetImageHeight() const
+const std::string& BitmapLoader::GetUrl() const
{
- if( mIsLoaded )
- {
- return mBitmap->GetImageHeight();
- }
-
- return 0u;
+ return mUrl;
}
-unsigned int BitmapLoader::GetImageWidth() const
+Dali::PixelData BitmapLoader::GetPixelData() const
{
- if( mIsLoaded )
- {
- return mBitmap->GetImageWidth();
- }
-
- return 0u;
-}
-
-Pixel::Format BitmapLoader::GetPixelFormat() const
-{
- if( mIsLoaded )
- {
- return mBitmap->GetPixelFormat();
- }
-
- return Pixel::RGBA8888;
+ return mPixelData;
}
} // namespace Internal