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.
18 #include <dali-toolkit/internal/atlas-manager/atlas-manager.h>
21 #include <dali-toolkit/internal/atlas-manager/atlas-manager-impl.h>
29 AtlasManager::AtlasManager()
33 AtlasManager::~AtlasManager()
37 AtlasManager AtlasManager::New()
39 Internal::AtlasManagerPtr internal = Internal::AtlasManager::New();
40 return AtlasManager(internal.Get());
43 AtlasManager::AtlasManager(Internal::AtlasManager *impl)
48 AtlasManager::AtlasId AtlasManager::CreateAtlas( SizeType width,
52 Pixel::Format pixelformat )
54 return GetImplementation(*this).CreateAtlas( width, height, blockWidth, blockHeight, pixelformat );
57 void AtlasManager::SetAddPolicy( AddFailPolicy policy )
59 GetImplementation(*this).SetAddPolicy( policy );
62 void AtlasManager::Add( const BufferImage& image,
63 AtlasManager::AtlasSlot& slot,
64 AtlasManager::AtlasId atlas )
66 GetImplementation(*this).Add( image, slot, atlas );
69 bool AtlasManager::Remove( ImageId id )
71 return GetImplementation(*this).Remove( id );
74 void AtlasManager::GenerateMeshData( ImageId id,
75 const Vector2& position,
78 GetImplementation(*this).GenerateMeshData( id,
83 void AtlasManager::StitchMesh( MeshData& first,
84 const MeshData& second,
87 GetImplementation(*this).StitchMesh( first, second, optimize );
90 void AtlasManager::StitchMesh( const MeshData& first,
91 const MeshData& second,
95 GetImplementation(*this).StitchMesh( first, second, out, optimize );
98 Dali::Atlas AtlasManager::GetAtlasContainer( AtlasId atlas ) const
100 return GetImplementation(*this).GetAtlasContainer( atlas );
103 AtlasManager::AtlasId AtlasManager::GetAtlas( ImageId id )
105 return GetImplementation(*this).GetAtlas( id );
108 Vector2 AtlasManager::GetBlockSize( AtlasId atlas )
110 return GetImplementation(*this).GetBlockSize( atlas );
113 AtlasManager::SizeType AtlasManager::GetFreeBlocks( AtlasId atlas )
115 return GetImplementation(*this).GetFreeBlocks( atlas );
118 void AtlasManager::SetAtlasSize( const Vector2& size,
119 const Vector2& blockSize )
121 GetImplementation(*this).SetAtlasSize( size, blockSize );
124 AtlasManager::SizeType AtlasManager::GetAtlasCount() const
126 return GetImplementation(*this).GetAtlasCount();
129 Pixel::Format AtlasManager::GetPixelFormat( AtlasId atlas )
131 return GetImplementation(*this).GetPixelFormat( atlas );
134 } // namespace Toolkit