Dali 3D User Interface Engine
atlas.cpp
Go to the documentation of this file.
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 
18 // CLASS HEADER
20 
21 // INTERNAL INCLUDES
24 
25 namespace Dali
26 {
27 
30  Pixel::Format pixelFormat,
31  bool recoverContext )
32 {
33  DALI_ASSERT_ALWAYS( 0u != width && "Invalid Atlas width requested" );
34  DALI_ASSERT_ALWAYS( 0u != height && "Invalid Atlas height requested" );
35 
36  return Atlas( Internal::Atlas::New( width, height, pixelFormat, recoverContext ) );
37 }
38 
40 {
41 }
42 
43 void Atlas::Clear( const Vector4& color )
44 {
45  GetImplementation( *this ).Clear( color );
46 }
47 
48 bool Atlas::Upload( BufferImage bufferImage,
49  SizeType xOffset,
50  SizeType yOffset )
51 {
52  return GetImplementation(*this).Upload( GetImplementation(bufferImage), xOffset, yOffset );
53 }
54 
55 bool Atlas::Upload( const std::string& url,
56  SizeType xOffset,
57  SizeType yOffset )
58 {
59  return GetImplementation(*this).Upload( url, xOffset, yOffset );
60 }
61 
62 bool Atlas::Upload( PixelDataPtr pixelData,
63  SizeType xOffset,
64  SizeType yOffset )
65 {
66  return GetImplementation(*this).Upload( pixelData, xOffset, yOffset );
67 }
68 
70 {
71  return Atlas( dynamic_cast<Dali::Internal::Atlas*>(handle.GetObjectPtr()) );
72 }
73 
75 {
76 }
77 
78 Atlas::Atlas( const Atlas& handle )
79 : Image( handle )
80 {
81 }
82 
84 {
86  return *this;
87 }
88 
90 : Image( internal )
91 {
92 }
93 
94 } // namespace Dali
Dali Docs Home
Read more about Dali