Initialize an Affine transform from a 3x3 numpy float array:: a c e b d f 0 0 1 If *matrix* is None, initialize with the identity transform.
(self, matrix=None, **kwargs)
| 1944 | """ |
| 1945 | |
| 1946 | def __init__(self, matrix=None, **kwargs): |
| 1947 | """ |
| 1948 | Initialize an Affine transform from a 3x3 numpy float array:: |
| 1949 | |
| 1950 | a c e |
| 1951 | b d f |
| 1952 | 0 0 1 |
| 1953 | |
| 1954 | If *matrix* is None, initialize with the identity transform. |
| 1955 | """ |
| 1956 | super().__init__(**kwargs) |
| 1957 | if matrix is None: |
| 1958 | # A bit faster than np.identity(3). |
| 1959 | matrix = IdentityTransform._mtx |
| 1960 | self._mtx = matrix.copy() |
| 1961 | self._invalid = 0 |
| 1962 | |
| 1963 | _base_str = _make_str_method("_mtx") |
| 1964 |