render/pixel_format: add pixel_format_get_opaque_substitute()

We'll soon move opaque substitutes outside of the format table.
Prepare the work by introducing a separate function to get this
piece of information.
This commit is contained in:
Simon Ser 2026-02-19 15:43:51 +01:00
parent f295d0322a
commit 2d95d8d292
4 changed files with 20 additions and 10 deletions

View file

@ -68,4 +68,10 @@ bool pixel_format_has_alpha(uint32_t fmt);
*/
bool pixel_format_is_ycbcr(uint32_t fmt);
/**
* Get the equivalent opaque variant of a format if it has an alpha channel,
* DRM_FORMAT_INVALID otherwise.
*/
uint32_t pixel_format_get_opaque_substitute(uint32_t fmt);
#endif