diff options
author | baskerville <nihilhill@gmail.com> | 2012-05-06 09:39:45 +0200 |
---|---|---|
committer | baskerville <nihilhill@gmail.com> | 2012-05-06 09:39:45 +0200 |
commit | ba0a5b89fa1e9147c60ddb8bbc2b1bcbe2995cd8 (patch) | |
tree | de37696ccd939fb4df934483b39f5e30071ab341 /image.c | |
parent | 56b6d23c0cb05973415bdd2c66af26e8f7db2539 (diff) | |
download | nsxiv-ba0a5b89fa1e9147c60ddb8bbc2b1bcbe2995cd8.tar.zst |
Added horizontal and vertical flip commands
Diffstat (limited to 'image.c')
-rw-r--r-- | image.c | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -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; |