From 4c6caa7c48d887fb4292a08f898af83d9954d571 Mon Sep 17 00:00:00 2001 From: Alexander Orzechowski Date: Thu, 30 Nov 2023 19:55:12 -0500 Subject: wlr_texture: Introduce wlr_texture_read_pixels --- include/wlr/render/wlr_texture.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'include/wlr/render/wlr_texture.h') diff --git a/include/wlr/render/wlr_texture.h b/include/wlr/render/wlr_texture.h index 87ed993f..c24cfaa9 100644 --- a/include/wlr/render/wlr_texture.h +++ b/include/wlr/render/wlr_texture.h @@ -13,6 +13,7 @@ #include #include #include +#include struct wlr_buffer; struct wlr_renderer; @@ -25,6 +26,22 @@ struct wlr_texture { struct wlr_renderer *renderer; }; +struct wlr_texture_read_pixels_options { + /** Memory location to read pixels into */ + void *data; + /** Format used for writing the pixel data */ + uint32_t format; + /** Stride in bytes for the data */ + uint32_t stride; + /** Destination offsets */ + uint32_t dst_x, dst_y; + /** Source box of the texture to read from. If empty, the full texture is assumed. */ + const struct wlr_box src_box; +}; + +bool wlr_texture_read_pixels(struct wlr_texture *texture, + const struct wlr_texture_read_pixels_options *options); + /** * Create a new texture from raw pixel data. `stride` is in bytes. The returned * texture is mutable. -- cgit v1.2.3