1 #ifndef DALI_INTERNAL_NATIVE_IMAGE_SOURCE_QUEUE_IMPL_X_H
2 #define DALI_INTERNAL_NATIVE_IMAGE_SOURCE_QUEUE_IMPL_X_H
5 * Copyright (c) 2018 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/devel-api/images/native-image-interface-extension.h>
25 #include <native-image-source-queue-impl.h>
36 class EglImageExtensions;
39 * Dali internal NativeImageSourceQueue.
41 class NativeImageSourceQueueX: public Internal::Adaptor::NativeImageSourceQueue, public NativeImageInterface::Extension
46 * Create a new NativeImageSourceQueueX internally.
47 * Depending on hardware the width and height may have to be a power of two.
48 * @param[in] width The width of the image.
49 * @param[in] height The height of the image.
50 * @param[in] depth color depth of the image.
51 * @param[in] nativeImageSourceQueue contains tbm_surface_queue_h or is empty
52 * @return A smart-pointer to a newly allocated image.
54 static NativeImageSourceQueueX* New(unsigned int width, unsigned int height, Dali::NativeImageSourceQueue::ColorDepth depth, Any nativeImageSourceQueue );
57 * @copydoc Dali::NativeImageSourceQueue::GetNativeImageSourceQueue()
59 Any GetNativeImageSourceQueue() const override;
62 * @copydoc Dali::NativeImageSourceQueue::SetSource( Any source )
64 void SetSource( Any source ) override;
69 ~NativeImageSourceQueueX() override;
72 * @copydoc Dali::NativeImageInterface::GlExtensionCreate()
74 bool GlExtensionCreate() override;
77 * @copydoc Dali::NativeImageInterface::GlExtensionDestroy()
79 void GlExtensionDestroy() override;
82 * @copydoc Dali::NativeImageInterface::TargetTexture()
84 unsigned int TargetTexture() override;
87 * @copydoc Dali::NativeImageInterface::PrepareTexture()
89 void PrepareTexture() override;
92 * @copydoc Dali::NativeImageInterface::GetWidth()
94 unsigned int GetWidth() const override
100 * @copydoc Dali::NativeImageInterface::GetHeight()
102 unsigned int GetHeight() const override
108 * @copydoc Dali::NativeImageInterface::RequiresBlending()
110 bool RequiresBlending() const override
116 * @copydoc Dali::NativeImageInterface::GetExtension()
118 NativeImageInterface::Extension* GetNativeImageInterfaceExtension() override
124 * @copydoc Dali::NativeImageInterface::Extension::GetCustomFragmentPreFix()
126 const char* GetCustomFragmentPreFix() override;
129 * @copydoc Dali::NativeImageInterface::Extension::GetCustomSamplerTypename()
131 const char* GetCustomSamplerTypename() override;
134 * @copydoc Dali::NativeImageInterface::Extension::GetEglImageTextureTarget()
136 int GetEglImageTextureTarget() override;
139 * @copydoc Dali::NativeImageInterface::Extension::SetDestructorNotification(void *notification)
141 void SetDestructorNotification( void* notification ) override;
146 * Private constructor; @see NativeImageSourceQueue::New()
147 * @param[in] width The width of the image.
148 * @param[in] height The height of the image.
149 * @param[in] colour depth of the image.
150 * @param[in] nativeImageSourceQueue contains tbm_surface_queue_h or is empty
152 NativeImageSourceQueueX( unsigned int width, unsigned int height, Dali::NativeImageSourceQueue::ColorDepth depth, Any nativeImageSourceQueue );
156 unsigned int mWidth; ///< image width
157 unsigned int mHeight; ///< image height
161 } // namespace Adaptor
163 } // namespace Internal
167 #endif // DALI_INTERNAL_NATIVE_IMAGE_SOURCE_QUEUE_IMPL_X_H