Skip to content

feat: affine transforms (rotate/translate/scale/shear) - #16

Merged
0717lee merged 1 commit into
mainfrom
feat/affine
Jul 27, 2026
Merged

feat: affine transforms (rotate/translate/scale/shear)#16
0717lee merged 1 commit into
mainfrom
feat/affine

Conversation

@0717lee

@0717lee 0717lee commented Jul 27, 2026

Copy link
Copy Markdown
Owner

Adds a proper affine transform layer on top of the existing bilinear machinery:

  • Affine 2x3 matrix: identity/translation/scaling/rotation/shear constructors, then() composition, invert() -> Option
  • Image::affine: inverse mapping + bilinear sampling, transparent outside coverage
  • Image::rotate(degrees) about center, Image::translate(dx, dy)
  • 6 new tests: point-mapping algebra, compose+invert round trip, identity exactness, integer-shift exactness, rotate(90) == rotate90 byte-for-byte, half-pixel blend = exact midpoint
  • 68/68 tests passing

Closes #6

Adds the Affine 2x3 matrix type (rotation/translation/scaling/shear, composition, inversion) and Image::affine rendering via inverse mapping with bilinear resampling; uncovered areas become transparent. Convenience wrappers: rotate(degrees) about center, translate(dx, dy). Closes #6
@0717lee
0717lee merged commit eb5b83e into main Jul 27, 2026
1 check passed
@0717lee
0717lee deleted the feat/affine branch July 27, 2026 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: affine transforms (arbitrary rotation with bilinear sampling)

1 participant