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
qohosimageformat.cpp
Go to the documentation of this file.
1// Copyright (C) 2025 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
5
7
9{
10 static_assert(
11 Q_BYTE_ORDER == Q_LITTLE_ENDIAN,
12 "Pixel format mapping is currently supported for little-endian targets only");
13
14 switch (format) {
15 case QImage::Format_RGBA8888:
16 return makeQOhosOptional(::PIXEL_FORMAT::PIXEL_FORMAT_RGBA_8888);
17 case QImage::Format_RGB888:
18 return makeQOhosOptional(::PIXEL_FORMAT::PIXEL_FORMAT_RGB_888);
19 case QImage::Format_Alpha8:
20 return makeQOhosOptional(::PIXEL_FORMAT::PIXEL_FORMAT_ALPHA_8);
21 case QImage::Format_ARGB32:
22 return makeQOhosOptional(::PIXEL_FORMAT::PIXEL_FORMAT_BGRA_8888);
23 case QImage::Format_RGBA16FPx4:
24 return makeQOhosOptional(::PIXEL_FORMAT::PIXEL_FORMAT_RGBA_F16);
25 case QImage::Format_RGB16:
26 return makeQOhosOptional(::PIXEL_FORMAT::PIXEL_FORMAT_RGB_565);
27 default:
28 return {};
29 }
30}
31
32QT_END_NAMESPACE
Combined button and popup list for selecting options.
QT_BEGIN_NAMESPACE QOhosOptional<::PIXEL_FORMAT > tryMapQtPixelFormatToOhosPixelFormat(QImage::Format format)