diff options
author | Vittorio Giovara <vittorio.giovara@gmail.com> | 2014-06-18 18:08:20 -0400 |
---|---|---|
committer | Vittorio Giovara <vittorio.giovara@gmail.com> | 2014-07-09 10:14:12 -0400 |
commit | a54f03bf07da964a1b04b03b85bc39deba76efa4 (patch) | |
tree | bc25fa712a44e0bb1afca2ce48edd99a88048110 /libavutil/display.c | |
parent | 33a7b453a8e1f090c694ea4f36769dc837be88f0 (diff) | |
download | ffmpeg-a54f03bf07da964a1b04b03b85bc39deba76efa4.tar.gz |
display: add matrix flip api
Diffstat (limited to 'libavutil/display.c')
-rw-r--r-- | libavutil/display.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libavutil/display.c b/libavutil/display.c index b2b98329a0..74aceb2847 100644 --- a/libavutil/display.c +++ b/libavutil/display.c @@ -63,3 +63,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]; +} |