Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qwindowsd3d11testdevicecontext.cpp
Go to the documentation of this file.
1// Copyright (C) 2025 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
5
6#include <QtMultimediaTestLib/private/qvideoframetestutils_p.h>
7
8#include <QtGui/rhi/qrhi.h>
9
10#include <QtCore/private/qsystemerror_p.h>
11
12#include <algorithm>
13#include <cstring>
14
15namespace {
16
17// Subresource index of the first mip level of 'arraySlice' in 'texture'.
18UINT sliceSubresource(const ComPtr<ID3D11Texture2D> &texture, UINT arraySlice)
19{
20 D3D11_TEXTURE2D_DESC desc{};
21 texture->GetDesc(&desc);
22 return D3D11CalcSubresource(0, arraySlice, desc.MipLevels);
23}
24
25} // namespace
26
28QWindowsD3D11TestDeviceContext::getFirstPixelColor(const ComPtr<ID3D11Texture2D> &texture) const
29{
30 // Get the texture description
31 D3D11_TEXTURE2D_DESC desc{};
32 texture->GetDesc(&desc);
33
34 // Create a staging texture to map the data
35 D3D11_TEXTURE2D_DESC stagingDesc = desc;
36 stagingDesc.Usage = D3D11_USAGE_STAGING;
37 stagingDesc.BindFlags = 0;
38 stagingDesc.CPUAccessFlags = D3D11_CPU_ACCESS_READ;
39 stagingDesc.MiscFlags = 0;
40
41 ComPtr<ID3D11Texture2D> stagingTexture;
42 HRESULT hr = device->CreateTexture2D(&stagingDesc, nullptr, &stagingTexture);
43 if (FAILED(hr)) {
44 qWarning() << "Failed to create staging texture for first pixel read"
45 << QSystemError::windowsComString(hr);
46 return q23::unexpected{ hr };
47 }
48
49 // Copy the texture data to the staging texture
50 context->CopyResource(stagingTexture.Get(), texture.Get());
51
52 // Map the staging texture to access its data
53 D3D11_MAPPED_SUBRESOURCE mappedResource{};
54 hr = context->Map(stagingTexture.Get(), 0, D3D11_MAP_READ, 0, &mappedResource);
55 if (FAILED(hr)) {
56 qWarning() << "Failed to map staging texture for first pixel read"
57 << QSystemError::windowsComString(hr);
58 return q23::unexpected{ hr };
59 }
60
61 // Get the value of the first pixel (top-left corner)
62 unsigned char *data = static_cast<unsigned char *>(mappedResource.pData);
63
64 QColor firstPixel{ data[0], data[1], data[2], data[3] };
65
66 // Unmap the staging texture
67 context->Unmap(stagingTexture.Get(), 0);
68
69 return firstPixel;
70}
71
73QWindowsD3D11TestDeviceContext::getFirstPixelColorBGRA(const ComPtr<ID3D11Texture2D> &texture) const
74{
75 D3D11_TEXTURE2D_DESC desc{};
76 texture->GetDesc(&desc);
77
78 D3D11_TEXTURE2D_DESC stagingDesc = desc;
79 stagingDesc.Usage = D3D11_USAGE_STAGING;
80 stagingDesc.BindFlags = 0;
81 stagingDesc.CPUAccessFlags = D3D11_CPU_ACCESS_READ;
82 stagingDesc.MiscFlags = 0;
83
84 ComPtr<ID3D11Texture2D> stagingTexture;
85 HRESULT hr = device->CreateTexture2D(&stagingDesc, nullptr, &stagingTexture);
86 if (hr != S_OK)
87 return q23::unexpected{ hr };
88
89 context->CopyResource(stagingTexture.Get(), texture.Get());
90
91 D3D11_MAPPED_SUBRESOURCE mappedResource{};
92 hr = context->Map(stagingTexture.Get(), 0, D3D11_MAP_READ, 0, &mappedResource);
93 if (hr != S_OK)
94 return q23::unexpected{ hr };
95
96 unsigned char *data = static_cast<unsigned char *>(mappedResource.pData);
97
98 QColor firstPixel{ data[2], data[1], data[0], data[3] };
99
100 context->Unmap(stagingTexture.Get(), 0);
101
102 return firstPixel;
103}
104
107 const std::vector<QColor> &colors) const
108{
109 D3D11_TEXTURE2D_DESC texDesc{};
110 texDesc.Width = size.width();
111 texDesc.Height = size.height();
112 texDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
113 texDesc.Usage = D3D11_USAGE_DEFAULT;
114 texDesc.CPUAccessFlags = 0;
115 texDesc.MiscFlags = 0;
116 texDesc.BindFlags = 0;
117 texDesc.ArraySize = static_cast<UINT>(colors.size());
118 texDesc.MipLevels = 1;
119 texDesc.SampleDesc = { 1, 0 };
120
121 ComPtr<ID3D11Texture2D> tex;
122 HRESULT hr = device->CreateTexture2D(&texDesc, nullptr, tex.GetAddressOf());
123
124 if (FAILED(hr)) {
125 qWarning() << "Failed to create texture array" << QSystemError::windowsComString(hr);
126 return q23::unexpected{ hr };
127 }
128
129 hr = fillTextureWithColors(tex, colors);
130 if (FAILED(hr)) {
131 qWarning() << "Failed to fill texture array" << QSystemError::windowsComString(hr);
132 return q23::unexpected{ hr };
133 }
134
135 return tex;
136}
137
139{
140 if (!device)
141 return false;
142
143 UINT formatSupport = 0;
144 const HRESULT hr = device->CheckFormatSupport(format, &formatSupport);
145 if (FAILED(hr))
146 return false;
147
148 return (formatSupport & D3D11_FORMAT_SUPPORT_TEXTURE2D) != 0;
149}
150
153{
154 D3D11_TEXTURE2D_DESC texDesc{};
155 texDesc.Width = size.width();
156 texDesc.Height = size.height();
157 texDesc.Format = DXGI_FORMAT_NV12;
158 texDesc.Usage = D3D11_USAGE_DEFAULT;
159 texDesc.CPUAccessFlags = 0;
160 texDesc.MiscFlags = 0;
161 texDesc.BindFlags = 0;
162 texDesc.ArraySize = 1;
163 texDesc.MipLevels = 1;
164 texDesc.SampleDesc = { 1, 0 };
165
166 ComPtr<ID3D11Texture2D> tex;
167 HRESULT hr = device->CreateTexture2D(&texDesc, nullptr, tex.GetAddressOf());
168 if (FAILED(hr)) {
169 qWarning() << "Failed to create NV12 texture" << QSystemError::windowsComString(hr);
170 return q23::unexpected{ hr };
171 }
172
173 return tex;
174}
175
176HRESULT QWindowsD3D11TestDeviceContext::fillNV12Texture(const ComPtr<ID3D11Texture2D> &texture,
177 QSize size, quint8 lumaValue,
178 quint8 chromaUValue, quint8 chromaVValue,
179 UINT arraySlice) const
180{
181 const ComResult<ComPtr<ID3D11Texture2D>> staging =
182 createStagingSliceCopy(texture, arraySlice, D3D11_CPU_ACCESS_WRITE);
183 if (!staging) {
184 qWarning() << "Failed to create staging texture for NV12 fill"
185 << QSystemError::windowsComString(staging.error());
186 return staging.error();
187 }
188 const ComPtr<ID3D11Texture2D> &stagingTexture = *staging;
189
190 D3D11_MAPPED_SUBRESOURCE mappedResource{};
191 HRESULT hr = context->Map(stagingTexture.Get(), 0, D3D11_MAP_WRITE, 0, &mappedResource);
192 if (FAILED(hr)) {
193 qWarning() << "Failed to map staging texture for NV12 fill"
194 << QSystemError::windowsComString(hr);
195 return hr;
196 }
197
198 unsigned char *data = static_cast<unsigned char *>(mappedResource.pData);
199 const int width = size.width();
200 const int height = size.height();
201
202 // Luma plane: one byte per pixel.
203 for (int row = 0; row < height; ++row) {
204 unsigned char *rowData = data + row * mappedResource.RowPitch;
205 std::fill(rowData, rowData + width, lumaValue);
206 }
207
208 // Chroma plane: interleaved U/V, half the width and height of the luma plane, laid out
209 // immediately below the luma plane's rows in the same subresource.
210 unsigned char *chromaBase = data + height * mappedResource.RowPitch;
211 for (int row = 0; row < height / 2; ++row) {
212 unsigned char *rowData = chromaBase + row * mappedResource.RowPitch;
213 for (int col = 0; col < width / 2; ++col) {
214 rowData[2 * col] = chromaUValue;
215 rowData[2 * col + 1] = chromaVValue;
216 }
217 }
218
219 context->Unmap(stagingTexture.Get(), 0);
220 context->CopySubresourceRegion(texture.Get(), sliceSubresource(texture, arraySlice), 0, 0, 0,
221 stagingTexture.Get(), 0, nullptr);
222
223 return S_OK;
224}
225
228 quint8 chromaU, quint8 chromaV) const
229{
230 const ComResult<ComPtr<ID3D11Texture2D>> tex = createNV12Texture(size);
231 if (!tex)
232 return tex;
233
234 const HRESULT hr = fillNV12Texture(*tex, size, lumaValue, chromaU, chromaV);
235 if (hr != S_OK)
236 return q23::unexpected{ hr };
237
238 return tex;
239}
240
243{
244 D3D11_TEXTURE2D_DESC texDesc{};
245 texDesc.Width = size.width();
246 texDesc.Height = size.height();
247 texDesc.Format = DXGI_FORMAT_P010;
248 texDesc.Usage = D3D11_USAGE_DEFAULT;
249 texDesc.CPUAccessFlags = 0;
250 texDesc.MiscFlags = 0;
251 texDesc.BindFlags = 0;
252 texDesc.ArraySize = 1;
253 texDesc.MipLevels = 1;
254 texDesc.SampleDesc = { 1, 0 };
255
256 ComPtr<ID3D11Texture2D> tex;
257 HRESULT hr = device->CreateTexture2D(&texDesc, nullptr, tex.GetAddressOf());
258 if (FAILED(hr)) {
259 qWarning() << "Failed to create P010 texture" << QSystemError::windowsComString(hr);
260 return q23::unexpected{ hr };
261 }
262
263 return tex;
264}
265
266HRESULT QWindowsD3D11TestDeviceContext::fillP010Texture(const ComPtr<ID3D11Texture2D> &texture,
267 QSize size, quint16 lumaValue,
268 quint16 chromaUValue, quint16 chromaVValue,
269 UINT arraySlice) const
270{
271 const ComResult<ComPtr<ID3D11Texture2D>> staging =
272 createStagingSliceCopy(texture, arraySlice, D3D11_CPU_ACCESS_WRITE);
273 if (!staging) {
274 qWarning() << "Failed to create staging texture for P010 fill"
275 << QSystemError::windowsComString(staging.error());
276 return staging.error();
277 }
278 const ComPtr<ID3D11Texture2D> &stagingTexture = *staging;
279
280 D3D11_MAPPED_SUBRESOURCE mappedResource{};
281 HRESULT hr = context->Map(stagingTexture.Get(), 0, D3D11_MAP_WRITE, 0, &mappedResource);
282 if (FAILED(hr)) {
283 qWarning() << "Failed to map staging texture for P010 fill"
284 << QSystemError::windowsComString(hr);
285 return hr;
286 }
287
288 unsigned char *data = static_cast<unsigned char *>(mappedResource.pData);
289
290 // P010 stores each 10-bit sample left-shifted into the high bits of a 16-bit little-endian
291 // word.
292 const quint16 shiftedLuma = quint16(lumaValue << 6);
293 const char lumaTexel[2] = { char(shiftedLuma & 0xff), char(shiftedLuma >> 8) };
294 QtMultimediaTest::fillPlaneRows(data, mappedResource.RowPitch, size.width(), size.height(),
295 QByteArrayView(lumaTexel, sizeof(lumaTexel)));
296
297 const quint16 shiftedU = quint16(chromaUValue << 6);
298 const quint16 shiftedV = quint16(chromaVValue << 6);
299 const char chromaTexel[4] = {
300 char(shiftedU & 0xff),
301 char(shiftedU >> 8),
302 char(shiftedV & 0xff),
303 char(shiftedV >> 8),
304 };
305 unsigned char *chromaBase = data + size.height() * mappedResource.RowPitch;
306 QtMultimediaTest::fillPlaneRows(chromaBase, mappedResource.RowPitch, size.width() / 2,
307 size.height() / 2,
308 QByteArrayView(chromaTexel, sizeof(chromaTexel)));
309
310 context->Unmap(stagingTexture.Get(), 0);
311 context->CopySubresourceRegion(texture.Get(), sliceSubresource(texture, arraySlice), 0, 0, 0,
312 stagingTexture.Get(), 0, nullptr);
313
314 return S_OK;
315}
316
318QWindowsD3D11TestDeviceContext::createSinglePlaneTexture(QSize size, DXGI_FORMAT format) const
319{
320 D3D11_TEXTURE2D_DESC texDesc{};
321 texDesc.Width = size.width();
322 texDesc.Height = size.height();
323 texDesc.Format = format;
324 texDesc.Usage = D3D11_USAGE_DEFAULT;
325 texDesc.CPUAccessFlags = 0;
326 texDesc.MiscFlags = 0;
327 texDesc.BindFlags = 0;
328 texDesc.ArraySize = 1;
329 texDesc.MipLevels = 1;
330 texDesc.SampleDesc = { 1, 0 };
331
332 ComPtr<ID3D11Texture2D> tex;
333 HRESULT hr = device->CreateTexture2D(&texDesc, nullptr, tex.GetAddressOf());
334 if (FAILED(hr)) {
335 qWarning() << "Failed to create single-plane texture" << QSystemError::windowsComString(hr);
336 return q23::unexpected{ hr };
337 }
338
339 return tex;
340}
341
343QWindowsD3D11TestDeviceContext::fillSinglePlaneTexture(const ComPtr<ID3D11Texture2D> &texture,
344 QSize size, QByteArrayView texel,
345 UINT arraySlice) const
346{
347 const ComResult<ComPtr<ID3D11Texture2D>> staging =
348 createStagingSliceCopy(texture, arraySlice, D3D11_CPU_ACCESS_WRITE);
349 if (!staging) {
350 qWarning() << "Failed to create staging texture for single-plane fill"
351 << QSystemError::windowsComString(staging.error());
352 return staging.error();
353 }
354 const ComPtr<ID3D11Texture2D> &stagingTexture = *staging;
355
356 D3D11_MAPPED_SUBRESOURCE mappedResource{};
357 HRESULT hr = context->Map(stagingTexture.Get(), 0, D3D11_MAP_WRITE, 0, &mappedResource);
358 if (FAILED(hr)) {
359 qWarning() << "Failed to map staging texture for single-plane fill"
360 << QSystemError::windowsComString(hr);
361 return hr;
362 }
363
364 unsigned char *data = static_cast<unsigned char *>(mappedResource.pData);
365 QtMultimediaTest::fillPlaneRows(data, mappedResource.RowPitch, size.width(), size.height(),
366 texel);
367
368 context->Unmap(stagingTexture.Get(), 0);
369 context->CopySubresourceRegion(texture.Get(), sliceSubresource(texture, arraySlice), 0, 0, 0,
370 stagingTexture.Get(), 0, nullptr);
371
372 return S_OK;
373}
374
376QWindowsD3D11TestDeviceContext::readPlaneRows(const ComPtr<ID3D11Texture2D> &texture, int rowOffset,
377 int width, int height, int texelSize,
378 UINT arraySlice) const
379{
380 const ComResult<ComPtr<ID3D11Texture2D>> staging =
381 createStagingSliceCopy(texture, arraySlice, D3D11_CPU_ACCESS_READ);
382 if (!staging) {
383 qWarning() << "Failed to create staging texture for plane read"
384 << QSystemError::windowsComString(staging.error());
385 return q23::unexpected{ staging.error() };
386 }
387 const ComPtr<ID3D11Texture2D> &stagingTexture = *staging;
388
389 D3D11_MAPPED_SUBRESOURCE mappedResource{};
390 HRESULT hr = context->Map(stagingTexture.Get(), 0, D3D11_MAP_READ, 0, &mappedResource);
391 if (FAILED(hr)) {
392 qWarning() << "Failed to map staging texture for plane read"
393 << QSystemError::windowsComString(hr);
394 return q23::unexpected{ hr };
395 }
396
397 const auto *base = static_cast<const unsigned char *>(mappedResource.pData);
398 const qsizetype rowBytes = qsizetype(width) * texelSize;
399 QByteArray result(rowBytes * height, Qt::Uninitialized);
400 for (int row = 0; row < height; ++row) {
401 const unsigned char *rowData = base + (rowOffset + row) * mappedResource.RowPitch;
402 std::copy(rowData, rowData + rowBytes, result.data() + row * rowBytes);
403 }
404
405 context->Unmap(stagingTexture.Get(), 0);
406
407 return result;
408}
409
410HRESULT
411QWindowsD3D11TestDeviceContext::fillTextureWithColors(const ComPtr<ID3D11Texture2D> &texture,
412 const std::vector<QColor> &colors) const
413{
414 // Get the texture description
415 D3D11_TEXTURE2D_DESC desc{};
416 texture->GetDesc(&desc);
417
418 // Create a staging texture to map the data
419 D3D11_TEXTURE2D_DESC stagingDesc = desc;
420 stagingDesc.Usage = D3D11_USAGE_STAGING;
421 stagingDesc.BindFlags = 0;
422 stagingDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
423 stagingDesc.MiscFlags = 0;
424
425 ComPtr<ID3D11Texture2D> stagingTexture;
426 HRESULT hr = device->CreateTexture2D(&stagingDesc, nullptr, stagingTexture.GetAddressOf());
427
428 if (FAILED(hr)) {
429 qWarning() << "Failed to create staging texture for color fill"
430 << QSystemError::windowsComString(hr);
431 return hr;
432 }
433
434 // Map the staging texture to access its data
435 D3D11_MAPPED_SUBRESOURCE mappedResource{};
436 context->CopyResource(stagingTexture.Get(), texture.Get());
437 hr = context->Map(stagingTexture.Get(), 0, D3D11_MAP_WRITE, 0, &mappedResource);
438 if (FAILED(hr)) {
439 qWarning() << "Failed to map staging texture for color fill"
440 << QSystemError::windowsComString(hr);
441 return hr;
442 }
443
444 unsigned char *data = static_cast<unsigned char *>(mappedResource.pData);
445 for (UINT plane = 0; plane < desc.ArraySize; ++plane) {
446 const QColor color = colors[plane];
447 for (UINT row = 0; row < desc.Height; ++row) {
448 for (UINT col = 0; col < desc.Width; ++col) {
449 unsigned char *pixel = data + row * mappedResource.RowPitch
450 + plane * mappedResource.DepthPitch + col * 4;
451 pixel[0] = static_cast<unsigned char>(color.red());
452 pixel[1] = static_cast<unsigned char>(color.green());
453 pixel[2] = static_cast<unsigned char>(color.blue());
454 pixel[3] = static_cast<unsigned char>(color.alpha());
455 }
456 }
457 }
458
459 // Unmap the staging texture and copy it back to the original texture
460 context->Unmap(stagingTexture.Get(), 0);
461 context->CopyResource(texture.Get(), stagingTexture.Get());
462
463 return S_OK;
464}
465
466ComResult<ComPtr<ID3D11Texture2D>>
467QWindowsD3D11TestDeviceContext::createStagingSliceCopy(const ComPtr<ID3D11Texture2D> &texture,
468 UINT arraySlice, UINT cpuAccessFlags) const
469{
470 D3D11_TEXTURE2D_DESC stagingDesc{};
471 texture->GetDesc(&stagingDesc);
472 stagingDesc.ArraySize = 1;
473 stagingDesc.MipLevels = 1;
474 stagingDesc.Usage = D3D11_USAGE_STAGING;
475 stagingDesc.BindFlags = 0;
476 stagingDesc.CPUAccessFlags = cpuAccessFlags;
477 stagingDesc.MiscFlags = 0;
478
479 ComPtr<ID3D11Texture2D> stagingTexture;
480 if (const HRESULT hr = device->CreateTexture2D(&stagingDesc, nullptr, &stagingTexture);
481 FAILED(hr)) {
482 return q23::unexpected{ hr };
483 }
484
485 context->CopySubresourceRegion(stagingTexture.Get(), 0, 0, 0, 0, texture.Get(),
486 sliceSubresource(texture, arraySlice), nullptr);
487 return stagingTexture;
488}
489
491createD3D11TestDeviceContextImpl(D3D_DRIVER_TYPE driverType, UINT flags)
492{
494 ComPtr<ID3D11Device> srcDev;
495 HRESULT hr =
496 D3D11CreateDevice(nullptr, driverType, nullptr, flags, nullptr, 0, D3D11_SDK_VERSION,
497 srcDev.GetAddressOf(), nullptr, devContext.context.GetAddressOf());
498 if (FAILED(hr)) {
499 qWarning() << "Failed to create D3D11 device" << QSystemError::windowsComString(hr);
500 return q23::unexpected{ hr };
501 }
502
503 hr = srcDev.As(&devContext.device);
504 if (FAILED(hr)) {
505 qWarning() << "Failed to query ID3D11Device1" << QSystemError::windowsComString(hr);
506 return q23::unexpected{ hr };
507 }
508
509 return devContext;
510}
511
513{
514 // VIDEO_SUPPORT is required for the device to expose ID3D11VideoDevice/ID3D11VideoContext,
515 // which FFmpeg's D3D11VA hwdevice queries for on init (see d3d11va_device_init in
516 // hwcontext_d3d11va.c).
517 return createD3D11TestDeviceContextImpl(D3D_DRIVER_TYPE_HARDWARE,
518 D3D11_CREATE_DEVICE_DISABLE_GPU_TIMEOUT
519 | D3D11_CREATE_DEVICE_VIDEO_SUPPORT);
520}
521
523{
524 // WARP's software rasterizer doesn't implement ID3D11VideoDevice/ID3D11VideoContext at all:
525 // requesting VIDEO_SUPPORT here makes D3D11CreateDevice fail outright with
526 // DXGI_ERROR_UNSUPPORTED. Tests using a WARP device only exercise the "different adapter /
527 // CpuDevice" rejection paths, which don't need it.
528 return createD3D11TestDeviceContextImpl(D3D_DRIVER_TYPE_WARP, 0);
529}
530
532{
533 const auto *native = static_cast<const QRhiD3D11NativeHandles *>(rhi.nativeHandles());
534 if (!native || !native->dev) {
535 qWarning() << "Failed to wrap RHI D3D11 device: invalid native handles";
536 return q23::unexpected{ E_FAIL };
537 }
538
540 const ComPtr<ID3D11Device> device = static_cast<ID3D11Device *>(native->dev);
541 HRESULT hr = device.As(&ctx.device);
542 if (FAILED(hr)) {
543 qWarning() << "Failed to query ID3D11Device1 from RHI device"
544 << QSystemError::windowsComString(hr);
545 return q23::unexpected{ hr };
546 }
547
548 ctx.device->GetImmediateContext(ctx.context.GetAddressOf());
549 if (!ctx.context) {
550 qWarning() << "Failed to get immediate context from RHI device";
551 return q23::unexpected{ E_FAIL };
552 }
553
554 return ctx;
555}
ComResult< QWindowsD3D11TestDeviceContext > wrapRhiD3D11Device(QRhi &rhi)
ComResult< QWindowsD3D11TestDeviceContext > createD3D11TestDeviceContext()
static ComResult< QWindowsD3D11TestDeviceContext > createD3D11TestDeviceContextImpl(D3D_DRIVER_TYPE driverType, UINT flags)
ComResult< QWindowsD3D11TestDeviceContext > createWarpD3D11TestDeviceContext()
ComResult< ComPtr< ID3D11Texture2D > > createSinglePlaneTexture(QSize size, DXGI_FORMAT format) const
ComResult< ComPtr< ID3D11Texture2D > > createFilledNV12Texture(QSize size, quint8 lumaValue, quint8 chromaU, quint8 chromaV) const
ComResult< ComPtr< ID3D11Texture2D > > createNV12Texture(QSize size) const
bool isTextureFormatSupported(DXGI_FORMAT format) const
HRESULT fillNV12Texture(const ComPtr< ID3D11Texture2D > &texture, QSize size, quint8 lumaValue, quint8 chromaUValue, quint8 chromaVValue, UINT arraySlice=0) const
ComResult< QColor > getFirstPixelColorBGRA(const ComPtr< ID3D11Texture2D > &texture) const
ComResult< ComPtr< ID3D11Texture2D > > createP010Texture(QSize size) const
ComResult< QByteArray > readPlaneRows(const ComPtr< ID3D11Texture2D > &texture, int rowOffset, int width, int height, int texelSize, UINT arraySlice=0) const
HRESULT fillP010Texture(const ComPtr< ID3D11Texture2D > &texture, QSize size, quint16 lumaValue, quint16 chromaUValue, quint16 chromaVValue, UINT arraySlice=0) const
ComResult< ComPtr< ID3D11Texture2D > > createTextureArray(QSize size, const std::vector< QColor > &colors) const
HRESULT fillSinglePlaneTexture(const ComPtr< ID3D11Texture2D > &texture, QSize size, QByteArrayView texel, UINT arraySlice=0) const
ComResult< QColor > getFirstPixelColor(const ComPtr< ID3D11Texture2D > &texture) const