From a28730edee1896242012f80fd0e63e7966652e02 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Mon, 2 Apr 2018 21:57:13 -0400 Subject: Move swaybg background rendering into common/ swaylock will use it too --- include/background-image.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 include/background-image.h (limited to 'include/background-image.h') diff --git a/include/background-image.h b/include/background-image.h new file mode 100644 index 00000000..e160e63d --- /dev/null +++ b/include/background-image.h @@ -0,0 +1,19 @@ +#ifndef _SWAY_BACKGROUND_IMAGE_H +#define _SWAY_BACKGROUND_IMAGE_H +#include "cairo.h" + +enum background_mode { + BACKGROUND_MODE_STRETCH, + BACKGROUND_MODE_FILL, + BACKGROUND_MODE_FIT, + BACKGROUND_MODE_CENTER, + BACKGROUND_MODE_TILE, + BACKGROUND_MODE_SOLID_COLOR, +}; + +cairo_surface_t *load_background_image(const char *path); +void render_background_image(cairo_t *cairo, cairo_surface_t *image, + enum background_mode mode, int buffer_width, int buffer_height, + int buffer_scale); + +#endif -- cgit v1.2.3