2 * Copyright (c) 2020 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 <dali/devel-api/adaptor-framework/native-image-source-queue.h>
22 #include <dali/internal/imaging/common/native-image-source-factory.h>
23 #include <dali/internal/imaging/common/native-image-source-queue-impl.h>
27 NativeImageSourceQueuePtr NativeImageSourceQueue::New(uint32_t width, uint32_t height, ColorDepth depth)
30 NativeImageSourceQueuePtr image = new NativeImageSourceQueue(width, height, depth, empty);
38 NativeImageSourceQueuePtr NativeImageSourceQueue::New(Any nativeImageSourceQueue)
40 NativeImageSourceQueuePtr image = new NativeImageSourceQueue(0, 0, COLOR_DEPTH_DEFAULT, nativeImageSourceQueue);
48 Any NativeImageSourceQueue::GetNativeImageSourceQueue()
50 return mImpl->GetNativeImageSourceQueue();
53 void NativeImageSourceQueue::SetSize(uint32_t width, uint32_t height)
55 return mImpl->SetSize(width, height);
58 void NativeImageSourceQueue::IgnoreSourceImage()
60 mImpl->IgnoreSourceImage();
63 bool NativeImageSourceQueue::CanDequeueBuffer()
65 return mImpl->CanDequeueBuffer();
68 uint8_t* NativeImageSourceQueue::DequeueBuffer(uint32_t& width, uint32_t& height, uint32_t& stride)
70 return mImpl->DequeueBuffer(width, height, stride);
73 bool NativeImageSourceQueue::EnqueueBuffer(uint8_t* buffer)
75 return mImpl->EnqueueBuffer(buffer);
78 bool NativeImageSourceQueue::CreateResource()
80 return mImpl->CreateResource();
83 void NativeImageSourceQueue::DestroyResource()
85 mImpl->DestroyResource();
88 uint32_t NativeImageSourceQueue::TargetTexture()
90 return mImpl->TargetTexture();
93 void NativeImageSourceQueue::PrepareTexture()
95 mImpl->PrepareTexture();
98 uint32_t NativeImageSourceQueue::GetWidth() const
100 return mImpl->GetWidth();
103 uint32_t NativeImageSourceQueue::GetHeight() const
105 return mImpl->GetHeight();
108 bool NativeImageSourceQueue::RequiresBlending() const
110 return mImpl->RequiresBlending();
113 int NativeImageSourceQueue::GetTextureTarget() const
115 return mImpl->GetTextureTarget();
118 const char* NativeImageSourceQueue::GetCustomFragmentPrefix() const
120 return mImpl->GetCustomFragmentPrefix();
123 bool NativeImageSourceQueue::ApplyNativeFragmentShader(std::string& shader)
125 return mImpl->ApplyNativeFragmentShader(shader);
128 const char* NativeImageSourceQueue::GetCustomSamplerTypename() const
130 return mImpl->GetCustomSamplerTypename();
133 Any NativeImageSourceQueue::GetNativeImageHandle() const
135 return mImpl->GetNativeImageHandle();
138 bool NativeImageSourceQueue::SourceChanged() const
140 return mImpl->SourceChanged();
143 NativeImageInterface::Extension* NativeImageSourceQueue::GetExtension()
145 return mImpl->GetNativeImageInterfaceExtension();
148 NativeImageSourceQueue::NativeImageSourceQueue(uint32_t width, uint32_t height, ColorDepth depth, Any nativeImageSourceQueue)
150 auto factory = Dali::Internal::Adaptor::GetNativeImageSourceFactory();
151 mImpl = factory->CreateNativeImageSourceQueue(width, height, depth, nativeImageSourceQueue);
154 NativeImageSourceQueue::~NativeImageSourceQueue()