Public API headers are installed in the correct folder
[platform/core/uifw/dali-adaptor.git] / adaptors / public-api / adaptor-framework / pixmap-image.cpp
1 /*
2  * Copyright (c) 2014 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 <pixmap-image.h>
20
21 // INTERNAL INCLUDES
22 #include <pixmap-image-impl.h>
23
24 // EXTERNAL INCLUDES
25 #include <dali/public-api/object/any.h>
26
27 namespace Dali
28 {
29
30 PixmapImagePtr PixmapImage::New(unsigned int width, unsigned int height, ColorDepth depth, Adaptor& adaptor)
31 {
32   Any empty;
33   PixmapImagePtr image = new PixmapImage(width, height, depth, adaptor, empty);
34   return image;
35 }
36
37 PixmapImagePtr PixmapImage::New(Any pixmap, Adaptor& adaptor)
38 {
39   PixmapImagePtr image = new PixmapImage(0, 0, COLOR_DEPTH_DEFAULT, adaptor, pixmap);
40   return image;
41 }
42
43 Any PixmapImage::GetPixmap(PixmapAPI api)
44 {
45   return mImpl->GetPixmap(api);
46 }
47
48 Any PixmapImage::GetDisplay()
49 {
50   return mImpl->GetDisplay();
51 }
52
53 bool PixmapImage::GetPixels(std::vector<unsigned char> &pixbuf, unsigned int &width, unsigned int &height, Pixel::Format& pixelFormat ) const
54 {
55   return mImpl->GetPixels( pixbuf, width, height, pixelFormat );
56 }
57
58 bool PixmapImage::EncodeToFile(const std::string& filename) const
59 {
60   return mImpl->EncodeToFile(filename);
61 }
62
63 bool PixmapImage::GlExtensionCreate()
64 {
65   return mImpl->GlExtensionCreate();
66 }
67
68 void PixmapImage::GlExtensionDestroy()
69 {
70   mImpl->GlExtensionDestroy();
71 }
72
73 unsigned int PixmapImage::TargetTexture()
74 {
75   return mImpl->TargetTexture();
76 }
77
78 void PixmapImage::PrepareTexture()
79 {
80
81 }
82
83 unsigned int PixmapImage::GetWidth() const
84 {
85   return mImpl->GetWidth();
86 }
87
88 unsigned int PixmapImage::GetHeight() const
89 {
90   return mImpl->GetHeight();
91 }
92
93 Pixel::Format PixmapImage::GetPixelFormat() const
94 {
95   return mImpl->GetPixelFormat();
96 }
97
98 PixmapImage::PixmapImage(unsigned int width, unsigned int height, ColorDepth depth, Adaptor& adaptor, Any pixmap)
99 {
100    mImpl = Internal::Adaptor::PixmapImage::New( width, height, depth, adaptor, pixmap);
101 }
102
103 PixmapImage::~PixmapImage()
104 {
105   delete mImpl;
106 }
107
108 } // namespace Dali