2 * Copyright (c) 2014 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 <pixmap-image.h>
22 #include <pixmap-image-impl.h>
25 #include <dali/public-api/object/any.h>
30 PixmapImagePtr PixmapImage::New(unsigned int width, unsigned int height, ColorDepth depth, Adaptor& adaptor)
33 PixmapImagePtr image = new PixmapImage(width, height, depth, adaptor, empty);
37 PixmapImagePtr PixmapImage::New(Any pixmap, Adaptor& adaptor)
39 PixmapImagePtr image = new PixmapImage(0, 0, COLOR_DEPTH_DEFAULT, adaptor, pixmap);
43 Any PixmapImage::GetPixmap(PixmapAPI api)
45 return mImpl->GetPixmap(api);
48 Any PixmapImage::GetDisplay()
50 return mImpl->GetDisplay();
53 bool PixmapImage::GetPixels(std::vector<unsigned char> &pixbuf, unsigned int &width, unsigned int &height, Pixel::Format& pixelFormat ) const
55 return mImpl->GetPixels( pixbuf, width, height, pixelFormat );
58 bool PixmapImage::EncodeToFile(const std::string& filename) const
60 return mImpl->EncodeToFile(filename);
63 bool PixmapImage::GlExtensionCreate()
65 return mImpl->GlExtensionCreate();
68 void PixmapImage::GlExtensionDestroy()
70 mImpl->GlExtensionDestroy();
73 unsigned int PixmapImage::TargetTexture()
75 return mImpl->TargetTexture();
78 void PixmapImage::PrepareTexture()
83 unsigned int PixmapImage::GetWidth() const
85 return mImpl->GetWidth();
88 unsigned int PixmapImage::GetHeight() const
90 return mImpl->GetHeight();
93 Pixel::Format PixmapImage::GetPixelFormat() const
95 return mImpl->GetPixelFormat();
98 PixmapImage::PixmapImage(unsigned int width, unsigned int height, ColorDepth depth, Adaptor& adaptor, Any pixmap)
100 mImpl = Internal::Adaptor::PixmapImage::New( width, height, depth, adaptor, pixmap);
103 PixmapImage::~PixmapImage()