rotation = atan2(CONV_FP(matrix[1]) / scale[1],
CONV_FP(matrix[0]) / scale[0]) * 180 / M_PI;
- return rotation;
+ return -rotation;
}
void av_display_rotation_set(int32_t matrix[9], double angle)
{
- double radians = angle * M_PI / 180.0f;
+ double radians = -angle * M_PI / 180.0f;
double c = cos(radians);
double s = sin(radians);
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];
+}