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 <native-image-source.h>
22 #include <dali/public-api/object/any.h>
25 #include <native-image-source-impl.h>
30 NativeImageSourcePtr NativeImageSource::New( unsigned int width, unsigned int height, ColorDepth depth )
33 NativeImageSourcePtr image = new NativeImageSource( width, height, depth, empty );
37 Any NativeImageSource::GetNativeImageSource()
39 return mImpl->GetNativeImageSource();
42 NativeImageSourcePtr NativeImageSource::New( Any nativeImageSource )
44 NativeImageSourcePtr image = new NativeImageSource(0, 0, COLOR_DEPTH_DEFAULT, nativeImageSource);
48 bool NativeImageSource::GetPixels( std::vector<unsigned char> &pixbuf, unsigned int &width, unsigned int &height, Pixel::Format& pixelFormat ) const
50 return mImpl->GetPixels( pixbuf, width, height, pixelFormat );
53 bool NativeImageSource::EncodeToFile(const std::string& filename) const
55 return mImpl->EncodeToFile(filename);
58 void NativeImageSource::SetNativeImageSource( Any nativeImageSource )
60 mImpl->SetNativeImageSource( nativeImageSource );
63 bool NativeImageSource::GlExtensionCreate()
65 return mImpl->GlExtensionCreate();
68 void NativeImageSource::GlExtensionDestroy()
70 mImpl->GlExtensionDestroy();
73 unsigned int NativeImageSource::TargetTexture()
75 return mImpl->TargetTexture();
78 void NativeImageSource::PrepareTexture()
83 unsigned int NativeImageSource::GetWidth() const
85 return mImpl->GetWidth();
88 unsigned int NativeImageSource::GetHeight() const
90 return mImpl->GetHeight();
93 bool NativeImageSource::RequiresBlending() const
95 return mImpl->RequiresBlending();
98 NativeImageInterface::Extension* NativeImageSource::GetExtension()
100 return mImpl->GetNativeImageInterfaceExtension();
103 NativeImageSource::NativeImageSource( unsigned int width, unsigned int height, ColorDepth depth, Any nativeImageSource )
105 mImpl = Internal::Adaptor::NativeImageSource::New( width, height, depth, nativeImageSource );
108 NativeImageSource::~NativeImageSource()