mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-25 22:25:58 +01:00
render/pixel-format: add docs
This commit is contained in:
parent
a0ebc401d0
commit
78a1ac540e
1 changed files with 19 additions and 0 deletions
|
@ -3,6 +3,11 @@
|
||||||
|
|
||||||
#include <wayland-server-protocol.h>
|
#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 {
|
struct wlr_pixel_format_info {
|
||||||
uint32_t drm_format;
|
uint32_t drm_format;
|
||||||
|
|
||||||
|
@ -18,11 +23,25 @@ struct wlr_pixel_format_info {
|
||||||
bool has_alpha;
|
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);
|
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,
|
bool pixel_format_info_check_stride(const struct wlr_pixel_format_info *info,
|
||||||
int32_t stride, int32_t width);
|
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);
|
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);
|
enum wl_shm_format convert_drm_format_to_wl_shm(uint32_t fmt);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue