15class QWaylandSharedMemoryFormatHelper
18 static inline wl_shm_format fromQImageFormat(QImage::Format format);
19 static inline QImage::Format fromWaylandShmFormat(wl_shm_format format)
22 case WL_SHM_FORMAT_XRGB8888:
return QImage::Format_RGB32;
23 case WL_SHM_FORMAT_ARGB8888:
return QImage::Format_ARGB32_Premultiplied;
24 case WL_SHM_FORMAT_RGB565:
return QImage::Format_RGB16;
25 case WL_SHM_FORMAT_XRGB1555:
return QImage::Format_RGB555;
26 case WL_SHM_FORMAT_RGB888:
return QImage::Format_RGB888;
27 case WL_SHM_FORMAT_BGR888:
return QImage::Format_BGR888;
28 case WL_SHM_FORMAT_XRGB4444:
return QImage::Format_RGB444;
29 case WL_SHM_FORMAT_ARGB4444:
return QImage::Format_ARGB4444_Premultiplied;
30 case WL_SHM_FORMAT_XBGR8888:
return QImage::Format_RGBX8888;
31 case WL_SHM_FORMAT_ABGR8888:
return QImage::Format_RGBA8888_Premultiplied;
32 case WL_SHM_FORMAT_XBGR2101010:
return QImage::Format_BGR30;
33 case WL_SHM_FORMAT_ABGR2101010:
return QImage::Format_A2BGR30_Premultiplied;
34 case WL_SHM_FORMAT_XRGB2101010:
return QImage::Format_RGB30;
35 case WL_SHM_FORMAT_ARGB2101010:
return QImage::Format_A2RGB30_Premultiplied;
36 case WL_SHM_FORMAT_C8:
return QImage::Format_Alpha8;
37 default:
return QImage::Format_Invalid;
45 Array(
const size_t size,
const wl_shm_format *data)
50 const wl_shm_format *data =
nullptr;
53 static const Array getData()
55 static wl_shm_format formats_array[] = {
56 wl_shm_format(INT_MIN),
57 wl_shm_format(INT_MIN),
58 wl_shm_format(INT_MIN),
59 wl_shm_format(INT_MIN),
60 WL_SHM_FORMAT_XRGB8888,
61 WL_SHM_FORMAT_ARGB8888,
62 WL_SHM_FORMAT_ARGB8888,
64 wl_shm_format(INT_MIN),
65 wl_shm_format(INT_MIN),
66 wl_shm_format(INT_MIN),
67 WL_SHM_FORMAT_XRGB1555,
68 wl_shm_format(INT_MIN),
70 WL_SHM_FORMAT_XRGB4444,
71 WL_SHM_FORMAT_ARGB4444,
72 WL_SHM_FORMAT_XBGR8888,
73 WL_SHM_FORMAT_ABGR8888,
74 WL_SHM_FORMAT_ABGR8888,
75 WL_SHM_FORMAT_XBGR2101010,
76 WL_SHM_FORMAT_ABGR2101010,
77 WL_SHM_FORMAT_XRGB2101010,
78 WL_SHM_FORMAT_ARGB2101010,
81 wl_shm_format(INT_MIN),
82 wl_shm_format(INT_MIN),
83 wl_shm_format(INT_MIN),
84 wl_shm_format(INT_MIN),
88 const size_t size =
sizeof(formats_array) /
sizeof(*formats_array);
89 return Array(size, formats_array);