Add stride to PixelBuffer
[platform/core/uifw/dali-adaptor.git] / dali / internal / imaging / common / native-image-source-queue-impl.h
1 #ifndef DALI_INTERNAL_NATIVE_IMAGE_SOURCE_QUEUE_IMPL_H
2 #define DALI_INTERNAL_NATIVE_IMAGE_SOURCE_QUEUE_IMPL_H
3
4 /*
5  * Copyright (c) 2021 Samsung Electronics Co., Ltd.
6  *
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
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
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.
18  *
19  */
20
21 // INTERNAL INCLUDES
22 #include <dali/devel-api/adaptor-framework/native-image-source-queue.h>
23
24 namespace Dali
25 {
26 namespace Internal
27 {
28 namespace Adaptor
29 {
30 /**
31  * Dali internal NativeImageSourceQueue.
32  */
33 class NativeImageSourceQueue
34 {
35 public:
36   /**
37    * @copydoc Dali::NativeImageSourceQueue::New()
38    */
39   static NativeImageSourceQueue* New(uint32_t width, uint32_t height, Dali::NativeImageSourceQueue::ColorFormat colorFormat, Any nativeImageSourceQueue);
40
41   /**
42    * @copydoc Dali::NativeImageSourceQueue::GetNativeImageSourceQueue()
43    */
44   virtual Any GetNativeImageSourceQueue() const = 0;
45
46   /**
47    * @copydoc Dali::NativeImageSourceQueue::SetSize
48    */
49   virtual void SetSize(uint32_t width, uint32_t height) = 0;
50
51   /**
52    * @copydoc Dali::NativeImageSourceQueue::IgnoreSourceImage
53    */
54   virtual void IgnoreSourceImage() = 0;
55
56   /**
57    * @copydoc Dali::NativeImageSourceQueue::CanDequeueBuffer
58    */
59   virtual bool CanDequeueBuffer() = 0;
60
61   /**
62    * @copydoc Dali::NativeImageSourceQueue::DequeueBuffer
63    */
64   virtual uint8_t* DequeueBuffer(uint32_t& width, uint32_t& height, uint32_t& stride) = 0;
65
66   /**
67    * @copydoc Dali::NativeImageSourceQueue::EnqueueBuffer
68    */
69   virtual bool EnqueueBuffer(uint8_t* buffer) = 0;
70
71   /**
72    * destructor
73    */
74   virtual ~NativeImageSourceQueue() = default;
75
76   /**
77    * @copydoc Dali::NativeImageInterface::CreateResource()
78    */
79   virtual bool CreateResource() = 0;
80
81   /**
82    * @copydoc Dali::NativeImageInterface::DestroyResource()
83    */
84   virtual void DestroyResource() = 0;
85
86   /**
87    * @copydoc Dali::NativeImageInterface::TargetTexture()
88    */
89   virtual uint32_t TargetTexture() = 0;
90
91   /**
92    * @copydoc Dali::NativeImageInterface::PrepareTexture()
93    */
94   virtual void PrepareTexture() = 0;
95
96   /**
97    * @copydoc Dali::NativeImageInterface::GetWidth()
98    */
99   virtual uint32_t GetWidth() const = 0;
100
101   /**
102    * @copydoc Dali::NativeImageInterface::GetHeight()
103    */
104   virtual uint32_t GetHeight() const = 0;
105
106   /**
107    * @copydoc Dali::NativeImageInterface::RequiresBlending()
108    */
109   virtual bool RequiresBlending() const = 0;
110
111   /**
112    * @copydoc Dali::NativeImageInterface::GetTextureTarget()
113    */
114   virtual int GetTextureTarget() const = 0;
115
116   /**
117    * @copydoc Dali::NativeImageInterface::ApplyNativeFragmentShader()
118    */
119   virtual bool ApplyNativeFragmentShader(std::string& shader) = 0;
120
121   /**
122    * @copydoc Dali::NativeImageInterface::GetCustomSamplerTypename()
123    */
124   virtual const char* GetCustomSamplerTypename() const = 0;
125
126   /**
127    * @copydoc Dali::NativeImageInterface::GetNativeImageHandle()
128    */
129   virtual Any GetNativeImageHandle() const = 0;
130
131   /**
132    * @copydoc Dali::NativeImageInterface::SourceChanged()
133    */
134   virtual bool SourceChanged() const = 0;
135
136   /**
137    * @copydoc Dali::NativeImageInterface::GetExtension()
138    */
139   virtual NativeImageInterface::Extension* GetNativeImageInterfaceExtension() = 0;
140 };
141
142 } // namespace Adaptor
143
144 } // namespace Internal
145
146 } // namespace Dali
147
148 #endif // DALI_INTERNAL_NATIVE_IMAGE_SOURCE_QUEUE_IMPL_H