Mercurial > touhou
annotate pytouhou/utils/matrix.pxd @ 792:11bc22bad1bf
python: Replace the image crate with png
We weren’t using any of its features anyway, so the png crate is exactly what
we need, without the many heavy dependencies of image.
https://github.com/image-rs/image-png/pull/670 will eventually make it even
faster to build.
| author | Link Mauve <linkmauve@linkmauve.fr> |
|---|---|
| date | Sat, 17 Jan 2026 22:22:25 +0100 |
| parents | e5361b74b9ad |
| children |
| rev | line source |
|---|---|
|
523
6e3b3d5d4691
Make matrix a struct.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
435
diff
changeset
|
1 ctypedef struct Matrix: |
|
6e3b3d5d4691
Make matrix a struct.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
435
diff
changeset
|
2 float a, b, c, d |
|
6e3b3d5d4691
Make matrix a struct.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
435
diff
changeset
|
3 float e, f, g, h |
|
6e3b3d5d4691
Make matrix a struct.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
435
diff
changeset
|
4 float i, j, k, l |
|
6e3b3d5d4691
Make matrix a struct.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
435
diff
changeset
|
5 float m, n, o, p |
|
6e3b3d5d4691
Make matrix a struct.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
435
diff
changeset
|
6 |
|
6e3b3d5d4691
Make matrix a struct.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
435
diff
changeset
|
7 cdef Matrix *new_matrix(Matrix *data) nogil |
|
6e3b3d5d4691
Make matrix a struct.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
435
diff
changeset
|
8 cdef Matrix *new_identity() nogil |
|
131
fab7ad2f0d8b
Use Cython, improve performances!
Thibaut Girka <thib@sitedethib.com>
parents:
diff
changeset
|
9 |
|
523
6e3b3d5d4691
Make matrix a struct.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
435
diff
changeset
|
10 cdef void mul(Matrix *mat1, Matrix *mat2) nogil |
|
6e3b3d5d4691
Make matrix a struct.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
435
diff
changeset
|
11 cdef void flip(Matrix *mat) nogil |
|
6e3b3d5d4691
Make matrix a struct.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
435
diff
changeset
|
12 cdef void scale2d(Matrix *mat, float x, float y) nogil |
|
527
db28538cd399
Use Sprite C arrays instead of their tuple representation where it makes sense.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
523
diff
changeset
|
13 cdef void translate(Matrix *mat, float[3] offset) nogil |
|
523
6e3b3d5d4691
Make matrix a struct.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
435
diff
changeset
|
14 cdef void translate2d(Matrix *mat, float x, float y) nogil |
|
6e3b3d5d4691
Make matrix a struct.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
435
diff
changeset
|
15 cdef void rotate_x(Matrix *mat, float angle) nogil |
|
6e3b3d5d4691
Make matrix a struct.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
435
diff
changeset
|
16 cdef void rotate_y(Matrix *mat, float angle) nogil |
|
6e3b3d5d4691
Make matrix a struct.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
435
diff
changeset
|
17 cdef void rotate_z(Matrix *mat, float angle) nogil |
