Texture CubeTransitionApp::LoadStageFillingTexture( const char* filepath )
{
ImageDimensions dimensions( Stage::GetCurrent().GetSize().x, Stage::GetCurrent().GetSize().y );
- BitmapLoader loader = BitmapLoader::New( filepath, dimensions, FittingMode::SCALE_TO_FILL );
- loader.Load();
- PixelData pixelData = loader.GetPixelData();
+ Devel::PixelBuffer pixelBuffer = LoadImageFromFile( filepath, dimensions, FittingMode::SCALE_TO_FILL );
+ PixelData pixelData = Devel::PixelBuffer::Convert(pixelBuffer);
+
Texture texture = Texture::New( TextureType::TEXTURE_2D, pixelData.GetPixelFormat(), pixelData.GetWidth(), pixelData.GetHeight() );
texture.Upload( pixelData );
return texture;
*/
#include <dali/dali.h>
-#include <dali/devel-api/adaptor-framework/bitmap-loader.h>
#include <dali/public-api/rendering/geometry.h>
#include <dali/public-api/rendering/texture.h>
+#include <dali/devel-api/adaptor-framework/image-loading.h>
namespace DemoHelper
{
-Dali::PixelData LoadPixelData( const char* imagePath,
- Dali::ImageDimensions size,
- Dali::FittingMode::Type fittingMode,
- Dali::SamplingMode::Type samplingMode )
-{
- Dali::BitmapLoader loader = Dali::BitmapLoader::New( imagePath, size, fittingMode, samplingMode );
- loader.Load();
- return loader.GetPixelData();
-}
-
Dali::Texture LoadTexture( const char* imagePath,
Dali::ImageDimensions size = Dali::ImageDimensions(),
Dali::FittingMode::Type fittingMode = Dali::FittingMode::DEFAULT,
Dali::SamplingMode::Type samplingMode = Dali::SamplingMode::DEFAULT )
{
- Dali::PixelData pixelData = LoadPixelData(imagePath, size, fittingMode, samplingMode);
+ Dali::Devel::PixelBuffer pixelBuffer = LoadImageFromFile(imagePath, size, fittingMode, samplingMode);
Dali::Texture texture = Dali::Texture::New( Dali::TextureType::TEXTURE_2D,
- pixelData.GetPixelFormat(),
- pixelData.GetWidth(),
- pixelData.GetHeight() );
+ pixelBuffer.GetPixelFormat(),
+ pixelBuffer.GetWidth(),
+ pixelBuffer.GetHeight() );
+
+ Dali::PixelData pixelData = Dali::Devel::PixelBuffer::Convert(pixelBuffer);
texture.Upload( pixelData );
return texture;