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( const AtlasManager::AtlasSize& size, Pixel::Format pixelformat )
50 return GetImplementation(*this).CreateAtlas( size, pixelformat );
53 void AtlasManager::SetAddPolicy( AddFailPolicy policy )
55 GetImplementation(*this).SetAddPolicy( policy );
58 void AtlasManager::Add( const BufferImage& image,
59 AtlasManager::AtlasSlot& slot,
60 AtlasManager::AtlasId atlas )
62 GetImplementation(*this).Add( image, slot, atlas );
65 bool AtlasManager::Remove( ImageId id )
67 return GetImplementation(*this).Remove( id );
70 void AtlasManager::GenerateMeshData( ImageId id,
71 const Vector2& position,
75 GetImplementation(*this).GenerateMeshData( id,
81 void AtlasManager::StitchMesh( Mesh2D& first,
85 GetImplementation(*this).StitchMesh( first, second, optimize );
88 void AtlasManager::StitchMesh( const Mesh2D& first,
93 GetImplementation(*this).StitchMesh( first, second, out, optimize );
96 Dali::Atlas AtlasManager::GetAtlasContainer( AtlasId atlas ) const
98 return GetImplementation(*this).GetAtlasContainer( atlas );
101 AtlasManager::AtlasId AtlasManager::GetAtlas( ImageId id )
103 return GetImplementation(*this).GetAtlas( id );
106 const AtlasManager::AtlasSize& AtlasManager::GetAtlasSize( AtlasId atlas )
108 return GetImplementation(*this).GetAtlasSize( atlas );
111 AtlasManager::SizeType AtlasManager::GetFreeBlocks( AtlasId atlas )
113 return GetImplementation(*this).GetFreeBlocks( atlas );
116 void AtlasManager::SetNewAtlasSize( const AtlasSize& size )
118 GetImplementation(*this).SetNewAtlasSize( size );
121 AtlasManager::SizeType AtlasManager::GetAtlasCount() const
123 return GetImplementation(*this).GetAtlasCount();
126 Pixel::Format AtlasManager::GetPixelFormat( AtlasId atlas )
128 return GetImplementation(*this).GetPixelFormat( atlas );
131 void AtlasManager::GetMetrics( Metrics& metrics )
133 GetImplementation(*this).GetMetrics( metrics );
136 Material AtlasManager::GetMaterial( AtlasId atlas ) const
138 return GetImplementation(*this).GetMaterial( atlas );
141 Sampler AtlasManager::GetSampler( AtlasId atlas ) const
143 return GetImplementation(*this).GetSampler( atlas );
146 } // namespace Toolkit