summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorWilliam McKinnon <[email protected]>2023-07-12 01:23:05 -0400
committerGitHub <[email protected]>2023-07-12 01:23:05 -0400
commit120ddde3b1c6343b99ecfb790f15ffbe23c8c2b5 (patch)
treeeeb9685137d95e888a6b98785109b9f3d9129a59 /include
parent9eaa07a4b141bc80a46cb7ab2dc94048f126fa8c (diff)
parent2388e30bd5ef01ab67d6be769743da3e830f59c4 (diff)
Merge pull request #4 from Shinyzenith/main
Sucessfully compile libscenefx and tinywl
Diffstat (limited to 'include')
-rw-r--r--include/render/pixel_format.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/include/render/pixel_format.h b/include/render/pixel_format.h
new file mode 100644
index 0000000..d045b6a
--- /dev/null
+++ b/include/render/pixel_format.h
@@ -0,0 +1,26 @@
+#ifndef RENDER_PIXEL_FORMAT_H
+#define RENDER_PIXEL_FORMAT_H
+
+#include <wayland-server-protocol.h>
+
+struct wlr_pixel_format_info {
+ uint32_t drm_format;
+
+ /* Equivalent of the format if it has an alpha channel,
+ * DRM_FORMAT_INVALID (0) if NA
+ */
+ uint32_t opaque_substitute;
+
+ /* Bits per pixels */
+ uint32_t bpp;
+
+ /* True if the format has an alpha channel */
+ bool has_alpha;
+};
+
+const struct wlr_pixel_format_info *drm_get_pixel_format_info(uint32_t fmt);
+
+uint32_t convert_wl_shm_format_to_drm(enum wl_shm_format fmt);
+enum wl_shm_format convert_drm_format_to_wl_shm(uint32_t fmt);
+
+#endif