summaryrefslogtreecommitdiff
path: root/include/background-image.h
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2019-04-25 11:03:40 -0400
committerDrew DeVault <sir@cmpwn.com>2019-04-25 11:03:40 -0400
commit34e4a47a8675ad2183fb34b0f93699a5a3c21258 (patch)
treea05f189144d2758cc44d70bbea79fbe136c9bc48 /include/background-image.h
parent3ee910d46840771bf32bfd8776ff8bb25853d216 (diff)
downloadswaybg-34e4a47a8675ad2183fb34b0f93699a5a3c21258.tar.gz
swaybg-34e4a47a8675ad2183fb34b0f93699a5a3c21258.tar.bz2
Split swaybg into a standalone project
Diffstat (limited to 'include/background-image.h')
-rw-r--r--include/background-image.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/include/background-image.h b/include/background-image.h
new file mode 100644
index 0000000..15935ff
--- /dev/null
+++ b/include/background-image.h
@@ -0,0 +1,20 @@
+#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,
+ BACKGROUND_MODE_INVALID,
+};
+
+enum background_mode parse_background_mode(const char *mode);
+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);
+
+#endif