aboutsummaryrefslogtreecommitdiff
path: root/include/render
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2023-05-10 18:52:56 +0200
committerSimon Ser <contact@emersion.fr>2023-05-21 20:28:45 +0000
commit78a1ac540ec1bd1e336f066f6691451643e7b99d (patch)
tree4cc5642b29669f3b22f85385112b98820a32aa28 /include/render
parenta0ebc401d0b529ccede2f895566d4ab8f47986e5 (diff)
render/pixel-format: add docs
Diffstat (limited to 'include/render')
-rw-r--r--include/render/pixel_format.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/include/render/pixel_format.h b/include/render/pixel_format.h
index f5b67d03..04a095b2 100644
--- a/include/render/pixel_format.h
+++ b/include/render/pixel_format.h
@@ -3,6 +3,11 @@
#include <wayland-server-protocol.h>
+/**
+ * Information about a pixel format.
+ *
+ * A pixel format is identified via its DRM four character code (see <drm_fourcc.h>).
+ */
struct wlr_pixel_format_info {
uint32_t drm_format;
@@ -18,11 +23,25 @@ struct wlr_pixel_format_info {
bool has_alpha;
};
+/**
+ * Get pixel format information from a DRM FourCC.
+ *
+ * NULL is returned if the pixel format is unknown.
+ */
const struct wlr_pixel_format_info *drm_get_pixel_format_info(uint32_t fmt);
+/**
+ * Check whether a stride is large enough for a given pixel format and width.
+ */
bool pixel_format_info_check_stride(const struct wlr_pixel_format_info *info,
int32_t stride, int32_t width);
+/**
+ * Convert an enum wl_shm_format to a DRM FourCC.
+ */
uint32_t convert_wl_shm_format_to_drm(enum wl_shm_format fmt);
+/**
+ * Convert a DRM FourCC to an enum wl_shm_format.
+ */
enum wl_shm_format convert_drm_format_to_wl_shm(uint32_t fmt);
#endif