- /*
- * Copyright (c) 2015 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.
namespace Dali
{
-
namespace Toolkit
{
-
ImageAtlas::ImageAtlas()
{
}
{
}
+Texture ImageAtlas::PackToAtlas(const std::vector<PixelData>& pixelData, Dali::Vector<Vector4>& textureRects)
+{
+ return Internal::ImageAtlas::PackToAtlas(pixelData, textureRects);
+}
+
ImageAtlas::ImageAtlas(Internal::ImageAtlas* internal)
-: BaseHandle( internal )
+: BaseHandle(internal)
{
}
-ImageAtlas::ImageAtlas( const ImageAtlas& handle )
-: BaseHandle( handle )
+ImageAtlas::ImageAtlas(const ImageAtlas& handle)
+: BaseHandle(handle)
{
}
-ImageAtlas& ImageAtlas::operator=( const ImageAtlas& handle )
+ImageAtlas& ImageAtlas::operator=(const ImageAtlas& handle)
{
BaseHandle::operator=(handle);
return *this;
}
-ImageAtlas ImageAtlas::New(SizeType width, SizeType height,
- Pixel::Format pixelFormat)
+ImageAtlas ImageAtlas::New(SizeType width, SizeType height, Pixel::Format pixelFormat)
{
- IntrusivePtr<Internal::ImageAtlas> internal = Internal::ImageAtlas::New( width, height, pixelFormat);
- return ImageAtlas( internal.Get() );
+ IntrusivePtr<Internal::ImageAtlas> internal = Internal::ImageAtlas::New(width, height, pixelFormat);
+ return ImageAtlas(internal.Get());
}
Texture ImageAtlas::GetAtlas()
{
- return GetImplementation( *this ).GetAtlas();
+ return GetImplementation(*this).GetAtlas();
}
float ImageAtlas::GetOccupancyRate() const
{
- return GetImplementation( *this ).GetOccupancyRate();
+ return GetImplementation(*this).GetOccupancyRate();
}
-
-void ImageAtlas::SetBrokenImage( const std::string& brokenImageUrl )
+void ImageAtlas::SetBrokenImage(const std::string& brokenImageUrl)
{
- GetImplementation( *this ).SetBrokenImage( brokenImageUrl );
+ GetImplementation(*this).SetBrokenImage(brokenImageUrl);
}
-bool ImageAtlas::Upload( Vector4& textureRect,
- const std::string& url,
- ImageDimensions size,
- FittingMode::Type fittingMode,
- bool orientationCorrection )
+bool ImageAtlas::Upload(Vector4& textureRect,
+ const std::string& url,
+ ImageDimensions size,
+ FittingMode::Type fittingMode,
+ bool orientationCorrection)
{
- return Upload( textureRect, url, size, fittingMode, orientationCorrection, NULL );
+ return Upload(textureRect, url, size, fittingMode, orientationCorrection, NULL);
}
-bool ImageAtlas::Upload( Vector4& textureRect,
- const std::string& url,
- ImageDimensions size,
- FittingMode::Type fittingMode,
- bool orientationCorrection,
- AtlasUploadObserver* atlasUploadObserver )
+bool ImageAtlas::Upload(Vector4& textureRect,
+ const std::string& url,
+ ImageDimensions size,
+ FittingMode::Type fittingMode,
+ bool orientationCorrection,
+ AtlasUploadObserver* atlasUploadObserver)
{
- return GetImplementation(*this).Upload( textureRect, url, size, fittingMode, orientationCorrection, atlasUploadObserver );
+ return GetImplementation(*this).Upload(textureRect, url, size, fittingMode, orientationCorrection, atlasUploadObserver);
}
-bool ImageAtlas::Upload( Vector4& textureRect, PixelData pixelData )
+bool ImageAtlas::Upload(Vector4& textureRect, PixelData pixelData)
{
- return GetImplementation(*this).Upload( textureRect, pixelData );
+ return GetImplementation(*this).Upload(textureRect, pixelData);
}
void ImageAtlas::Remove(const Vector4& textureRect)
{
- GetImplementation(*this).Remove( textureRect );
+ GetImplementation(*this).Remove(textureRect);
}
} // namespace Toolkit