aboutsummaryrefslogtreecommitdiff
path: root/include/background-image.h
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-04-02 21:57:13 -0400
committerDrew DeVault <sir@cmpwn.com>2018-04-04 18:47:48 -0400
commita28730edee1896242012f80fd0e63e7966652e02 (patch)
treee85d2479ce1b77e23b3c3e34c1d9e0bf87ed30f0 /include/background-image.h
parent3852a710ca62a76f4fd9c6ff9d28e7e5d5fcf78d (diff)
Move swaybg background rendering into common/
swaylock will use it too
Diffstat (limited to 'include/background-image.h')
-rw-r--r--include/background-image.h19
1 files changed, 19 insertions, 0 deletions
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