X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Fdevel-api%2Fimage-loader%2Fimage-atlas.cpp;h=fcbeed8a72e352daca35bef87050a6753a3fdfba;hb=6e79b1b333af799839c8e7b11a077f754132dc24;hp=a7174d5d2a379d81fba4710a474538b0d81757c6;hpb=bd75dc4cad4ce62cc9206abf19280b40825b9726;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/devel-api/image-loader/image-atlas.cpp b/dali-toolkit/devel-api/image-loader/image-atlas.cpp index a7174d5..fcbeed8 100644 --- a/dali-toolkit/devel-api/image-loader/image-atlas.cpp +++ b/dali-toolkit/devel-api/image-loader/image-atlas.cpp @@ -1,5 +1,5 @@ - /* - * 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. @@ -23,10 +23,8 @@ namespace Dali { - namespace Toolkit { - ImageAtlas::ImageAtlas() { } @@ -35,62 +33,75 @@ ImageAtlas::~ImageAtlas() { } +Texture ImageAtlas::PackToAtlas(const std::vector& pixelData, Dali::Vector& 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 = Internal::ImageAtlas::New( width, height, pixelFormat); - return ImageAtlas( internal.Get() ); + IntrusivePtr 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) +{ + GetImplementation(*this).SetBrokenImage(brokenImageUrl); +} -void ImageAtlas::SetBrokenImage( const std::string& brokenImageUrl ) +bool ImageAtlas::Upload(Vector4& textureRect, + const std::string& url, + ImageDimensions size, + FittingMode::Type fittingMode, + bool orientationCorrection) { - GetImplementation( *this ).SetBrokenImage( brokenImageUrl ); + return Upload(textureRect, url, size, fittingMode, orientationCorrection, NULL); } -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, + AtlasUploadObserver* atlasUploadObserver) { - return GetImplementation(*this).Upload( textureRect, url, size, fittingMode, orientationCorrection ); + 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