[dali_2.3.20] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / text / rendering / atlas / atlas-manager.cpp
1 /*
2  * Copyright (c) 2015 Samsung Electronics Co., Ltd.
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 // CLASS HEADER
18 #include <dali-toolkit/internal/text/rendering/atlas/atlas-manager.h>
19
20 // INTERNAL INCLUDES
21 #include <dali-toolkit/internal/text/rendering/atlas/atlas-manager-impl.h>
22
23 namespace Dali
24 {
25 namespace Toolkit
26 {
27 AtlasManager::AtlasManager()
28 {
29 }
30
31 AtlasManager::~AtlasManager()
32 {
33 }
34
35 AtlasManager AtlasManager::New()
36 {
37   Internal::AtlasManagerPtr internal = Internal::AtlasManager::New();
38   return AtlasManager(internal.Get());
39 }
40
41 AtlasManager::AtlasManager(Internal::AtlasManager* impl)
42 : BaseHandle(impl)
43 {
44 }
45
46 AtlasManager::AtlasId AtlasManager::CreateAtlas(const AtlasManager::AtlasSize& size, Pixel::Format pixelformat)
47 {
48   return GetImplementation(*this).CreateAtlas(size, pixelformat);
49 }
50
51 void AtlasManager::SetAddPolicy(AddFailPolicy policy)
52 {
53   GetImplementation(*this).SetAddPolicy(policy);
54 }
55
56 bool AtlasManager::Add(const PixelData&         image,
57                        AtlasManager::AtlasSlot& slot,
58                        AtlasManager::AtlasId    atlas)
59 {
60   return GetImplementation(*this).Add(image, slot, atlas);
61 }
62
63 bool AtlasManager::Remove(ImageId id)
64 {
65   return GetImplementation(*this).Remove(id);
66 }
67
68 void AtlasManager::GenerateMeshData(ImageId        id,
69                                     const Vector2& position,
70                                     Mesh2D&        mesh,
71                                     bool           addReference)
72 {
73   GetImplementation(*this).GenerateMeshData(id,
74                                             position,
75                                             mesh,
76                                             addReference);
77 }
78
79 Dali::Texture AtlasManager::GetAtlasContainer(AtlasId atlas) const
80 {
81   return GetImplementation(*this).GetAtlasContainer(atlas);
82 }
83
84 AtlasManager::AtlasId AtlasManager::GetAtlas(ImageId id)
85 {
86   return GetImplementation(*this).GetAtlas(id);
87 }
88
89 const AtlasManager::AtlasSize& AtlasManager::GetAtlasSize(AtlasId atlas)
90 {
91   return GetImplementation(*this).GetAtlasSize(atlas);
92 }
93
94 AtlasManager::SizeType AtlasManager::GetFreeBlocks(AtlasId atlas)
95 {
96   return GetImplementation(*this).GetFreeBlocks(atlas);
97 }
98
99 void AtlasManager::SetNewAtlasSize(const AtlasSize& size)
100 {
101   GetImplementation(*this).SetNewAtlasSize(size);
102 }
103
104 AtlasManager::SizeType AtlasManager::GetAtlasCount() const
105 {
106   return GetImplementation(*this).GetAtlasCount();
107 }
108
109 Pixel::Format AtlasManager::GetPixelFormat(AtlasId atlas) const
110 {
111   return GetImplementation(*this).GetPixelFormat(atlas);
112 }
113
114 void AtlasManager::GetMetrics(Metrics& metrics)
115 {
116   GetImplementation(*this).GetMetrics(metrics);
117 }
118
119 TextureSet AtlasManager::GetTextures(AtlasId atlas) const
120 {
121   return GetImplementation(*this).GetTextures(atlas);
122 }
123
124 void AtlasManager::SetTextures(AtlasId atlas, TextureSet& textureSet)
125 {
126   GetImplementation(*this).SetTextures(atlas, textureSet);
127 }
128
129 } // namespace Toolkit
130
131 } // namespace Dali