Technically, you cannot, because the transformation may include a skew operation, which turns the image into a parallelogram, and the rotation angle is no longer defined.
In any case, since the rotation matrix generates
cos(x) sin(x) 0 -sin(x) cos(x) 0 0 0 1
You can restore the angle with
return atan2(transform.b, transform.a);
kennytm Jan 12 '10 at 19:47 2010-01-12 19:47
source share