summaryrefslogtreecommitdiffstats
path: root/libavutil/display.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavutil/display.c')
-rw-r--r--libavutil/display.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/libavutil/display.c b/libavutil/display.c
index da47cee..53e8aa2 100644
--- a/libavutil/display.c
+++ b/libavutil/display.c
@@ -61,3 +61,13 @@ void av_display_rotation_set(int32_t matrix[9], double angle)
matrix[4] = CONV_DB(c);
matrix[8] = 1 << 30;
}
+
+void av_display_matrix_flip(int32_t matrix[9], int hflip, int vflip)
+{
+ int i;
+ const int flip[] = { 1 - 2 * (!!hflip), 1 - 2 * (!!vflip), 1 };
+
+ if (hflip || vflip)
+ for (i = 0; i < 9; i++)
+ matrix[i] *= flip[i % 3];
+}
OpenPOWER on IntegriCloud