1 #ifndef DALI_INTERNAL_NATIVE_IMAGE_SOURCE_IMPL_H
2 #define DALI_INTERNAL_NATIVE_IMAGE_SOURCE_IMPL_H
5 * Copyright (c) 2017 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
22 #include <dali/public-api/adaptor-framework/native-image-source.h>
34 * Dali internal NativeImageSource.
36 class NativeImageSource
41 * Create a new NativeImageSource internally.
42 * Depending on hardware the width and height may have to be a power of two.
43 * @param[in] width The width of the image.
44 * @param[in] height The height of the image.
45 * @param[in] depth color depth of the image.
46 * @param[in] nativeImageSource contains either: pixmap of type X11 Pixmap , a Ecore_X_Pixmap or is empty
47 * @return A smart-pointer to a newly allocated image.
49 static NativeImageSource* New(unsigned int width,
51 Dali::NativeImageSource::ColorDepth depth,
52 Any nativeImageSource);
54 * @copydoc Dali::NativeImageSource::GetNativeImageSource()
56 virtual Any GetNativeImageSource() const;
59 * @copydoc Dali::NativeImageSource::GetPixels()
61 virtual bool GetPixels(std::vector<unsigned char> &pixbuf, unsigned int &width, unsigned int &height, Pixel::Format& pixelFormat ) const;
64 * @copydoc Dali::NativeImageSource::EncodeToFile(const std::string& )
66 virtual bool EncodeToFile(const std::string& filename) const;
69 * @copydoc Dali::NativeImageSource::SetSource( Any source )
71 virtual void SetSource( Any source );
74 * @copydoc Dali::NativeImageSource::IsColorDepthSupported( ColorDepth colorDepth )
76 virtual bool IsColorDepthSupported( Dali::NativeImageSource::ColorDepth colorDepth );
81 virtual ~NativeImageSource();
84 * @copydoc Dali::NativeImageSource::GlExtensionCreate()
86 virtual bool GlExtensionCreate();
89 * @copydoc Dali::NativeImageSource::GlExtensionDestroy()
91 virtual void GlExtensionDestroy();
94 * @copydoc Dali::NativeImageSource::TargetTexture()
96 virtual unsigned int TargetTexture();
99 * @copydoc Dali::NativeImageSource::PrepareTexture()
101 virtual void PrepareTexture();
104 * @copydoc Dali::NativeImageSource::GetWidth()
106 virtual unsigned int GetWidth() const;
109 * @copydoc Dali::NativeImageSource::GetHeight()
111 virtual unsigned int GetHeight() const;
114 * @copydoc Dali::NativeImageSource::RequiresBlending()
116 virtual bool RequiresBlending() const;
119 * @copydoc Dali::NativeImageInterface::GetExtension()
121 virtual NativeImageInterface::Extension* GetNativeImageInterfaceExtension();
124 } // namespace Adaptor
126 } // namespace Internal
130 #endif // DALI_INTERNAL_NATIVE_IMAGE_SOURCE_IMPL_H