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 )
33 PixmapImagePtr image = new PixmapImage( width, height, depth, empty );
37 PixmapImagePtr PixmapImage::New( Any pixmap )
39 PixmapImagePtr image = new PixmapImage(0, 0, COLOR_DEPTH_DEFAULT, pixmap);
43 bool PixmapImage::GetPixels( std::vector<unsigned char> &pixbuf, unsigned int &width, unsigned int &height, Pixel::Format& pixelFormat ) const
45 return mImpl->GetPixels( pixbuf, width, height, pixelFormat );
48 bool PixmapImage::EncodeToFile(const std::string& filename) const
50 return mImpl->EncodeToFile(filename);
53 bool PixmapImage::GlExtensionCreate()
55 return mImpl->GlExtensionCreate();
58 void PixmapImage::GlExtensionDestroy()
60 mImpl->GlExtensionDestroy();
63 unsigned int PixmapImage::TargetTexture()
65 return mImpl->TargetTexture();
68 void PixmapImage::PrepareTexture()
73 unsigned int PixmapImage::GetWidth() const
75 return mImpl->GetWidth();
78 unsigned int PixmapImage::GetHeight() const
80 return mImpl->GetHeight();
83 Pixel::Format PixmapImage::GetPixelFormat() const
85 return mImpl->GetPixelFormat();
88 PixmapImage::PixmapImage( unsigned int width, unsigned int height, ColorDepth depth, Any pixmap )
90 mImpl = Internal::Adaptor::PixmapImage::New( width, height, depth, pixmap );
93 PixmapImage::~PixmapImage()