Merge "(FrameCallback) All values now local & baking of the value supported" into...
[platform/core/uifw/dali-core.git] / dali / public-api / images / pixel-data.cpp
1 /*
2  * Copyright (c) 2016 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
19 #include "pixel-data.h"
20
21 // EXTERNAL INLCUDES
22 #include <stdlib.h>
23
24 // INTERNAL INCLUDES
25 #include <dali/internal/event/images/pixel-data-impl.h>
26
27 namespace Dali
28 {
29
30 PixelData PixelData::New(unsigned char* buffer,
31                          unsigned int bufferSize,
32                          unsigned int width,
33                          unsigned int height,
34                          Pixel::Format pixelFormat,
35                          ReleaseFunction releaseFunction)
36 {
37   IntrusivePtr<Internal::PixelData> internal = Internal::PixelData::New( buffer, bufferSize, width, height, pixelFormat, releaseFunction );
38   return PixelData( internal.Get() );
39 }
40
41 PixelData::PixelData()
42 {
43 }
44
45 PixelData::~PixelData()
46 {
47 }
48
49 PixelData::PixelData( Internal::PixelData* internal )
50 : BaseHandle( internal )
51 {
52 }
53
54 PixelData::PixelData(const PixelData& handle)
55 : BaseHandle( handle )
56 {
57 }
58
59 PixelData& PixelData::operator=(const PixelData& rhs)
60 {
61   BaseHandle::operator=(rhs);
62   return *this;
63 }
64
65 unsigned int PixelData::GetWidth() const
66 {
67   return GetImplementation(*this).GetWidth();
68 }
69
70 unsigned int PixelData::GetHeight() const
71 {
72   return GetImplementation(*this).GetHeight();
73 }
74
75 Pixel::Format PixelData::GetPixelFormat() const
76 {
77   return GetImplementation(*this).GetPixelFormat();
78 }
79
80 } // namespace Dali