diff --git a/Userland/Libraries/LibGfx/VectorN.h b/Userland/Libraries/LibGfx/VectorN.h index a2a5807c5c8..7f6ad2a82d1 100644 --- a/Userland/Libraries/LibGfx/VectorN.h +++ b/Userland/Libraries/LibGfx/VectorN.h @@ -300,3 +300,27 @@ private: }; } + +namespace AK { + +template +constexpr Gfx::VectorN min(Gfx::VectorN const& a, Gfx::VectorN const& b) +{ + Gfx::VectorN result; + UNROLL_LOOP + for (auto i = 0u; i < N; ++i) + result[i] = min(a[i], b[i]); + return result; +} + +template +constexpr Gfx::VectorN max(Gfx::VectorN const& a, Gfx::VectorN const& b) +{ + Gfx::VectorN result; + UNROLL_LOOP + for (auto i = 0u; i < N; ++i) + result[i] = max(a[i], b[i]); + return result; +} + +}