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 <dali/devel-api/images/atlas.h>
22 #include <dali/internal/event/images/atlas-impl.h>
23 #include <dali/internal/event/images/buffer-image-impl.h>
24 #include <dali/internal/event/images/pixel-data-impl.h>
29 Atlas Atlas::New( SizeType width,
31 Pixel::Format pixelFormat,
34 DALI_ASSERT_ALWAYS( 0u != width && "Invalid Atlas width requested" );
35 DALI_ASSERT_ALWAYS( 0u != height && "Invalid Atlas height requested" );
37 return Atlas( Internal::Atlas::New( width, height, pixelFormat, recoverContext ) );
44 void Atlas::Clear( const Vector4& color )
46 GetImplementation( *this ).Clear( color );
49 bool Atlas::Upload( BufferImage bufferImage,
53 return GetImplementation(*this).Upload( GetImplementation(bufferImage), xOffset, yOffset );
56 bool Atlas::Upload( const std::string& url,
60 return GetImplementation(*this).Upload( url, xOffset, yOffset );
63 bool Atlas::Upload( PixelData pixelData,
67 Internal::PixelData& internalPixelData = GetImplementation( pixelData );
68 return GetImplementation(*this).Upload( &internalPixelData, xOffset, yOffset );
71 Atlas Atlas::DownCast( BaseHandle handle )
73 return Atlas( dynamic_cast<Dali::Internal::Atlas*>(handle.GetObjectPtr()) );
80 Atlas::Atlas( const Atlas& handle )
85 Atlas& Atlas::operator=( const Atlas& rhs )
87 BaseHandle::operator=(rhs);
91 Atlas::Atlas( Internal::Atlas* internal )