Commit graph

12 commits

Author SHA1 Message Date
Hendiadyoin1
db0ba9f647 LibGfx: Use some AK/Math helpers in AffineTransform
This makes us use AK::sincos and AK::hypot
2022-05-07 20:25:39 +02:00
Hendiadyoin1
5fd49b9d9f LibGfx: Avoid some unnecessary Rounding in AffineTransform and Color
Casts suffice in these cases.
(Assuming standard rounding mode)
2022-05-07 20:25:39 +02:00
Andreas Kling
b4c3882d9c LibGfx: Add AffineTransform::is_identity_or_translation()
This will allow us to implement fast paths in cases where a simple
translation can be handled faster than a full affine transform.
2022-04-10 21:35:55 +02:00
Andreas Kling
2af8bb14d7 LibGfx: Add AffineTransform::map_to_quad(Rect)
Unlike map(Rect) which returns a Rect, mapping a Rect to a Quad allows
us to represent the actual result of mapping all four corners of the
Rect through the matrix.
2022-04-07 17:06:02 +02:00
Andreas Kling
85327e6b5d LibWeb: Fix broken AffineTransform::map() implementation
When opening canvas-rotate.html on my host machine, I noticed that
the rotation was going the other way.. :^)
2022-04-07 04:01:57 +02:00
Idan Horowitz
086969277e Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
Simon Wanner
9c97bd0de4 LibGfx: Add AffineTransform::inverse 2022-03-18 18:51:42 +01:00
Daniel Bertalan
f14a4994b0 Everywhere: Don't promote float to double where not needed
The `float => double => float` round trip seen in a couple of places
might pessimize the code. Even if it's truncated to an int in the end,
it's weird not to use the functions with the `f` suffixes when working
with single precision floats.
2021-07-08 10:11:00 +02:00
Matthew Olsson
ac238b3bd6 LibGfx: Add some helper methods to AffineTransform
Also makes some basic getters ALWAYS_INLINE and [[nodiscard]], as well
as fixing as error with the map method.
2021-05-02 22:48:06 +02:00
Brian Gianforcaro
1682f0b760 Everything: Move to SPDX license identifiers in all files.
SPDX License Identifiers are a more compact / standardized
way of representing file license information.

See: https://spdx.dev/resources/use/#identifiers

This was done with the `ambr` search and replace tool.

 ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-04-22 11:22:27 +02:00
Andreas Kling
ef1e5db1d0 Everywhere: Remove klog(), dbg() and purge all LogStream usage :^)
Good-bye LogStream. Long live AK::Format!
2021-03-12 17:29:37 +01:00
Andreas Kling
13d7c09125 Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
Renamed from Libraries/LibGfx/AffineTransform.cpp (Browse further)