display: add matrix flip api
authorVittorio Giovara <vittorio.giovara@gmail.com>
Wed, 18 Jun 2014 22:08:20 +0000 (18:08 -0400)
committerVittorio Giovara <vittorio.giovara@gmail.com>
Wed, 9 Jul 2014 14:14:12 +0000 (10:14 -0400)
doc/APIchanges
libavutil/display.c
libavutil/display.h
libavutil/version.h

index 91bc290..9535b88 100644 (file)
@@ -13,6 +13,9 @@ libavutil:     2013-12-xx
 
 API changes, most recent first:
 
+2014-07-xx - xxxxxxx - lavu 53.18.0 - display.h
+  Add av_display_matrix_flip() to flip the transformation matrix.
+
 2014-07-xx - xxxxxxx - lavc 55.56.0 - dv_profile.h
   Add a public API for DV profile handling.
 
index b2b9832..74aceb2 100644 (file)
@@ -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];
+}
index ea762a4..7e37627 100644 (file)
@@ -74,4 +74,13 @@ double av_display_rotation_get(const int32_t matrix[9]);
  */
 void av_display_rotation_set(int32_t matrix[9], double angle);
 
+/**
+ * Flip the input matrix horizontally and/or vertically.
+ *
+ * @param matrix an allocated transformation matrix
+ * @param hflip whether the matrix should be flipped horizontally
+ * @param vflip whether the matrix should be flipped vertically
+ */
+void av_display_matrix_flip(int32_t matrix[9], int hflip, int vflip);
+
 #endif /* AVUTIL_DISPLAY_H */
index ef38404..a2625b5 100644 (file)
@@ -54,8 +54,8 @@
  */
 
 #define LIBAVUTIL_VERSION_MAJOR 53
-#define LIBAVUTIL_VERSION_MINOR 17
-#define LIBAVUTIL_VERSION_MICRO  1
+#define LIBAVUTIL_VERSION_MINOR 18
+#define LIBAVUTIL_VERSION_MICRO  0
 
 #define LIBAVUTIL_VERSION_INT   AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
                                                LIBAVUTIL_VERSION_MINOR, \