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 ImageAtlas::ImageAtlas(Internal::ImageAtlas* internal)
39 : BaseHandle( internal )
43 ImageAtlas::ImageAtlas( const ImageAtlas& handle )
44 : BaseHandle( handle )
48 ImageAtlas& ImageAtlas::operator=( const ImageAtlas& handle )
50 BaseHandle::operator=(handle);
54 ImageAtlas ImageAtlas::New(SizeType width, SizeType height,
55 Pixel::Format pixelFormat)
57 IntrusivePtr<Internal::ImageAtlas> internal = Internal::ImageAtlas::New( width, height, pixelFormat);
58 return ImageAtlas( internal.Get() );
61 Texture ImageAtlas::GetAtlas()
63 return GetImplementation( *this ).GetAtlas();
66 float ImageAtlas::GetOccupancyRate() const
68 return GetImplementation( *this ).GetOccupancyRate();
72 void ImageAtlas::SetBrokenImage( const std::string& brokenImageUrl )
74 GetImplementation( *this ).SetBrokenImage( brokenImageUrl );
77 bool ImageAtlas::Upload( Vector4& textureRect,
78 const std::string& url,
80 FittingMode::Type fittingMode,
81 bool orientationCorrection )
83 return Upload( textureRect, url, size, fittingMode, orientationCorrection, NULL );
86 bool ImageAtlas::Upload( Vector4& textureRect,
87 const std::string& url,
89 FittingMode::Type fittingMode,
90 bool orientationCorrection,
91 AtlasUploadObserver* atlasUploadObserver )
93 return GetImplementation(*this).Upload( textureRect, url, size, fittingMode, orientationCorrection, atlasUploadObserver );
96 bool ImageAtlas::Upload( Vector4& textureRect, PixelData pixelData )
98 return GetImplementation(*this).Upload( textureRect, pixelData );
101 void ImageAtlas::Remove(const Vector4& textureRect)
103 GetImplementation(*this).Remove( textureRect );
106 } // namespace Toolkit