- Jan 15, 2013
- 12,181
- 35
- 91
https://developer.apple.com/library...ce/CGAffineTransform/Reference/reference.html
tx and ty are translation. I think a and d are scale and b and c are some function of rotation.
I have videos that are flipped and rotated using arbitrary matrices. How can I make them right-side-up again?
One example is [a: 1.0, b: 0.0, c: 0.0, d: -1.0, tx: 0.0, ty: 1080.0]
It has a Y scale of -1, which I believe moves it offscreen, then it's translated 1080 pixels. So the end result is that it's flipped along the Y axis, right?
Is there a formula I can use so I don't have to treat every matrix as a special case?
A piece of sample code I have uses atan2(m.b, m.a) to find the rotation. Won't this be incorrect if the image is flipped?

tx and ty are translation. I think a and d are scale and b and c are some function of rotation.
I have videos that are flipped and rotated using arbitrary matrices. How can I make them right-side-up again?
One example is [a: 1.0, b: 0.0, c: 0.0, d: -1.0, tx: 0.0, ty: 1080.0]
It has a Y scale of -1, which I believe moves it offscreen, then it's translated 1080 pixels. So the end result is that it's flipped along the Y axis, right?
Is there a formula I can use so I don't have to treat every matrix as a special case?
A piece of sample code I have uses atan2(m.b, m.a) to find the rotation. Won't this be incorrect if the image is flipped?