Commit Graph

6 Commits

Author SHA1 Message Date
Walter Werner SCHNEIDER 31564b98c9 f32: add tests for Affine2D transformations
References: https://todo.sr.ht/~eliasnaur/gio/655
Signed-off-by: Walter Werner SCHNEIDER <contact@schnwalter.eu>
2025-07-12 09:43:08 +02:00
Walter Werner SCHNEIDER d76b4272aa f32: replace Affine2D{} with AffineId() for identity transformations
Reduces ambiguity by introducing AffineId() for representing identity transformation matrices.

References: https://todo.sr.ht/~eliasnaur/gio/655
Signed-off-by: Walter Werner SCHNEIDER <contact@schnwalter.eu>
2025-07-09 13:35:03 +02:00
Admin f73287be87 all: clean up code, upgrade to modern Go
Signed-off-by: ddkwork
2025-05-05 19:46:39 +02:00
Egon Elbre dead6e007f f32: nicer Affine2D string formatting
Signed-off-by: Egon Elbre <egonelbre@gmail.com>
2022-10-11 13:27:57 -06:00
Egon Elbre 24d6f3fb65 f32: optimize Affine2D
encode/decode seem to introduce significant overhead. Inline them
manually. It'll make code harder to read, however the performance wins
are significant.

name \ time/op                 before       after        delta
TransformOffset-32             2.64ns ± 0%  0.25ns ± 0%   ~     (p=0.100 n=3+3)
TransformScale-32              2.64ns ± 0%  0.25ns ± 1%   ~     (p=0.100 n=3+3)
TransformRotate-32             2.65ns ± 0%  0.24ns ± 3%   ~     (p=0.100 n=3+3)
TransformTranslateMultiply-32  42.5ns ± 0%  12.9ns ± 0%   ~     (p=0.100 n=3+3)
TransformScaleMultiply-32      42.6ns ± 0%  12.9ns ± 0%   ~     (p=0.100 n=3+3)
TransformMultiply-32           42.2ns ± 0%  12.9ns ± 2%   ~     (p=0.100 n=3+3)

Signed-off-by: Egon Elbre <egonelbre@gmail.com>
2020-10-13 15:14:33 +02:00
Viktor e7bc1a4553 f32: implement 2D affine transformations
Implements 2D affine transformations. This commit is a step
towards full affine transformations for drawing operations.

Heavily based on the work by Péter Szilágyi in patch 9212

Signed-off-by: Viktor <viktor.ogeman@gmail.com>
2020-06-21 11:17:37 +02:00