summaryrefslogtreecommitdiffstats
path: root/image.c
diff options
context:
space:
mode:
authorbaskerville <nihilhill@gmail.com>2012-05-06 09:39:45 +0200
committerbaskerville <nihilhill@gmail.com>2012-05-06 09:39:45 +0200
commitba0a5b89fa1e9147c60ddb8bbc2b1bcbe2995cd8 (patch)
treede37696ccd939fb4df934483b39f5e30071ab341 /image.c
parent56b6d23c0cb05973415bdd2c66af26e8f7db2539 (diff)
downloadnsxiv-ba0a5b89fa1e9147c60ddb8bbc2b1bcbe2995cd8.tar.zst
Added horizontal and vertical flip commands
Diffstat (limited to 'image.c')
-rw-r--r--image.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/image.c b/image.c
index 3410a0b..2267204 100644
--- a/image.c
+++ b/image.c
@@ -642,6 +642,26 @@ void img_rotate_right(img_t *img) {
img_rotate(img, 1);
}
+void img_flip(img_t *img, int f) {
+ if (img == NULL || img->im == NULL || img->win == NULL)
+ return;
+
+ imlib_context_set_image(img->im);
+ if (f == 0)
+ imlib_image_flip_horizontal();
+ else
+ imlib_image_flip_vertical();
+ img->dirty = true;
+}
+
+void img_flip_horizontal(img_t *img) {
+ img_flip(img, 0);
+}
+
+void img_flip_vertical(img_t *img) {
+ img_flip(img, 1);
+}
+
void img_toggle_antialias(img_t *img) {
if (img == NULL || img->im == NULL)
return;