@@ -950,38 +950,25 @@ def _get_inverse_affine_matrix(
950
950
translate : List [float ],
951
951
scale : float ,
952
952
shear : List [float ],
953
- centered_shear : bool = True ,
954
953
) -> List [float ]:
955
954
# Helper method to compute inverse matrix for affine transformation
956
955
957
956
# Pillow requires inverse affine transformation matrix:
958
- # option 1 (centered_shear=True) curr : M = T * C * RotateScaleShear * C^-1
959
- # option 2 (centered_shear=False) new : M = T * C * RotateScale * C^-1 * Shear
957
+ # M = T * C * RotateScaleShear * C^-1
960
958
#
961
959
# where T is translation matrix: [1, 0, tx | 0, 1, ty | 0, 0, 1]
962
960
# C is translation matrix to keep center: [1, 0, cx | 0, 1, cy | 0, 0, 1]
963
961
# RotateScaleShear is rotation with scale and shear matrix
964
- # RotateScale is rotation with scale matrix
965
962
#
966
963
# RotateScaleShear(a, s, (sx, sy)) =
967
964
# = R(a) * S(s) * SHy(sy) * SHx(sx)
968
965
# = [ s*cos(a - sy)/cos(sy), s*(-cos(a - sy)*tan(sx)/cos(sy) - sin(a)), 0 ]
969
966
# [ s*sin(a + sy)/cos(sy), s*(-sin(a - sy)*tan(sx)/cos(sy) + cos(a)), 0 ]
970
967
# [ 0 , 0 , 1 ]
971
- #
972
- # RotateScale(a, s) =
973
- # = R(a) * S(s)
974
- # = [ s*cos(a), -s*sin(a), 0 ]
975
- # [ s*sin(a), s*cos(a), 0 ]
976
- # [ 0 , 0 , 1 ]
977
- #
978
968
# where R is a rotation matrix, S is a scaling matrix, and SHx and SHy are the shears:
979
969
# SHx(s) = [1, -tan(s)] and SHy(s) = [1 , 0]
980
970
# [0, 1 ] [-tan(s), 1]
981
971
982
- # TODO: implement the option
983
- assert centered_shear
984
-
985
972
rot = math .radians (angle )
986
973
sx = math .radians (shear [0 ])
987
974
sy = math .radians (shear [1 ])
0 commit comments