From 2ce2339045688dccbae98bd8aa8f4647e880ed04 Mon Sep 17 00:00:00 2001 From: Marius Vlad Date: Tue, 22 Jan 2019 17:56:58 +0200 Subject: [PATCH] pixel-formats: Document pixel format human-friendly conversion methods Signed-off-by: Marius Vlad --- libweston/pixel-formats.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/libweston/pixel-formats.c b/libweston/pixel-formats.c index b96f3b21b..875e65261 100644 --- a/libweston/pixel-formats.c +++ b/libweston/pixel-formats.c @@ -387,6 +387,10 @@ pixel_format_get_info_shm(uint32_t format) return pixel_format_get_info(format); } +/** Retrive a pixel format information structure from a DRM FOURCC format + * + * \param format a DRM FOURCC format + */ WL_EXPORT const struct pixel_format_info * pixel_format_get_info(uint32_t format) { @@ -427,6 +431,15 @@ pixel_format_is_opaque(const struct pixel_format_info *info) return !info->opaque_substitute; } +/** Retrieve the opaque substitute for a pixel format + * + * If the given pixel format contains an alpha channel, look up an identical + * pixel format except where the alpha channel is ignored, if such format + * exists. Otherwise returns the passed in format as is. + * + * \param info a pixel_format_info already retrieved using pixel_format_get_info() + * + */ WL_EXPORT const struct pixel_format_info * pixel_format_get_opaque_substitute(const struct pixel_format_info *info) {