unsigned char* buffer = static_cast<unsigned char*>(malloc(bufferSize));
memset(buffer, 0, bufferSize);
- mPixelData = PixelData::New( buffer, mSize.GetWidth(), mSize.GetHeight(), Pixel::RGBA8888, PixelData::FREE);
+ mPixelData = Dali::PixelData::New( buffer, mSize.GetWidth(), mSize.GetHeight(), Pixel::RGBA8888, Dali::PixelData::FREE);
sem_post( &mySemaphore );
}
- PixelDataPtr GetPixelData() const
+ Dali::PixelData GetPixelData() const
{
return mPixelData;
}
}
ImageDimensions mSize;
- PixelDataPtr mPixelData;
+ Dali::PixelData mPixelData;
const std::string mUrl;
sem_t mySemaphore;
};
{
GetImplementation(*this).Load();
}
-PixelDataPtr Dali::BitmapLoader::GetPixelData() const
+PixelData Dali::BitmapLoader::GetPixelData() const
{
return GetImplementation(*this).GetPixelData();
}
void Load();
bool IsLoaded();
std::string GetUrl() const;
- PixelDataPtr GetPixelData() const;
+ PixelData GetPixelData() const;
void WaitForLoading();
static BitmapLoader GetLatestCreated(); // return the latest created BitmapLoader
return GetImplementation(*this).Upload( textureRect, url, size, fittingMode, orientationCorrection );
}
-bool ImageAtlas::Upload( Vector4& textureRect, PixelDataPtr pixelData )
+bool ImageAtlas::Upload( Vector4& textureRect, PixelData pixelData )
{
return GetImplementation(*this).Upload( textureRect, pixelData );
}
* @param [out] textureRect The texture area of the resource image in the atlas.
* @param [in] pixelData The pixel data.
*/
- bool Upload( Vector4& textureRect, PixelDataPtr pixelData );
+ bool Upload( Vector4& textureRect, PixelData pixelData );
/**
* @brief Remove the image at the given rectangle.
}
TextureSet ImageAtlasManager::Add( Vector4& textureRect,
- PixelDataPtr pixelData )
+ PixelData pixelData )
{
// big buffer, atlasing is not applied
- if( static_cast<uint32_t>(pixelData->GetWidth()) * static_cast<uint32_t>(pixelData->GetHeight()) > MAX_ITEM_AREA
- || pixelData->GetWidth()>DEFAULT_ATLAS_SIZE
- || pixelData->GetHeight()>DEFAULT_ATLAS_SIZE )
+ if( static_cast<uint32_t>(pixelData.GetWidth()) * static_cast<uint32_t>(pixelData.GetHeight()) > MAX_ITEM_AREA
+ || pixelData.GetWidth()>DEFAULT_ATLAS_SIZE
+ || pixelData.GetHeight()>DEFAULT_ATLAS_SIZE )
{
return TextureSet();
}
* @return The texture set containing the image.
*/
TextureSet Add( Vector4& textureRect,
- PixelDataPtr pixelData );
+ PixelData pixelData );
/**
* Remove the image at the given rectangle from the texture set.
// use broken image
return RendererFactory::GetBrokenRendererImage();
}
- Atlas image = Atlas::New( mPixels->GetWidth(), mPixels->GetHeight(), mPixels->GetPixelFormat() );
+ Atlas image = Atlas::New( mPixels.GetWidth(), mPixels.GetHeight(), mPixels.GetPixelFormat() );
image.Upload( mPixels, 0, 0 );
return image;
}
textureSet = mAtlasManager.Add(textureRect, mPixels );
if( !textureSet ) // big image, no atlasing
{
- Atlas image = Atlas::New( mPixels->GetWidth(), mPixels->GetHeight(), mPixels->GetPixelFormat() );
+ Atlas image = Atlas::New( mPixels.GetWidth(), mPixels.GetHeight(), mPixels.GetPixelFormat() );
image.Upload( mPixels, 0, 0 );
textureSet = TextureSet::New();
textureSet.SetImage( 0u, image );
private:
Image mImage;
ImageAtlasManager& mAtlasManager;
- PixelDataPtr mPixels;
+ PixelData mPixels;
std::string mImageUrl;
Dali::ImageDimensions mDesiredSize;
return mSvgRenderer.Get();
}
-PixelDataPtr RasterizingTask::GetPixelData() const
+PixelData RasterizingTask::GetPixelData() const
{
return mPixelData;
}
* Get the rasterization result.
* @return The pixel data with the rasterized pixels.
*/
- PixelDataPtr GetPixelData() const;
+ PixelData GetPixelData() const;
private:
private:
SvgRendererPtr mSvgRenderer;
- PixelDataPtr mPixelData;
+ PixelData mPixelData;
NSVGimage* mParsedSvg;
unsigned int mWidth;
unsigned int mHeight;
}
}
-void SvgRenderer::ApplyRasterizedImage( PixelDataPtr rasterizedPixelData )
+void SvgRenderer::ApplyRasterizedImage( PixelData rasterizedPixelData )
{
if( GetIsOnStage() )
{
}
else // no atlasing
{
- Atlas texture = Atlas::New( rasterizedPixelData->GetWidth(), rasterizedPixelData->GetHeight() );
+ Atlas texture = Atlas::New( rasterizedPixelData.GetWidth(), rasterizedPixelData.GetHeight() );
texture.Upload( rasterizedPixelData, 0, 0 );
if( mAtlasRect == FULL_TEXTURE_RECT )
*
* @param[in] rasterizedPixelData The pixel buffer with the rasterized pixels
*/
- void ApplyRasterizedImage( PixelDataPtr rasterizedPixelData );
+ void ApplyRasterizedImage( PixelData rasterizedPixelData );
private:
/**
return false;
}
-bool ImageAtlas::Upload( Vector4& textureRect, PixelDataPtr pixelData )
+bool ImageAtlas::Upload( Vector4& textureRect, PixelData pixelData )
{
unsigned int packPositionX = 0;
unsigned int packPositionY = 0;
- if( mPacker.Pack( pixelData->GetWidth(), pixelData->GetHeight(), packPositionX, packPositionY ) )
+ if( mPacker.Pack( pixelData.GetWidth(), pixelData.GetHeight(), packPositionX, packPositionY ) )
{
mAtlas.Upload( pixelData, packPositionX, packPositionY );
// apply the half pixel correction
textureRect.x = ( static_cast<float>( packPositionX ) +0.5f ) / mWidth; // left
textureRect.y = ( static_cast<float>( packPositionY ) +0.5f ) / mHeight; // right
- textureRect.z = ( static_cast<float>( packPositionX + pixelData->GetWidth() )-0.5f ) / mWidth; // right
- textureRect.w = ( static_cast<float>( packPositionY + pixelData->GetHeight() )-0.5f ) / mHeight;// bottom
+ textureRect.z = ( static_cast<float>( packPositionX + pixelData.GetWidth() )-0.5f ) / mWidth; // right
+ textureRect.w = ( static_cast<float>( packPositionY + pixelData.GetHeight() )-0.5f ) / mHeight;// bottom
return true;
}
}
else
{
- if( next->loader.GetPixelData()->GetWidth() < next->packRect.width || next->loader.GetPixelData()->GetHeight() < next->packRect.height )
+ if( next->loader.GetPixelData().GetWidth() < next->packRect.width || next->loader.GetPixelData().GetHeight() < next->packRect.height )
{
DALI_LOG_ERROR( "Can not upscale the image from actual loaded size [ %d, %d ] to specified size [ %d, %d ]\n",
- next->loader.GetPixelData()->GetWidth(),
- next->loader.GetPixelData()->GetHeight(),
+ next->loader.GetPixelData().GetWidth(),
+ next->loader.GetPixelData().GetHeight(),
next->packRect.width,
next->packRect.height );
}
{
BitmapLoader loader = BitmapLoader::New(mBrokenImageUrl, ImageDimensions( area.width, area.height ) );
loader.Load();
- SizeType loadedWidth = loader.GetPixelData()->GetWidth();
- SizeType loadedHeight = loader.GetPixelData()->GetHeight();
+ SizeType loadedWidth = loader.GetPixelData().GetWidth();
+ SizeType loadedHeight = loader.GetPixelData().GetHeight();
bool needBackgroundClear = false;
SizeType packX = area.x;
{
SizeType size = area.width * area.height * Pixel::GetBytesPerPixel( mPixelFormat );
PixelBuffer* buffer = new PixelBuffer [size];
- PixelDataPtr background = PixelData::New( buffer, area.width, area.height, mPixelFormat, PixelData::DELETE_ARRAY );
+ PixelData background = PixelData::New( buffer, area.width, area.height, mPixelFormat, PixelData::DELETE_ARRAY );
for( SizeType idx = 0; idx < size; idx++ )
{
buffer[idx] = 0x00;
bool orientationCorrection);
/**
- * @copydoc Toolkit::ImageAtlas::Upload( Vector4&, PixelDataPtr )
+ * @copydoc Toolkit::ImageAtlas::Upload( Vector4&, PixelData )
*/
- bool Upload( Vector4& textureRect, PixelDataPtr pixelData );
+ bool Upload( Vector4& textureRect, PixelData pixelData );
/**
* @copydoc Toolkit::ImageAtlas::Remove