2018-04-03 03:57:13 +02:00
|
|
|
#ifndef _SWAY_BACKGROUND_IMAGE_H
|
|
|
|
#define _SWAY_BACKGROUND_IMAGE_H
|
2021-05-07 22:57:51 +02:00
|
|
|
#include "cairo_util.h"
|
2018-04-03 03:57:13 +02:00
|
|
|
|
|
|
|
enum background_mode {
|
|
|
|
BACKGROUND_MODE_STRETCH,
|
|
|
|
BACKGROUND_MODE_FILL,
|
|
|
|
BACKGROUND_MODE_FIT,
|
|
|
|
BACKGROUND_MODE_CENTER,
|
|
|
|
BACKGROUND_MODE_TILE,
|
|
|
|
BACKGROUND_MODE_SOLID_COLOR,
|
2018-04-03 04:48:13 +02:00
|
|
|
BACKGROUND_MODE_INVALID,
|
2018-04-03 03:57:13 +02:00
|
|
|
};
|
|
|
|
|
2018-04-03 04:48:13 +02:00
|
|
|
enum background_mode parse_background_mode(const char *mode);
|
2018-04-03 03:57:13 +02:00
|
|
|
cairo_surface_t *load_background_image(const char *path);
|
|
|
|
void render_background_image(cairo_t *cairo, cairo_surface_t *image,
|
2018-04-03 04:48:13 +02:00
|
|
|
enum background_mode mode, int buffer_width, int buffer_height);
|
2018-04-03 03:57:13 +02:00
|
|
|
|
|
|
|
#endif
|