2 * Copyright (c) 2015 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 #include "image-atlas.h"
22 #include <dali-toolkit/internal/image-loader/image-atlas-impl.h>
30 ImageAtlas::ImageAtlas()
34 ImageAtlas::~ImageAtlas()
38 Texture ImageAtlas::PackToAtlas( const std::vector<PixelData>& pixelData, Dali::Vector<Vector4>& textureRects )
40 return Internal::ImageAtlas::PackToAtlas( pixelData, textureRects );
43 ImageAtlas::ImageAtlas(Internal::ImageAtlas* internal)
44 : BaseHandle( internal )
48 ImageAtlas::ImageAtlas( const ImageAtlas& handle )
49 : BaseHandle( handle )
53 ImageAtlas& ImageAtlas::operator=( const ImageAtlas& handle )
55 BaseHandle::operator=(handle);
59 ImageAtlas ImageAtlas::New(SizeType width, SizeType height,
60 Pixel::Format pixelFormat)
62 IntrusivePtr<Internal::ImageAtlas> internal = Internal::ImageAtlas::New( width, height, pixelFormat);
63 return ImageAtlas( internal.Get() );
66 Texture ImageAtlas::GetAtlas()
68 return GetImplementation( *this ).GetAtlas();
71 float ImageAtlas::GetOccupancyRate() const
73 return GetImplementation( *this ).GetOccupancyRate();
77 void ImageAtlas::SetBrokenImage( const std::string& brokenImageUrl )
79 GetImplementation( *this ).SetBrokenImage( brokenImageUrl );
82 bool ImageAtlas::Upload( Vector4& textureRect,
83 const std::string& url,
85 FittingMode::Type fittingMode,
86 bool orientationCorrection )
88 return Upload( textureRect, url, size, fittingMode, orientationCorrection, NULL );
91 bool ImageAtlas::Upload( Vector4& textureRect,
92 const std::string& url,
94 FittingMode::Type fittingMode,
95 bool orientationCorrection,
96 AtlasUploadObserver* atlasUploadObserver )
98 return GetImplementation(*this).Upload( textureRect, url, size, fittingMode, orientationCorrection, atlasUploadObserver );
101 bool ImageAtlas::Upload( Vector4& textureRect, PixelData pixelData )
103 return GetImplementation(*this).Upload( textureRect, pixelData );
106 void ImageAtlas::Remove(const Vector4& textureRect)
108 GetImplementation(*this).Remove( textureRect );
111 } // namespace Toolkit