aboutsummaryrefslogtreecommitdiff
path: root/src/viewport.h
diff options
context:
space:
mode:
authorAnton Älgmyr <anton@algmyr.se>2020-03-11 00:35:28 +0100
committerHarry Jeffery <harry@exec64.co.uk>2020-06-12 01:00:10 +0100
commitf968eb420c8d30d45adc1f668c15c29f5b9ee87d (patch)
tree48e33cd4bc0613dd87d66151cbfaab5d7ff6a093 /src/viewport.h
parenteb60fefc3b7e9b5367bca9d3b5e5d4e50f5b72a7 (diff)
downloadimv-f968eb420c8d30d45adc1f668c15c29f5b9ee87d.tar.gz
Add rotation and flipping commands.
Rotation can be done by any amount (not limited to multiples of 90). Commands allow flipping horizontally and vertically. The flips are done relative to the current rotation.
Diffstat (limited to 'src/viewport.h')
-rw-r--r--src/viewport.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/viewport.h b/src/viewport.h
index 5e5bc24..417bf93 100644
--- a/src/viewport.h
+++ b/src/viewport.h
@@ -42,6 +42,12 @@ void imv_viewport_get_offset(struct imv_viewport *view, int *x, int *y);
/* Fetch viewport scale */
void imv_viewport_get_scale(struct imv_viewport *view, double *scale);
+/* Fetch viewport rotation */
+void imv_viewport_get_rotation(struct imv_viewport *view, double *rotation);
+
+/* Fetch viewport mirror status */
+void imv_viewport_get_mirrored(struct imv_viewport *view, bool *mirrored);
+
/* Set the default pan_factor factor for the x and y position */
void imv_viewport_set_default_pan_factor(struct imv_viewport *view, double pan_factor_x, double pan_factor_y);
@@ -55,6 +61,18 @@ void imv_viewport_move(struct imv_viewport *view, int x, int y,
void imv_viewport_zoom(struct imv_viewport *view, const struct imv_image *image,
enum imv_zoom_source, int mouse_x, int mouse_y, int amount);
+/* Rotate the view by the given number of degrees */
+void imv_viewport_rotate(struct imv_viewport *view, double degrees);
+
+/* Rotate the view to the given number of degrees */
+void imv_viewport_rotate_to(struct imv_viewport *view, double degrees);
+
+/* Flip horizontally (across vertical axis) */
+void imv_viewport_flip_h(struct imv_viewport *view);
+
+/* Flip vertically (across horizontal axis) */
+void imv_viewport_flip_v(struct imv_viewport *view);
+
/* Recenter the view to be in the middle of the image */
void imv_viewport_center(struct imv_viewport *view,
const struct imv_image *image);