From 4825ed060816693ce477c59a042b7faa98fddd6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 20 Sep 2023 17:01:16 +0200 Subject: [PATCH] Math: stop wasting time with the explicit Corrade:: prefix. I did this back in 2010 because it "felt like the right thing to do", given that all of Magnum depended on Math and not vice versa. But, strictly speaking, Math already uses typedefs from Magnum/Types.h so why it couldn't also bring in the Corrade namespace, and the Debug/Warning/Error names too. Having to type out Corrade:: in all these was really just a waste of time, weird inconsistency in docs and an extra roadblock for whoever might want to contribute anything there. --- src/Magnum/Math/Algorithms/GaussJordan.h | 2 +- src/Magnum/Math/Algorithms/Svd.h | 2 +- .../Math/Algorithms/Test/GaussJordanTest.cpp | 2 +- .../Math/Algorithms/Test/GramSchmidtTest.cpp | 2 +- src/Magnum/Math/Algorithms/Test/QrTest.cpp | 2 +- src/Magnum/Math/Algorithms/Test/SvdTest.cpp | 2 +- src/Magnum/Math/Angle.h | 21 +- src/Magnum/Math/Bezier.h | 38 +-- src/Magnum/Math/BitVector.h | 16 +- src/Magnum/Math/Color.cpp | 20 +- src/Magnum/Math/Color.h | 60 ++-- src/Magnum/Math/ColorBatch.h | 11 +- src/Magnum/Math/Complex.h | 14 +- src/Magnum/Math/CubicHermite.h | 34 +- src/Magnum/Math/Dual.h | 8 +- src/Magnum/Math/DualComplex.h | 20 +- src/Magnum/Math/DualQuaternion.h | 28 +- src/Magnum/Math/Frustum.h | 18 +- src/Magnum/Math/Functions.cpp | 4 +- src/Magnum/Math/Functions.h | 16 +- src/Magnum/Math/FunctionsBatch.h | 88 ++--- src/Magnum/Math/Half.cpp | 2 +- src/Magnum/Math/Half.h | 9 +- src/Magnum/Math/Intersection.h | 2 +- src/Magnum/Math/Matrix.h | 4 +- src/Magnum/Math/Matrix3.h | 8 +- src/Magnum/Math/Matrix4.h | 8 +- src/Magnum/Math/PackingBatch.cpp | 152 ++++----- src/Magnum/Math/PackingBatch.h | 174 +++++----- src/Magnum/Math/Quaternion.h | 18 +- src/Magnum/Math/Range.h | 32 +- src/Magnum/Math/RectangularMatrix.h | 108 +++--- src/Magnum/Math/Swizzle.h | 4 +- src/Magnum/Math/Test/AngleTest.cpp | 24 +- src/Magnum/Math/Test/BezierTest.cpp | 6 +- src/Magnum/Math/Test/BitVectorTest.cpp | 6 +- src/Magnum/Math/Test/ColorBatchTest.cpp | 12 +- src/Magnum/Math/Test/ColorTest.cpp | 90 ++--- src/Magnum/Math/Test/ComplexTest.cpp | 6 +- .../Math/Test/ConfigurationValueTest.cpp | 36 +- src/Magnum/Math/Test/ConstantsTest.cpp | 2 +- src/Magnum/Math/Test/CubicHermiteTest.cpp | 18 +- src/Magnum/Math/Test/DistanceTest.cpp | 2 +- src/Magnum/Math/Test/DualComplexTest.cpp | 6 +- src/Magnum/Math/Test/DualQuaternionTest.cpp | 6 +- src/Magnum/Math/Test/DualTest.cpp | 6 +- src/Magnum/Math/Test/FrustumTest.cpp | 12 +- src/Magnum/Math/Test/FunctionsBatchTest.cpp | 18 +- src/Magnum/Math/Test/FunctionsBenchmark.cpp | 18 +- src/Magnum/Math/Test/FunctionsTest.cpp | 2 +- src/Magnum/Math/Test/HalfTest.cpp | 38 +-- .../Math/Test/InterpolationBenchmark.cpp | 2 +- .../Math/Test/IntersectionBenchmark.cpp | 2 +- src/Magnum/Math/Test/IntersectionTest.cpp | 2 +- src/Magnum/Math/Test/Matrix3Test.cpp | 2 +- src/Magnum/Math/Test/Matrix4Test.cpp | 4 +- src/Magnum/Math/Test/MatrixBenchmark.cpp | 2 +- src/Magnum/Math/Test/MatrixTest.cpp | 2 +- src/Magnum/Math/Test/PackingBatchTest.cpp | 314 +++++++++--------- src/Magnum/Math/Test/PackingTest.cpp | 2 +- src/Magnum/Math/Test/QuaternionTest.cpp | 24 +- src/Magnum/Math/Test/RangeTest.cpp | 14 +- .../Math/Test/RectangularMatrixTest.cpp | 6 +- .../Math/Test/StrictWeakOrderingTest.cpp | 2 +- src/Magnum/Math/Test/SwizzleTest.cpp | 2 +- src/Magnum/Math/Test/TagsTest.cpp | 3 +- src/Magnum/Math/Test/TypeTraitsTest.cpp | 44 +-- src/Magnum/Math/Test/UnitTest.cpp | 5 +- src/Magnum/Math/Test/Vector2Test.cpp | 2 +- src/Magnum/Math/Test/Vector3Test.cpp | 2 +- src/Magnum/Math/Test/Vector4Test.cpp | 2 +- src/Magnum/Math/Test/VectorBenchmark.cpp | 2 +- src/Magnum/Math/Test/VectorTest.cpp | 10 +- src/Magnum/Math/TypeTraits.h | 6 +- src/Magnum/Math/Vector.h | 51 +-- src/Magnum/Math/instantiation.cpp | 166 ++++----- 76 files changed, 955 insertions(+), 955 deletions(-) diff --git a/src/Magnum/Math/Algorithms/GaussJordan.h b/src/Magnum/Math/Algorithms/GaussJordan.h index 6e68785bd..22ff37594 100644 --- a/src/Magnum/Math/Algorithms/GaussJordan.h +++ b/src/Magnum/Math/Algorithms/GaussJordan.h @@ -62,7 +62,7 @@ template bool gaussJordanInPlaceTra rowMax = row2; /* Swap the rows */ - using Corrade::Utility::swap; + using Utility::swap; swap(a[row], a[rowMax]); swap(t[row], t[rowMax]); diff --git a/src/Magnum/Math/Algorithms/Svd.h b/src/Magnum/Math/Algorithms/Svd.h index 0df3393b7..003ce9041 100644 --- a/src/Magnum/Math/Algorithms/Svd.h +++ b/src/Magnum/Math/Algorithms/Svd.h @@ -255,7 +255,7 @@ template std::tuple= maxIterations-1) { - Corrade::Utility::Error() << "Magnum::Math::Algorithms::svd(): no convergence"; + Error{} << "Magnum::Math::Algorithms::svd(): no convergence"; return std::make_tuple(RectangularMatrix{}, Vector{}, Matrix{ZeroInit}); } diff --git a/src/Magnum/Math/Algorithms/Test/GaussJordanTest.cpp b/src/Magnum/Math/Algorithms/Test/GaussJordanTest.cpp index 6ea8b55d3..18658c524 100644 --- a/src/Magnum/Math/Algorithms/Test/GaussJordanTest.cpp +++ b/src/Magnum/Math/Algorithms/Test/GaussJordanTest.cpp @@ -29,7 +29,7 @@ namespace Magnum { namespace Math { namespace Algorithms { namespace Test { namespace { -struct GaussJordanTest: Corrade::TestSuite::Tester { +struct GaussJordanTest: TestSuite::Tester { explicit GaussJordanTest(); void test(); diff --git a/src/Magnum/Math/Algorithms/Test/GramSchmidtTest.cpp b/src/Magnum/Math/Algorithms/Test/GramSchmidtTest.cpp index 1183797cb..edcd03848 100644 --- a/src/Magnum/Math/Algorithms/Test/GramSchmidtTest.cpp +++ b/src/Magnum/Math/Algorithms/Test/GramSchmidtTest.cpp @@ -29,7 +29,7 @@ namespace Magnum { namespace Math { namespace Algorithms { namespace Test { namespace { -struct GramSchmidtTest: Corrade::TestSuite::Tester { +struct GramSchmidtTest: TestSuite::Tester { explicit GramSchmidtTest(); void orthogonalize(); diff --git a/src/Magnum/Math/Algorithms/Test/QrTest.cpp b/src/Magnum/Math/Algorithms/Test/QrTest.cpp index 216a00bd7..39cad2ab5 100644 --- a/src/Magnum/Math/Algorithms/Test/QrTest.cpp +++ b/src/Magnum/Math/Algorithms/Test/QrTest.cpp @@ -31,7 +31,7 @@ namespace Magnum { namespace Math { namespace Algorithms { namespace Test { namespace { -struct QrTest: Corrade::TestSuite::Tester { +struct QrTest: TestSuite::Tester { explicit QrTest(); void test(); diff --git a/src/Magnum/Math/Algorithms/Test/SvdTest.cpp b/src/Magnum/Math/Algorithms/Test/SvdTest.cpp index 4dec89f29..3e4aea4f9 100644 --- a/src/Magnum/Math/Algorithms/Test/SvdTest.cpp +++ b/src/Magnum/Math/Algorithms/Test/SvdTest.cpp @@ -30,7 +30,7 @@ namespace Magnum { namespace Math { namespace Algorithms { namespace Test { namespace { -struct SvdTest: Corrade::TestSuite::Tester { +struct SvdTest: TestSuite::Tester { explicit SvdTest(); template void test(); diff --git a/src/Magnum/Math/Angle.h b/src/Magnum/Math/Angle.h index 5a022a73a..e411987ac 100644 --- a/src/Magnum/Math/Angle.h +++ b/src/Magnum/Math/Angle.h @@ -34,6 +34,7 @@ #endif #include "Magnum/visibility.h" +#include "Magnum/Magnum.h" #include "Magnum/Math/Constants.h" #include "Magnum/Math/Math.h" #include "Magnum/Math/Unit.h" @@ -230,25 +231,25 @@ template constexpr Rad::Rad(Unit value): Unit( #ifndef CORRADE_SINGLES_NO_DEBUG /** @debugoperator{Rad} */ -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug& debug, const Unit& value) { - if(debug.immediateFlags() >= Corrade::Utility::Debug::Flag::Packed) +template Utility::Debug& operator<<(Utility::Debug& debug, const Unit& value) { + if(debug.immediateFlags() >= Utility::Debug::Flag::Packed) return debug << T(value); - return debug << "Rad(" << Corrade::Utility::Debug::nospace << T(value) << Corrade::Utility::Debug::nospace << ")"; + return debug << "Rad(" << Utility::Debug::nospace << T(value) << Utility::Debug::nospace << ")"; } /** @debugoperator{Deg} */ -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug& debug, const Unit& value) { - if(debug.immediateFlags() >= Corrade::Utility::Debug::Flag::Packed) +template Utility::Debug& operator<<(Utility::Debug& debug, const Unit& value) { + if(debug.immediateFlags() >= Utility::Debug::Flag::Packed) return debug << T(value); - return debug << "Deg(" << Corrade::Utility::Debug::nospace << T(value) << Corrade::Utility::Debug::nospace << ")"; + return debug << "Deg(" << Utility::Debug::nospace << T(value) << Utility::Debug::nospace << ")"; } /* Explicit instantiation for commonly used types */ #ifndef DOXYGEN_GENERATING_OUTPUT -extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Unit&); -extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Unit&); -extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Unit&); -extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Unit&); +extern template MAGNUM_EXPORT Utility::Debug& operator<<(Utility::Debug&, const Unit&); +extern template MAGNUM_EXPORT Utility::Debug& operator<<(Utility::Debug&, const Unit&); +extern template MAGNUM_EXPORT Utility::Debug& operator<<(Utility::Debug&, const Unit&); +extern template MAGNUM_EXPORT Utility::Debug& operator<<(Utility::Debug&, const Unit&); #endif #endif diff --git a/src/Magnum/Math/Bezier.h b/src/Magnum/Math/Bezier.h index d13737b5f..314db596d 100644 --- a/src/Magnum/Math/Bezier.h +++ b/src/Magnum/Math/Bezier.h @@ -102,17 +102,17 @@ template class Bezier { * * Equivalent to @ref Bezier(ZeroInitT). */ - constexpr /*implicit*/ Bezier() noexcept: Bezier{typename Corrade::Containers::Implementation::GenerateSequence::Type{}, ZeroInit} {} + constexpr /*implicit*/ Bezier() noexcept: Bezier{typename Containers::Implementation::GenerateSequence::Type{}, ZeroInit} {} /** * @brief Construct a zero curve * * All control points are zero vectors. */ - constexpr explicit Bezier(ZeroInitT) noexcept: Bezier{typename Corrade::Containers::Implementation::GenerateSequence::Type{}, ZeroInit} {} + constexpr explicit Bezier(ZeroInitT) noexcept: Bezier{typename Containers::Implementation::GenerateSequence::Type{}, ZeroInit} {} /** @brief Construct Bézier without initializing the contents */ - explicit Bezier(Magnum::NoInitT) noexcept: Bezier{typename Corrade::Containers::Implementation::GenerateSequence::Type{}, Magnum::NoInit} {} + explicit Bezier(Magnum::NoInitT) noexcept: Bezier{typename Containers::Implementation::GenerateSequence::Type{}, Magnum::NoInit} {} /** @brief Construct Bézier curve with given array of control points */ template constexpr /*implicit*/ Bezier(const Vector& first, U... next) noexcept: _data{first, next...} { @@ -125,7 +125,7 @@ template class Bezier { * Performs only default casting on the values, no rounding or * anything else. */ - template constexpr explicit Bezier(const Bezier& other) noexcept: Bezier{typename Corrade::Containers::Implementation::GenerateSequence::Type{}, other} {} + template constexpr explicit Bezier(const Bezier& other) noexcept: Bezier{typename Containers::Implementation::GenerateSequence::Type{}, other} {} /** @brief Construct Bézier curve from external representation */ template::from(std::declval()))> constexpr explicit Bezier(const U& other) noexcept: Bezier{Implementation::BezierConverter::from(other)} {} @@ -207,11 +207,11 @@ template class Bezier { private: /* Implementation for Bezier::Bezier(const Bezier&) */ - template constexpr explicit Bezier(Corrade::Containers::Implementation::Sequence, const Bezier& other) noexcept: _data{Vector(other._data[sequence])...} {} + template constexpr explicit Bezier(Containers::Implementation::Sequence, const Bezier& other) noexcept: _data{Vector(other._data[sequence])...} {} /* Implementation for Bezier::Bezier(ZeroInitT) and Bezier::Bezier(NoInitT) */ /* MSVC 2015 can't handle {} here */ - template constexpr explicit Bezier(Corrade::Containers::Implementation::Sequence, U): _data{Vector((static_cast(sequence), U{typename U::Init{}}))...} {} + template constexpr explicit Bezier(Containers::Implementation::Sequence, U): _data{Vector((static_cast(sequence), U{typename U::Init{}}))...} {} /* Calculates and returns all intermediate points generated when using De Casteljau's algorithm */ void calculateIntermediatePoints(Bezier(&iPoints)[order + 1], T t) const { @@ -300,27 +300,27 @@ template using CubicBezier3D = CubicBezier<3, T>; #ifndef CORRADE_SINGLES_NO_DEBUG /** @debugoperator{Bezier} */ -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug& debug, const Bezier& value) { - debug << "Bezier(" << Corrade::Utility::Debug::nospace; +template Utility::Debug& operator<<(Debug& debug, const Bezier& value) { + debug << "Bezier(" << Debug::nospace; for(UnsignedInt o = 0; o != order + 1; ++o) { - debug << (o ? ", {" : "{") << Corrade::Utility::Debug::nospace << value[o][0] << Corrade::Utility::Debug::nospace; + debug << (o ? ", {" : "{") << Debug::nospace << value[o][0] << Debug::nospace; for(UnsignedInt i = 1; i != dimensions; ++i) - debug << "," << value[o][i] << Corrade::Utility::Debug::nospace; - debug << "}" << Corrade::Utility::Debug::nospace; + debug << "," << value[o][i] << Debug::nospace; + debug << "}" << Debug::nospace; } return debug << ")"; } /* Explicit instantiation for commonly used types */ #ifndef DOXYGEN_GENERATING_OUTPUT -extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Bezier<2, 2, Float>&); -extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Bezier<2, 3, Float>&); -extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Bezier<3, 2, Float>&); -extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Bezier<3, 3, Float>&); -extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Bezier<2, 2, Double>&); -extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Bezier<2, 3, Double>&); -extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Bezier<3, 2, Double>&); -extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Bezier<3, 3, Double>&); +extern template MAGNUM_EXPORT Debug& operator<<(Debug&, const Bezier<2, 2, Float>&); +extern template MAGNUM_EXPORT Debug& operator<<(Debug&, const Bezier<2, 3, Float>&); +extern template MAGNUM_EXPORT Debug& operator<<(Debug&, const Bezier<3, 2, Float>&); +extern template MAGNUM_EXPORT Debug& operator<<(Debug&, const Bezier<3, 3, Float>&); +extern template MAGNUM_EXPORT Debug& operator<<(Debug&, const Bezier<2, 2, Double>&); +extern template MAGNUM_EXPORT Debug& operator<<(Debug&, const Bezier<2, 3, Double>&); +extern template MAGNUM_EXPORT Debug& operator<<(Debug&, const Bezier<3, 2, Double>&); +extern template MAGNUM_EXPORT Debug& operator<<(Debug&, const Bezier<3, 3, Double>&); #endif #endif diff --git a/src/Magnum/Math/BitVector.h b/src/Magnum/Math/BitVector.h index 52e579ce2..a2bc0ad2a 100644 --- a/src/Magnum/Math/BitVector.h +++ b/src/Magnum/Math/BitVector.h @@ -36,7 +36,7 @@ #include #endif -#include "Magnum/Types.h" +#include "Magnum/Magnum.h" #include "Magnum/Math/Math.h" #include "Magnum/Math/Tags.h" @@ -119,7 +119,7 @@ template class BitVector { #ifdef DOXYGEN_GENERATING_OUTPUT explicit BitVector(T value) noexcept; #else - template::value && size != 1, bool>::type> constexpr explicit BitVector(T value) noexcept: BitVector(typename Corrade::Containers::Implementation::GenerateSequence::Type{}, value ? FullSegmentMask : 0) {} + template::value && size != 1, bool>::type> constexpr explicit BitVector(T value) noexcept: BitVector(typename Containers::Implementation::GenerateSequence::Type{}, value ? FullSegmentMask : 0) {} #endif /** @brief Construct a boolean vector from external representation */ @@ -324,7 +324,7 @@ template class BitVector { }; /* Implementation for Vector::Vector(U) */ - template constexpr explicit BitVector(Corrade::Containers::Implementation::Sequence, UnsignedByte value): _data{Implementation::repeat(value, sequence)...} {} + template constexpr explicit BitVector(Containers::Implementation::Sequence, UnsignedByte value): _data{Implementation::repeat(value, sequence)...} {} UnsignedByte _data[DataSize]; }; @@ -352,22 +352,22 @@ BitVector(0b1010) BitVector(0b00001000, 0b00000011, 0b100) Note that this, on the other hand, makes mapping to bit indices less obvious --- see @ref Math-BitVector-indexing for more information. */ -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug& debug, const BitVector& value) { - debug << "BitVector(0b" << Corrade::Utility::Debug::nospace; +template Debug& operator<<(Debug& debug, const BitVector& value) { + debug << "BitVector(0b" << Debug::nospace; /* Print the full bytes comma-separated */ for(std::size_t byte = 0; byte != BitVector::DataSize - 1; ++byte) { for(std::size_t i = 0; i != 8; ++i) debug << (((value.data()[byte] >> (8 - i - 1)) & 1) ? "1" : "0") - << Corrade::Utility::Debug::nospace; - debug << ", 0b" << Corrade::Utility::Debug::nospace; + << Debug::nospace; + debug << ", 0b" << Debug::nospace; } /* Print the last (potentially) partial byte */ constexpr std::size_t suffixSize = size%8 ? size%8 : 8; for(std::size_t i = 0; i != suffixSize; ++i) debug << (((value.data()[size/8] >> (suffixSize - i - 1)) & 1) ? "1" : "0") - << Corrade::Utility::Debug::nospace; + << Debug::nospace; return debug << ")"; } diff --git a/src/Magnum/Math/Color.cpp b/src/Magnum/Math/Color.cpp index b561b417b..ddf186b3f 100644 --- a/src/Magnum/Math/Color.cpp +++ b/src/Magnum/Math/Color.cpp @@ -37,9 +37,9 @@ namespace { constexpr const char Hex[]{"0123456789abcdef"}; } -Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug& debug, const Color3& value) { +Debug& operator<<(Debug& debug, const Color3& value) { /* Print an actual colored square if requested */ - if(debug.immediateFlags() & Corrade::Utility::Debug::Flag::Color) { + if(debug.immediateFlags() & Debug::Flag::Color) { /* Pick a shade based on calculated lightness */ const Float valueValue = value.value(); const char* shade; @@ -50,15 +50,15 @@ Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug& debug, const Color3 else shade = "██"; /* If ANSI colors are disabled, use just the shade */ - if(debug.immediateFlags() & Corrade::Utility::Debug::Flag::DisableColors) + if(debug.immediateFlags() & Debug::Flag::DisableColors) return debug << shade; else { debug << "\033[38;2;"; /* Disable space between values for everything after the initial value */ - const Corrade::Utility::Debug::Flags previousFlags = debug.flags(); - debug.setFlags(previousFlags|Corrade::Utility::Debug::Flag::NoSpace); + const Debug::Flags previousFlags = debug.flags(); + debug.setFlags(previousFlags|Debug::Flag::NoSpace); /* Set both background and foreground, reset back after */ debug << int(value.r()) << ";" << int(value.g()) << ";" @@ -83,9 +83,9 @@ Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug& debug, const Color3 } } -Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug& debug, const Color4& value) { +Debug& operator<<(Debug& debug, const Color4& value) { /* Print an actual colored square if requested */ - if(debug.immediateFlags() & Corrade::Utility::Debug::Flag::Color) { + if(debug.immediateFlags() & Debug::Flag::Color) { /* Pick a shade based on calculated lightness */ const Float valueValue = value.value(); const Float alpha = Math::unpack(value.a()); @@ -98,15 +98,15 @@ Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug& debug, const Color4 else shade = "██"; /* If ANSI colors are disabled, use just the shade */ - if(debug.immediateFlags() & Corrade::Utility::Debug::Flag::DisableColors) + if(debug.immediateFlags() & Debug::Flag::DisableColors) return debug << shade; else { debug << "\033[38;2;"; /* Disable space between values for everything after the initial value */ - const Corrade::Utility::Debug::Flags previousFlags = debug.flags(); - debug.setFlags(previousFlags|Corrade::Utility::Debug::Flag::NoSpace); + const Debug::Flags previousFlags = debug.flags(); + debug.setFlags(previousFlags|Debug::Flag::NoSpace); /* Print foreground color */ debug << int(value.r()) << ";" << int(value.g()) << ";" diff --git a/src/Magnum/Math/Color.h b/src/Magnum/Math/Color.h index d1a4f6a91..f0bacb3ce 100644 --- a/src/Magnum/Math/Color.h +++ b/src/Magnum/Math/Color.h @@ -1343,16 +1343,16 @@ template struct ColorHsv { #ifndef CORRADE_SINGLES_NO_DEBUG /** @debugoperator{ColorHsv} */ -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug& debug, const ColorHsv& value) { - return debug << "ColorHsv(" << Corrade::Utility::Debug::nospace << value.hue - << Corrade::Utility::Debug::nospace << "," << value.saturation - << Corrade::Utility::Debug::nospace << "," << value.value - << Corrade::Utility::Debug::nospace << ")"; +template Debug& operator<<(Debug& debug, const ColorHsv& value) { + return debug << "ColorHsv(" << Debug::nospace << value.hue + << Debug::nospace << "," << value.saturation + << Debug::nospace << "," << value.value + << Debug::nospace << ")"; } /* Explicit instantiation for commonly used types */ #ifndef DOXYGEN_GENERATING_OUTPUT -extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const ColorHsv&); +extern template MAGNUM_EXPORT Debug& operator<<(Debug&, const ColorHsv&); #endif #endif @@ -1527,22 +1527,20 @@ inline Color4 operator "" _srgbaf(unsigned long long value) { /** @debugoperator{Color3} -If @ref Corrade::Utility::Debug::Flag::Color is enabled or -@ref Corrade::Utility::Debug::color was set immediately before, prints the -value as an ANSI 24bit color escape sequence using two successive Unicode block -characters (to have it roughly square). To preserve at least some information -when text is copied, the square consists of one of the five -@cb{.shell-session} ░▒▓█ @ce shades, however the color is set for both +If @ref Debug::Flag::Color is enabled or @ref Debug::color was set immediately +before, prints the value as an ANSI 24bit color escape sequence using two +successive Unicode block characters (to have it roughly square). To preserve at +least some information when text is copied, the square consists of one of the +five @cb{.shell-session} ░▒▓█ @ce shades, however the color is set for both foreground and background so the actual block character is indistinguishable when seen on a terminal. -If @ref Corrade::Utility::Debug::Flag::Color is enabled and -@ref Corrade::Utility::Debug::Flag::DisableColors is set, only the shaded -character is used, without any ANSI color escape sequence. +If @ref Debug::Flag::Color is enabled and @ref Debug::Flag::DisableColors is +set, only the shaded character is used, without any ANSI color escape sequence. -If @ref Corrade::Utility::Debug::Flag::Color is not enabled, the value is -printed as a hex color (e.g. @cb{.shell-session} #ff33aa @ce). Other underlying -types are handled by @ref operator<<(Corrade::Utility::Debug&, const Vector&). +If @ref Debug::Flag::Color is not enabled, the value is printed as a hex color +(e.g. @cb{.shell-session} #ff33aa @ce). Other underlying types are handled by +@ref operator<<(Debug&, const Vector&). For example, the following snippet: @@ -1556,28 +1554,26 @@ prints the following on terminals that support it: @include MathColor3-debug.ansi */ -MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug& debug, const Color3& value); +MAGNUM_EXPORT Debug& operator<<(Debug& debug, const Color3& value); /** @debugoperator{Color4} -If @ref Corrade::Utility::Debug::Flag::Color is enabled or -@ref Corrade::Utility::Debug::color was set immediately before, prints the -value as an ANSI 24bit color escape sequence using two successive Unicode block -characters (to have it roughly square). To preserve at least some information -when text is copied, the square consists of one of the five -@cb{.shell-session} ░▒▓█ @ce shades. The square shade is calculated as a +If @ref Debug::Flag::Color is enabled or @ref Debug::color was set immediately +before, prints the value as an ANSI 24bit color escape sequence using two +successive Unicode block characters (to have it roughly square). To preserve at +least some information when text is copied, the square consists of one of the +five @cb{.shell-session} ░▒▓█ @ce shades. The square shade is calculated as a product of @ref Color4::value() and @ref Color4::a(). If calculated color value is less than alpha, the colored square has the color set for both background and foreground, otherwise the background is left at the default. -If @ref Corrade::Utility::Debug::Flag::Color is enabled and -@ref Corrade::Utility::Debug::Flag::DisableColors is set, only the shaded -character is used, without any ANSI color escape sequence. +If @ref Debug::Flag::Color is enabled and @ref Debug::Flag::DisableColors is +set, only the shaded character is used, without any ANSI color escape sequence. -If @ref Corrade::Utility::Debug::Flag::Color is not enabled, the value is -printed as a hex color (e.g. @cb{.shell-session} #ff33aaff @ce). Other -underlying types are handled by @ref operator<<(Corrade::Utility::Debug&, const Vector&). +If @ref Debug::Flag::Color is not enabled, the value is printed as a hex color +(e.g. @cb{.shell-session} #ff33aaff @ce). Other underlying types are handled by +@ref operator<<(Debug&, const Vector&). For example, the following snippet: @@ -1591,7 +1587,7 @@ prints the following on terminals that support it: @include MathColor4-debug.ansi */ -MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug& debug, const Color4& value); +MAGNUM_EXPORT Debug& operator<<(Debug& debug, const Color4& value); #endif namespace Implementation { diff --git a/src/Magnum/Math/ColorBatch.h b/src/Magnum/Math/ColorBatch.h index e88718164..7442f5fbc 100644 --- a/src/Magnum/Math/ColorBatch.h +++ b/src/Magnum/Math/ColorBatch.h @@ -32,6 +32,7 @@ #include +#include "Magnum/Magnum.h" #include "Magnum/visibility.h" namespace Magnum { namespace Math { @@ -55,7 +56,7 @@ expected to be contiguous with size of 8. @ref CompressedPixelFormat::Bc1RGBAUnorm, @ref CompressedPixelFormat::Bc1RGBASrgb */ -MAGNUM_EXPORT void yFlipBc1InPlace(const Corrade::Containers::StridedArrayView4D& blocks); +MAGNUM_EXPORT void yFlipBc1InPlace(const Containers::StridedArrayView4D& blocks); /** @brief Y-flip BC2 texture blocks in-place @@ -74,7 +75,7 @@ expected to be contiguous with size of 16. @see @ref CompressedPixelFormat::Bc2RGBAUnorm, @ref CompressedPixelFormat::Bc2RGBASrgb */ -MAGNUM_EXPORT void yFlipBc2InPlace(const Corrade::Containers::StridedArrayView4D& blocks); +MAGNUM_EXPORT void yFlipBc2InPlace(const Containers::StridedArrayView4D& blocks); /** @brief Y-flip BC3 texture blocks in-place @@ -96,7 +97,7 @@ same as performing @ref yFlipBc4InPlace() on the first half and @see @ref CompressedPixelFormat::Bc3RGBAUnorm, @ref CompressedPixelFormat::Bc3RGBASrgb */ -MAGNUM_EXPORT void yFlipBc3InPlace(const Corrade::Containers::StridedArrayView4D& blocks); +MAGNUM_EXPORT void yFlipBc3InPlace(const Containers::StridedArrayView4D& blocks); /** @brief Y-flip BC4 texture blocks in-place @@ -115,7 +116,7 @@ expected to be contiguous with size of 8. @see @ref CompressedPixelFormat::Bc4RUnorm, @ref CompressedPixelFormat::Bc4RSnorm */ -MAGNUM_EXPORT void yFlipBc4InPlace(const Corrade::Containers::StridedArrayView4D& blocks); +MAGNUM_EXPORT void yFlipBc4InPlace(const Containers::StridedArrayView4D& blocks); /** @brief Y-flip BC5 texture blocks in-place @@ -136,7 +137,7 @@ halves of each block. @see @ref CompressedPixelFormat::Bc5RGUnorm, @ref CompressedPixelFormat::Bc5RGSnorm */ -MAGNUM_EXPORT void yFlipBc5InPlace(const Corrade::Containers::StridedArrayView4D& blocks); +MAGNUM_EXPORT void yFlipBc5InPlace(const Containers::StridedArrayView4D& blocks); }} diff --git a/src/Magnum/Math/Complex.h b/src/Magnum/Math/Complex.h index c78026269..db49d46dc 100644 --- a/src/Magnum/Math/Complex.h +++ b/src/Magnum/Math/Complex.h @@ -653,22 +653,22 @@ template inline Complex Complex::fromMatrix(const Matrix2x2& m Vector::isNormalized(), which compares the dot product (length squared) to 1 ± 2ε. */ CORRADE_DEBUG_ASSERT(std::abs(matrix.determinant() - T(1)) < T(2)*TypeTraits::epsilon(), - "Math::Complex::fromMatrix(): the matrix is not a rotation:" << Corrade::Utility::Debug::newline << matrix, {}); + "Math::Complex::fromMatrix(): the matrix is not a rotation:" << Debug::newline << matrix, {}); return Implementation::complexFromMatrix(matrix); } #ifndef CORRADE_SINGLES_NO_DEBUG /** @debugoperator{Complex} */ -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug& debug, const Complex& value) { - return debug << "Complex(" << Corrade::Utility::Debug::nospace - << value.real() << Corrade::Utility::Debug::nospace << "," - << value.imaginary() << Corrade::Utility::Debug::nospace << ")"; +template Debug& operator<<(Debug& debug, const Complex& value) { + return debug << "Complex(" << Debug::nospace + << value.real() << Debug::nospace << "," + << value.imaginary() << Debug::nospace << ")"; } /* Explicit instantiation for commonly used types */ #ifndef DOXYGEN_GENERATING_OUTPUT -extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Complex&); -extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Complex&); +extern template MAGNUM_EXPORT Debug& operator<<(Debug&, const Complex&); +extern template MAGNUM_EXPORT Debug& operator<<(Debug&, const Complex&); #endif #endif diff --git a/src/Magnum/Math/CubicHermite.h b/src/Magnum/Math/CubicHermite.h index ac6a71e6b..abb1481c2 100644 --- a/src/Magnum/Math/CubicHermite.h +++ b/src/Magnum/Math/CubicHermite.h @@ -280,27 +280,27 @@ template using CubicHermiteQuaternion = CubicHermite>; #ifndef CORRADE_SINGLES_NO_DEBUG /** @debugoperator{CubicHermite} */ -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug& debug, const CubicHermite& value) { - return debug << "CubicHermite(" << Corrade::Utility::Debug::nospace - << value.inTangent() << Corrade::Utility::Debug::nospace << "," - << value.point() << Corrade::Utility::Debug::nospace << "," - << value.outTangent() << Corrade::Utility::Debug::nospace << ")"; +template Debug& operator<<(Debug& debug, const CubicHermite& value) { + return debug << "CubicHermite(" << Debug::nospace + << value.inTangent() << Debug::nospace << "," + << value.point() << Debug::nospace << "," + << value.outTangent() << Debug::nospace << ")"; } /* Explicit instantiation for commonly used types */ #ifndef DOXYGEN_GENERATING_OUTPUT -extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const CubicHermite&); -extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const CubicHermite&); -extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const CubicHermite>&); -extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const CubicHermite>&); -extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const CubicHermite>&); -extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const CubicHermite>&); -extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const CubicHermite>&); -extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const CubicHermite>&); -extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const CubicHermite>&); -extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const CubicHermite>&); -extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const CubicHermite>&); -extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const CubicHermite>&); +extern template MAGNUM_EXPORT Debug& operator<<(Debug&, const CubicHermite&); +extern template MAGNUM_EXPORT Debug& operator<<(Debug&, const CubicHermite&); +extern template MAGNUM_EXPORT Debug& operator<<(Debug&, const CubicHermite>&); +extern template MAGNUM_EXPORT Debug& operator<<(Debug&, const CubicHermite>&); +extern template MAGNUM_EXPORT Debug& operator<<(Debug&, const CubicHermite>&); +extern template MAGNUM_EXPORT Debug& operator<<(Debug&, const CubicHermite>&); +extern template MAGNUM_EXPORT Debug& operator<<(Debug&, const CubicHermite>&); +extern template MAGNUM_EXPORT Debug& operator<<(Debug&, const CubicHermite>&); +extern template MAGNUM_EXPORT Debug& operator<<(Debug&, const CubicHermite>&); +extern template MAGNUM_EXPORT Debug& operator<<(Debug&, const CubicHermite>&); +extern template MAGNUM_EXPORT Debug& operator<<(Debug&, const CubicHermite>&); +extern template MAGNUM_EXPORT Debug& operator<<(Debug&, const CubicHermite>&); #endif #endif diff --git a/src/Magnum/Math/Dual.h b/src/Magnum/Math/Dual.h index eef2f9740..df9384376 100644 --- a/src/Magnum/Math/Dual.h +++ b/src/Magnum/Math/Dual.h @@ -376,10 +376,10 @@ template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug& debug, const Dual& value) { - return debug << "Dual(" << Corrade::Utility::Debug::nospace - << value.real() << Corrade::Utility::Debug::nospace << "," - << value.dual() << Corrade::Utility::Debug::nospace << ")"; +template Debug& operator<<(Debug& debug, const Dual& value) { + return debug << "Dual(" << Debug::nospace + << value.real() << Debug::nospace << "," + << value.dual() << Debug::nospace << ")"; } #endif diff --git a/src/Magnum/Math/DualComplex.h b/src/Magnum/Math/DualComplex.h index 025ff45d9..839a176ee 100644 --- a/src/Magnum/Math/DualComplex.h +++ b/src/Magnum/Math/DualComplex.h @@ -103,7 +103,7 @@ template class DualComplex: public Dual> { */ static DualComplex fromMatrix(const Matrix3& matrix) { CORRADE_DEBUG_ASSERT(matrix.isRigidTransformation(), - "Math::DualComplex::fromMatrix(): the matrix doesn't represent rigid transformation:" << Corrade::Utility::Debug::newline << matrix, {}); + "Math::DualComplex::fromMatrix(): the matrix doesn't represent rigid transformation:" << Debug::newline << matrix, {}); return {Implementation::complexFromMatrix(matrix.rotationScaling()), Complex(matrix.translation())}; } @@ -405,19 +405,19 @@ MAGNUM_DUAL_OPERATOR_IMPLEMENTATION(DualComplex, Vector2, T) #ifndef CORRADE_SINGLES_NO_DEBUG /** @debugoperator{DualComplex} */ -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug& debug, const DualComplex& value) { - return debug << "DualComplex({" << Corrade::Utility::Debug::nospace - << value.real().real() << Corrade::Utility::Debug::nospace << "," - << value.real().imaginary() << Corrade::Utility::Debug::nospace << "}, {" - << Corrade::Utility::Debug::nospace - << value.dual().real() << Corrade::Utility::Debug::nospace << "," - << value.dual().imaginary() << Corrade::Utility::Debug::nospace << "})"; +template Debug& operator<<(Debug& debug, const DualComplex& value) { + return debug << "DualComplex({" << Debug::nospace + << value.real().real() << Debug::nospace << "," + << value.real().imaginary() << Debug::nospace << "}, {" + << Debug::nospace + << value.dual().real() << Debug::nospace << "," + << value.dual().imaginary() << Debug::nospace << "})"; } /* Explicit instantiation for commonly used types */ #ifndef DOXYGEN_GENERATING_OUTPUT -extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const DualComplex&); -extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const DualComplex&); +extern template MAGNUM_EXPORT Debug& operator<<(Debug&, const DualComplex&); +extern template MAGNUM_EXPORT Debug& operator<<(Debug&, const DualComplex&); #endif #endif diff --git a/src/Magnum/Math/DualQuaternion.h b/src/Magnum/Math/DualQuaternion.h index 91746d246..3b2130f19 100644 --- a/src/Magnum/Math/DualQuaternion.h +++ b/src/Magnum/Math/DualQuaternion.h @@ -241,7 +241,7 @@ template class DualQuaternion: public Dual> { */ static DualQuaternion fromMatrix(const Matrix4& matrix) { CORRADE_DEBUG_ASSERT(matrix.isRigidTransformation(), - "Math::DualQuaternion::fromMatrix(): the matrix doesn't represent a rigid transformation:" << Corrade::Utility::Debug::newline << matrix, {}); + "Math::DualQuaternion::fromMatrix(): the matrix doesn't represent a rigid transformation:" << Debug::newline << matrix, {}); Quaternion q = Implementation::quaternionFromMatrix(matrix.rotationScaling()); return {q, Quaternion(matrix.translation()/2)*q}; @@ -569,23 +569,23 @@ MAGNUM_DUAL_OPERATOR_IMPLEMENTATION(DualQuaternion, Quaternion, T) #ifndef CORRADE_SINGLES_NO_DEBUG /** @debugoperator{DualQuaternion} */ -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug& debug, const DualQuaternion& value) { - return debug << "DualQuaternion({{" << Corrade::Utility::Debug::nospace - << value.real().vector().x() << Corrade::Utility::Debug::nospace << "," - << value.real().vector().y() << Corrade::Utility::Debug::nospace << "," - << value.real().vector().z() << Corrade::Utility::Debug::nospace << "}," - << value.real().scalar() << Corrade::Utility::Debug::nospace << "}, {{" - << Corrade::Utility::Debug::nospace - << value.dual().vector().x() << Corrade::Utility::Debug::nospace << "," - << value.dual().vector().y() << Corrade::Utility::Debug::nospace << "," - << value.dual().vector().z() << Corrade::Utility::Debug::nospace << "}," - << value.dual().scalar() << Corrade::Utility::Debug::nospace << "})"; +template Debug& operator<<(Debug& debug, const DualQuaternion& value) { + return debug << "DualQuaternion({{" << Debug::nospace + << value.real().vector().x() << Debug::nospace << "," + << value.real().vector().y() << Debug::nospace << "," + << value.real().vector().z() << Debug::nospace << "}," + << value.real().scalar() << Debug::nospace << "}, {{" + << Debug::nospace + << value.dual().vector().x() << Debug::nospace << "," + << value.dual().vector().y() << Debug::nospace << "," + << value.dual().vector().z() << Debug::nospace << "}," + << value.dual().scalar() << Debug::nospace << "})"; } /* Explicit instantiation for commonly used types */ #ifndef DOXYGEN_GENERATING_OUTPUT -extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const DualQuaternion&); -extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const DualQuaternion&); +extern template MAGNUM_EXPORT Debug& operator<<(Debug&, const DualQuaternion&); +extern template MAGNUM_EXPORT Debug& operator<<(Debug&, const DualQuaternion&); #endif #endif diff --git a/src/Magnum/Math/Frustum.h b/src/Magnum/Math/Frustum.h index 9a5f4778b..7c8554549 100644 --- a/src/Magnum/Math/Frustum.h +++ b/src/Magnum/Math/Frustum.h @@ -167,9 +167,9 @@ template class Frustum { * @m_deprecated_since{2019,10} Use @ref operator[](std::size_t) const, * @ref data() or @ref begin() / @ref end() instead. */ - constexpr CORRADE_DEPRECATED("use operator[](), data() or begin() / end() instead") Corrade::Containers::StaticArrayView<6, const Vector4> planes() const { + constexpr CORRADE_DEPRECATED("use operator[](), data() or begin() / end() instead") Containers::StaticArrayView<6, const Vector4> planes() const { /* GCC 4.8 needs explicit construction */ - return Corrade::Containers::StaticArrayView<6, const Vector4>{_data}; + return Containers::StaticArrayView<6, const Vector4>{_data}; } #endif @@ -281,22 +281,22 @@ template class Frustum { #ifndef CORRADE_SINGLES_NO_DEBUG /** @debugoperator{Frustum} */ -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug& debug, const Frustum& value) { - debug << "Frustum({" << Corrade::Utility::Debug::nospace; +template Debug& operator<<(Debug& debug, const Frustum& value) { + debug << "Frustum({" << Debug::nospace; for(std::size_t i = 0; i != 6; ++i) { - if(i != 0) debug << Corrade::Utility::Debug::nospace << "},\n {" << Corrade::Utility::Debug::nospace; + if(i != 0) debug << Debug::nospace << "},\n {" << Debug::nospace; for(std::size_t j = 0; j != 4; ++j) { - if(j != 0) debug << Corrade::Utility::Debug::nospace << ","; + if(j != 0) debug << Debug::nospace << ","; debug << value[i][j]; } } - return debug << Corrade::Utility::Debug::nospace << "})"; + return debug << Debug::nospace << "})"; } /* Explicit instantiation for commonly used types */ #ifndef DOXYGEN_GENERATING_OUTPUT -extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Frustum&); -extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Frustum&); +extern template MAGNUM_EXPORT Debug& operator<<(Debug&, const Frustum&); +extern template MAGNUM_EXPORT Debug& operator<<(Debug&, const Frustum&); #endif #endif diff --git a/src/Magnum/Math/Functions.cpp b/src/Magnum/Math/Functions.cpp index 97a894b45..c12753bfd 100644 --- a/src/Magnum/Math/Functions.cpp +++ b/src/Magnum/Math/Functions.cpp @@ -70,7 +70,7 @@ UnsignedInt log2(UnsignedInt number) { UnsignedLong binomialCoefficient(const UnsignedInt n, UnsignedInt k) { CORRADE_DEBUG_ASSERT(n >= k, - "Math::binomialCoefficient(): k can't be greater than n in (" << Corrade::Utility::Debug::nospace << n << "choose" << k << Corrade::Utility::Debug::nospace << ")", {}); + "Math::binomialCoefficient(): k can't be greater than n in (" << Debug::nospace << n << "choose" << k << Debug::nospace << ")", {}); /* k and n - k gives the same value, optimize the calculation to do fewer steps */ @@ -81,7 +81,7 @@ UnsignedLong binomialCoefficient(const UnsignedInt n, UnsignedInt k) { UnsignedLong result = n; for(UnsignedInt i = 2; i <= k; ++i) { CORRADE_DEBUG_ASSERT(result < ~UnsignedLong{} / (n-i+1), - "Math::binomialCoefficient(): overflow for (" << Corrade::Utility::Debug::nospace << n << "choose" << k << Corrade::Utility::Debug::nospace << ")", {}); + "Math::binomialCoefficient(): overflow for (" << Debug::nospace << n << "choose" << k << Debug::nospace << ")", {}); result *= n - i + 1; result /= i; diff --git a/src/Magnum/Math/Functions.h b/src/Magnum/Math/Functions.h index dfad4aa6a..f42c2a466 100644 --- a/src/Magnum/Math/Functions.h +++ b/src/Magnum/Math/Functions.h @@ -244,7 +244,7 @@ the operations component-wise. @m_since{2019,10} @see @ref isNan(), @ref Constants::inf(), - @ref isInf(const Corrade::Containers::StridedArrayView1D&) + @ref isInf(const Containers::StridedArrayView1D&) */ template inline typename std::enable_if::value, bool>::type isInf(T value) { return std::isinf(UnderlyingTypeOf(value)); @@ -267,7 +267,7 @@ template inline BitVector isInf(const Vector&) + @ref isNan(const Containers::StridedArrayView1D&) */ /* defined in Vector.h */ template typename std::enable_if::value, bool>::type isNan(T value); @@ -288,8 +288,8 @@ template inline BitVector isNan(const VectorNaNs passed in the @p value parameter are propagated. @see @ref max(), @ref minmax(), @ref clamp(), - @ref min(const Corrade::Containers::StridedArrayView1D&), - @ref Vector::min(), @ref Corrade::Utility::min() + @ref min(const Containers::StridedArrayView1D&), + @ref Vector::min(), @ref Utility::min() */ /* defined in Vector.h */ template constexpr typename std::enable_if::value, T>::type min(T value, T min); @@ -315,8 +315,8 @@ template inline Vector min(const VectorNaNs passed in the @p value parameter are propagated. @see @ref min(), @ref minmax(), @ref clamp(), - @ref max(const Corrade::Containers::StridedArrayView1D&), - @ref Vector::max(), @ref Corrade::Utility::max() + @ref max(const Containers::StridedArrayView1D&), + @ref Vector::max(), @ref Utility::max() */ /* defined in Vector.h */ template constexpr typename std::enable_if::value, T>::type max(T a, T b); @@ -341,7 +341,7 @@ template inline Vector max(const Vector&), + @ref minmax(const Containers::StridedArrayView1D&), @ref Vector::minmax(), @ref Range::Range(const std::pair&) */ @@ -351,7 +351,7 @@ template inline typename std::enable_if::value, std::pair inline std::pair, Vector> minmax(const Vector& a, const Vector& b) { - using Corrade::Utility::swap; + using Utility::swap; std::pair, Vector> out{a, b}; for(std::size_t i = 0; i != size; ++i) if(out.first[i] > out.second[i]) swap(out.first[i], out.second[i]); diff --git a/src/Magnum/Math/FunctionsBatch.h b/src/Magnum/Math/FunctionsBatch.h index ed6a0816f..eb0b5a531 100644 --- a/src/Magnum/Math/FunctionsBatch.h +++ b/src/Magnum/Math/FunctionsBatch.h @@ -40,9 +40,9 @@ namespace Implementation { /** @todo Utility/Algorithms.h has a similar (but different) variant of this, maybe turn that into some public utility once we have one more use case? */ -template::type>::from(std::declval()))> static auto stridedArrayViewTypeFor(T&&) -> typename std::remove_const::type; -template static typename std::remove_const::type stridedArrayViewTypeFor(const Corrade::Containers::ArrayView&); -template static typename std::remove_const::type stridedArrayViewTypeFor(const Corrade::Containers::StridedArrayView1D&); +template::type>::from(std::declval()))> static auto stridedArrayViewTypeFor(T&&) -> typename std::remove_const::type; +template static typename std::remove_const::type stridedArrayViewTypeFor(const Containers::ArrayView&); +template static typename std::remove_const::type stridedArrayViewTypeFor(const Containers::StridedArrayView1D&); } @@ -62,7 +62,7 @@ set to @cpp 1 @ce if any value has that component infinite. If the range is empty, returns @cpp false @ce or a @ref BitVector with no bits set. @see @ref isInf(T), @ref Constants::inf() */ -template auto isInf(const Corrade::Containers::StridedArrayView1D& range) -> decltype(isInf(std::declval())) { +template auto isInf(const Containers::StridedArrayView1D& range) -> decltype(isInf(std::declval())) { if(range.isEmpty()) return {}; /* For scalars, this loop exits once any value is infinity. For vectors @@ -81,28 +81,28 @@ template auto isInf(const Corrade::Containers::StridedArrayView1D()))> inline auto isInf(Iterable&& range) -> decltype(isInf(std::declval())) { /* Specifying the template explicitly to avoid recursion into the generic function again */ - return isInf(Corrade::Containers::StridedArrayView1D{range}); + return isInf(Containers::StridedArrayView1D{range}); } /** @overload */ template inline auto isInf(std::initializer_list list) -> decltype(isInf(std::declval())) { /* Specifying the template explicitly to avoid recursion into the generic function again */ - return isInf(Corrade::Containers::stridedArrayView(list)); + return isInf(Containers::stridedArrayView(list)); } /** @overload */ template inline auto isInf(const T(&array)[size]) -> decltype(isInf(std::declval())) { /* Specifying the template explicitly to avoid recursion into the generic function again */ - return isInf(Corrade::Containers::StridedArrayView1D{array}); + return isInf(Containers::StridedArrayView1D{array}); } /** @@ -114,7 +114,7 @@ set to @cpp 1 @ce if any value has that component NaN. If the range is empty, returns @cpp false @ce or a @ref BitVector with no bits set. @see @ref isNan(T), @ref Constants::nan() */ -template inline auto isNan(const Corrade::Containers::StridedArrayView1D& range) -> decltype(isNan(std::declval())) { +template inline auto isNan(const Containers::StridedArrayView1D& range) -> decltype(isNan(std::declval())) { if(range.isEmpty()) return {}; /* For scalars, this loop exits once any value is infinity. For vectors @@ -133,38 +133,38 @@ template inline auto isNan(const Corrade::Containers::StridedArrayView1 @overload @m_since{2020,06} -Converts @p range to @ref Corrade::Containers::StridedArrayView1D and calls the -above overload. Works with any type that's convertible to -@ref Corrade::Containers::StridedArrayView. +Converts @p range to @ref Containers::StridedArrayView1D and calls the above +overload. Works with any type that's convertible to +@relativeref{Corrade,Containers::StridedArrayView}. */ /* See isInf() for why arrayView() and not stridedArrayView() */ template()))> inline auto isNan(Iterable&& range) -> decltype(isNan(std::declval())) { /* Specifying the template explicitly to avoid recursion into the generic function again */ - return isNan(Corrade::Containers::StridedArrayView1D{range}); + return isNan(Containers::StridedArrayView1D{range}); } /** @overload */ template inline auto isNan(std::initializer_list list) -> decltype(isNan(std::declval())) { /* Specifying the template explicitly to avoid recursion into the generic function again */ - return isNan(Corrade::Containers::stridedArrayView(list)); + return isNan(Containers::stridedArrayView(list)); } /** @overload */ template inline auto isNan(const T(&array)[size]) -> decltype(isNan(std::declval())) { /* Specifying the template explicitly to avoid recursion into the generic function again */ - return isNan(Corrade::Containers::StridedArrayView1D{array}); + return isNan(Containers::StridedArrayView1D{array}); } namespace Implementation { /* Non-floating-point types, the first is a non-NaN for sure */ - template constexpr std::pair firstNonNan(Corrade::Containers::StridedArrayView1D range, std::false_type, std::integral_constant) { + template constexpr std::pair firstNonNan(Containers::StridedArrayView1D range, std::false_type, std::integral_constant) { return {0, range.front()}; } /* Floating-point scalars, return the first that's not NaN */ - template inline std::pair firstNonNan(Corrade::Containers::StridedArrayView1D range, std::true_type, std::false_type) { + template inline std::pair firstNonNan(Containers::StridedArrayView1D range, std::true_type, std::false_type) { /* Find the first non-NaN value to compare against. If all are NaN, return the last value so the following loop in min/max/minmax() doesn't even execute. */ @@ -179,7 +179,7 @@ namespace Implementation { apply the min/max/minmax operation. I expect the cases of heavily NaN-filled vectors (and thus the need to loop twice through most of the range) to be very rare, so this shouldn't be a problem. */ - template inline std::pair firstNonNan(Corrade::Containers::StridedArrayView1D range, std::true_type, std::true_type) { + template inline std::pair firstNonNan(Containers::StridedArrayView1D range, std::true_type, std::true_type) { T out = range[0]; std::size_t firstValid = 0; for(std::size_t i = 1; i != range.size(); ++i) { @@ -197,9 +197,9 @@ namespace Implementation { If the range is empty, returns default-constructed value. NaNs are ignored, unless the range is all NaNs. -@see @ref min(T, T), @ref isNan(const Corrade::Containers::StridedArrayView1D&) +@see @ref min(T, T), @ref isNan(const Containers::StridedArrayView1D&) */ -template inline T min(const Corrade::Containers::StridedArrayView1D& range) { +template inline T min(const Containers::StridedArrayView1D& range) { if(range.isEmpty()) return {}; std::pair iOut = Implementation::firstNonNan(range, IsFloatingPoint{}, IsVector{}); @@ -213,28 +213,28 @@ template inline T min(const Corrade::Containers::StridedArrayView1D()))> inline T min(Iterable&& range) { /* Specifying the template explicitly to avoid recursion into the generic function again */ - return min(Corrade::Containers::StridedArrayView1D{range}); + return min(Containers::StridedArrayView1D{range}); } /** @overload */ template inline T min(std::initializer_list list) { /* Specifying the template explicitly to avoid recursion into the generic function again */ - return min(Corrade::Containers::stridedArrayView(list)); + return min(Containers::stridedArrayView(list)); } /** @overload */ template inline T min(const T(&array)[size]) { /* Specifying the template explicitly to avoid recursion into the generic function again */ - return min(Corrade::Containers::StridedArrayView1D{array}); + return min(Containers::StridedArrayView1D{array}); } /** @@ -242,9 +242,9 @@ template inline T min(const T(&array)[size]) { If the range is empty, returns default-constructed value. NaNs are ignored, unless the range is all NaNs. -@see @ref max(T, T), @ref isNan(const Corrade::Containers::StridedArrayView1D&) +@see @ref max(T, T), @ref isNan(const Containers::StridedArrayView1D&) */ -template inline T max(const Corrade::Containers::StridedArrayView1D& range) { +template inline T max(const Containers::StridedArrayView1D& range) { if(range.isEmpty()) return {}; std::pair iOut = Implementation::firstNonNan(range, IsFloatingPoint{}, IsVector{}); @@ -258,28 +258,28 @@ template inline T max(const Corrade::Containers::StridedArrayView1D()))> inline T max(Iterable&& range) { /* Specifying the template explicitly to avoid recursion into the generic function again */ - return max(Corrade::Containers::StridedArrayView1D{range}); + return max(Containers::StridedArrayView1D{range}); } /** @overload */ template inline T max(std::initializer_list list) { /* Specifying the template explicitly to avoid recursion into the generic function again */ - return max(Corrade::Containers::stridedArrayView(list)); + return max(Containers::stridedArrayView(list)); } /** @overload */ template inline T max(const T(&array)[size]) { /* Specifying the template explicitly to avoid recursion into the generic function again */ - return max(Corrade::Containers::StridedArrayView1D{array}); + return max(Containers::StridedArrayView1D{array}); } namespace Implementation { @@ -302,9 +302,9 @@ If the range is empty, returns default-constructed values. NaNs are ignored, unless the range is all NaNs. @see @ref minmax(T, T), @ref Range::Range(const std::pair&), - @ref isNan(const Corrade::Containers::StridedArrayView1D&) + @ref isNan(const Containers::StridedArrayView1D&) */ -template inline std::pair minmax(const Corrade::Containers::StridedArrayView1D& range) { +template inline std::pair minmax(const Containers::StridedArrayView1D& range) { if(range.isEmpty()) return {}; std::pair iOut = Implementation::firstNonNan(range, IsFloatingPoint{}, IsVector{}); @@ -319,28 +319,28 @@ template inline std::pair minmax(const Corrade::Containers::Strid @overload @m_since{2020,06} -Converts @p range to @ref Corrade::Containers::StridedArrayView1D and calls the -above overload. Works with any type that's convertible to -@ref Corrade::Containers::StridedArrayView. +Converts @p range to @ref Containers::StridedArrayView1D and calls the above +overload. Works with any type that's convertible to +@relativeref{Corrade,Containers::StridedArrayView}. */ template()))> inline std::pair minmax(Iterable&& range) { /* Specifying the template explicitly to avoid recursion into the generic function again */ - return minmax(Corrade::Containers::StridedArrayView1D{range}); + return minmax(Containers::StridedArrayView1D{range}); } /** @overload */ template inline std::pair minmax(std::initializer_list list) { /* Specifying the template explicitly to avoid recursion into the generic function again */ - return minmax(Corrade::Containers::stridedArrayView(list)); + return minmax(Containers::stridedArrayView(list)); } /** @overload */ template inline std::pair minmax(const T(&array)[size]) { /* Specifying the template explicitly to avoid recursion into the generic function again */ - return minmax(Corrade::Containers::StridedArrayView1D{array}); + return minmax(Containers::StridedArrayView1D{array}); } /* Since 1.8.17, the original short-hand group closing doesn't work anymore. diff --git a/src/Magnum/Math/Half.cpp b/src/Magnum/Math/Half.cpp index eb7e0b6df..bc9960706 100644 --- a/src/Magnum/Math/Half.cpp +++ b/src/Magnum/Math/Half.cpp @@ -37,7 +37,7 @@ namespace Magnum { namespace Math { -Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug& debug, Half value) { +Debug& operator<<(Debug& debug, Half value) { std::ostringstream out; /* Wikipedia says it's 3 or 4 decimal places: https://en.wikipedia.org/wiki/Half-precision_floating-point_format */ diff --git a/src/Magnum/Math/Half.h b/src/Magnum/Math/Half.h index 1fd573e5f..6a4fc1de3 100644 --- a/src/Magnum/Math/Half.h +++ b/src/Magnum/Math/Half.h @@ -34,6 +34,7 @@ #endif #include "Magnum/visibility.h" +#include "Magnum/Magnum.h" #include "Magnum/Math/Math.h" #include "Magnum/Math/Tags.h" @@ -180,12 +181,10 @@ inline Half operator "" _h(long double value) { return Half(Float(value)); } @debugoperator{Half} Prints the value with 4 significant digits. -@see @ref Corrade::Utility::Debug::operator<<(float), - @ref Corrade::Utility::Debug::operator<<(double), - @ref Corrade::Utility::Debug::operator<<(long double value) -@todoc remove `long double value` once doxygen can link to long double overloads properly +@see @ref Debug::operator<<(float), @ref Debug::operator<<(double), + @ref Debug::operator<<(long double) */ -MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug& debug, Half value); +MAGNUM_EXPORT Debug& operator<<(Debug& debug, Half value); #endif #ifndef MAGNUM_NO_MATH_STRICT_WEAK_ORDERING diff --git a/src/Magnum/Math/Intersection.h b/src/Magnum/Math/Intersection.h index 68eb1f313..53dca513f 100644 --- a/src/Magnum/Math/Intersection.h +++ b/src/Magnum/Math/Intersection.h @@ -573,7 +573,7 @@ template bool sphereConeView(const Vector3& sphereCenter, const T sp template bool sphereConeView(const Vector3& sphereCenter, const T sphereRadius, const Matrix4& coneView, const T sinAngle, const T tanAngle) { CORRADE_DEBUG_ASSERT(coneView.isRigidTransformation(), - "Math::Intersection::sphereConeView(): coneView does not represent a rigid transformation:" << Corrade::Utility::Debug::newline << coneView, false); + "Math::Intersection::sphereConeView(): coneView does not represent a rigid transformation:" << Debug::newline << coneView, false); /* Transform the sphere so that we can test against Z axis aligned origin cone instead */ diff --git a/src/Magnum/Math/Matrix.h b/src/Magnum/Math/Matrix.h index 35a5984fc..0cd84b2f5 100644 --- a/src/Magnum/Math/Matrix.h +++ b/src/Magnum/Math/Matrix.h @@ -63,7 +63,7 @@ template class Matrix: public RectangularMatrix{typename Corrade::Containers::Implementation::GenerateSequence::Type{}, Vector(T(1))} {} + constexpr /*implicit*/ Matrix() noexcept: RectangularMatrix{typename Containers::Implementation::GenerateSequence::Type{}, Vector(T(1))} {} /** * @brief Construct an identity matrix @@ -275,7 +275,7 @@ template class Matrix: public RectangularMatrix invertedOrthogonal() const { CORRADE_DEBUG_ASSERT(isOrthogonal(), - "Math::Matrix::invertedOrthogonal(): the matrix is not orthogonal:" << Corrade::Utility::Debug::Debug::newline << *this, {}); + "Math::Matrix::invertedOrthogonal(): the matrix is not orthogonal:" << Debug::Debug::newline << *this, {}); return RectangularMatrix::transposed(); } diff --git a/src/Magnum/Math/Matrix3.h b/src/Magnum/Math/Matrix3.h index 469ec4f74..3a46c8218 100644 --- a/src/Magnum/Math/Matrix3.h +++ b/src/Magnum/Math/Matrix3.h @@ -765,7 +765,7 @@ template Matrix2x2 Matrix3::rotation() const { Matrix2x2 rotation{(*this)[0].xy().normalized(), (*this)[1].xy().normalized()}; CORRADE_DEBUG_ASSERT(rotation.isOrthogonal(), - "Math::Matrix3::rotation(): the normalized rotation part is not orthogonal:" << Corrade::Utility::Debug::newline << rotation, {}); + "Math::Matrix3::rotation(): the normalized rotation part is not orthogonal:" << Debug::newline << rotation, {}); return rotation; } @@ -773,20 +773,20 @@ template Matrix2x2 Matrix3::rotationNormalized() const { Matrix2x2 rotation{(*this)[0].xy(), (*this)[1].xy()}; CORRADE_DEBUG_ASSERT(rotation.isOrthogonal(), - "Math::Matrix3::rotationNormalized(): the rotation part is not orthogonal:" << Corrade::Utility::Debug::newline << rotation, {}); + "Math::Matrix3::rotationNormalized(): the rotation part is not orthogonal:" << Debug::newline << rotation, {}); return rotation; } template T Matrix3::uniformScalingSquared() const { const T scalingSquared = (*this)[0].xy().dot(); CORRADE_DEBUG_ASSERT(TypeTraits::equals((*this)[1].xy().dot(), scalingSquared), - "Math::Matrix3::uniformScaling(): the matrix doesn't have uniform scaling:" << Corrade::Utility::Debug::newline << rotationScaling(), {}); + "Math::Matrix3::uniformScaling(): the matrix doesn't have uniform scaling:" << Debug::newline << rotationScaling(), {}); return scalingSquared; } template inline Matrix3 Matrix3::invertedRigid() const { CORRADE_DEBUG_ASSERT(isRigidTransformation(), - "Math::Matrix3::invertedRigid(): the matrix doesn't represent a rigid transformation:" << Corrade::Utility::Debug::newline << *this, {}); + "Math::Matrix3::invertedRigid(): the matrix doesn't represent a rigid transformation:" << Debug::newline << *this, {}); Matrix2x2 inverseRotation = rotationScaling().transposed(); return from(inverseRotation, inverseRotation*-translation()); diff --git a/src/Magnum/Math/Matrix4.h b/src/Magnum/Math/Matrix4.h index 16b19c129..3dfc7b778 100644 --- a/src/Magnum/Math/Matrix4.h +++ b/src/Magnum/Math/Matrix4.h @@ -1328,7 +1328,7 @@ template Matrix3x3 Matrix4::rotation() const { (*this)[1].xyz().normalized(), (*this)[2].xyz().normalized()}; CORRADE_DEBUG_ASSERT(rotation.isOrthogonal(), - "Math::Matrix4::rotation(): the normalized rotation part is not orthogonal:" << Corrade::Utility::Debug::newline << rotation, {}); + "Math::Matrix4::rotation(): the normalized rotation part is not orthogonal:" << Debug::newline << rotation, {}); return rotation; } @@ -1337,7 +1337,7 @@ template Matrix3x3 Matrix4::rotationNormalized() const { (*this)[1].xyz(), (*this)[2].xyz()}; CORRADE_DEBUG_ASSERT(rotation.isOrthogonal(), - "Math::Matrix4::rotationNormalized(): the rotation part is not orthogonal:" << Corrade::Utility::Debug::newline << rotation, {}); + "Math::Matrix4::rotationNormalized(): the rotation part is not orthogonal:" << Debug::newline << rotation, {}); return rotation; } @@ -1345,13 +1345,13 @@ template T Matrix4::uniformScalingSquared() const { const T scalingSquared = (*this)[0].xyz().dot(); CORRADE_DEBUG_ASSERT(TypeTraits::equals((*this)[1].xyz().dot(), scalingSquared) && TypeTraits::equals((*this)[2].xyz().dot(), scalingSquared), - "Math::Matrix4::uniformScaling(): the matrix doesn't have uniform scaling:" << Corrade::Utility::Debug::newline << rotationScaling(), {}); + "Math::Matrix4::uniformScaling(): the matrix doesn't have uniform scaling:" << Debug::newline << rotationScaling(), {}); return scalingSquared; } template Matrix4 Matrix4::invertedRigid() const { CORRADE_DEBUG_ASSERT(isRigidTransformation(), - "Math::Matrix4::invertedRigid(): the matrix doesn't represent a rigid transformation:" << Corrade::Utility::Debug::newline << *this, {}); + "Math::Matrix4::invertedRigid(): the matrix doesn't represent a rigid transformation:" << Debug::newline << *this, {}); Matrix3x3 inverseRotation = rotationScaling().transposed(); return from(inverseRotation, inverseRotation*-translation()); diff --git a/src/Magnum/Math/PackingBatch.cpp b/src/Magnum/Math/PackingBatch.cpp index 048e2f02f..48eb8a32d 100644 --- a/src/Magnum/Math/PackingBatch.cpp +++ b/src/Magnum/Math/PackingBatch.cpp @@ -36,7 +36,7 @@ namespace Magnum { namespace Math { namespace { -template inline void unpackUnsignedIntoImplementation(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst) { +template inline void unpackUnsignedIntoImplementation(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst) { CORRADE_ASSERT(src.size() == dst.size(), "Math::unpackInto(): wrong destination size, got" << dst.size() << "but expected" << src.size(), ); CORRADE_ASSERT(src.template isContiguous<1>(), @@ -67,17 +67,17 @@ template inline void unpackUnsignedIntoImplementation(const Corrade::Co } -void unpackInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst) { +void unpackInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst) { unpackUnsignedIntoImplementation(src, dst); } -void unpackInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst) { +void unpackInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst) { unpackUnsignedIntoImplementation(src, dst); } namespace { -template inline void unpackSignedIntoImplementation(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst) { +template inline void unpackSignedIntoImplementation(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst) { CORRADE_ASSERT(src.size() == dst.size(), "Math::unpackInto(): wrong destination size, got" << dst.size() << "but expected" << src.size(), ); CORRADE_ASSERT(src.template isContiguous<1>(), @@ -111,17 +111,17 @@ template inline void unpackSignedIntoImplementation(const Corrade::Cont } -void unpackInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst) { +void unpackInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst) { unpackSignedIntoImplementation(src, dst); } -void unpackInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst) { +void unpackInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst) { unpackSignedIntoImplementation(src, dst); } namespace { -template inline void packIntoImplementation(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst) { +template inline void packIntoImplementation(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst) { CORRADE_ASSERT(src.size() == dst.size(), "Math::packInto(): wrong destination size, got" << dst.size() << "but expected" << src.size(), ); CORRADE_ASSERT(src.isContiguous<1>(), @@ -153,25 +153,25 @@ template inline void packIntoImplementation(const Corrade::Containers:: } -void packInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst) { +void packInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst) { packIntoImplementation(src, dst); } -void packInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst) { +void packInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst) { packIntoImplementation(src, dst); } -void packInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst) { +void packInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst) { packIntoImplementation(src, dst); } -void packInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst) { +void packInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst) { packIntoImplementation(src, dst); } namespace { -template inline void castIntoImplementation(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst) { +template inline void castIntoImplementation(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst) { CORRADE_ASSERT(src.size() == dst.size(), "Math::castInto(): wrong destination size, got" << dst.size() << "but expected" << src.size(), ); CORRADE_ASSERT(src.template isContiguous<1>(), @@ -201,209 +201,209 @@ template inline void castIntoImplementation(const Corrade::Con } -void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst) { +void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst) { castIntoImplementation(src, dst); } -void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst) { +void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst) { castIntoImplementation(src, dst); } -void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst) { +void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst) { castIntoImplementation(src, dst); } -void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst) { +void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst) { castIntoImplementation(src, dst); } -void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst) { +void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst) { castIntoImplementation(src, dst); } -void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst) { +void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst) { castIntoImplementation(src, dst); } -void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst) { +void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst) { castIntoImplementation(src, dst); } -void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst) { +void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst) { castIntoImplementation(src, dst); } -void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst) { +void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst) { castIntoImplementation(src, dst); } -void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst) { +void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst) { castIntoImplementation(src, dst); } -void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst) { +void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst) { castIntoImplementation(src, dst); } -void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst) { +void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst) { castIntoImplementation(src, dst); } -void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst) { +void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst) { castIntoImplementation(src, dst); } -void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst) { +void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst) { castIntoImplementation(src, dst); } -void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst) { +void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst) { castIntoImplementation(src, dst); } -void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst) { +void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst) { castIntoImplementation(src, dst); } -void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst) { +void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst) { castIntoImplementation(src, dst); } -void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst) { +void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst) { castIntoImplementation(src, dst); } -void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst) { +void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst) { castIntoImplementation(src, dst); } -void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst) { +void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst) { castIntoImplementation(src, dst); } -void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst) { +void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst) { castIntoImplementation(src, dst); } -void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst) { +void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst) { castIntoImplementation(src, dst); } -void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst) { +void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst) { castIntoImplementation(src, dst); } -void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst) { +void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst) { castIntoImplementation(src, dst); } -void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst) { +void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst) { castIntoImplementation(src, dst); } -void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst) { +void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst) { castIntoImplementation(src, dst); } -void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst) { +void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst) { castIntoImplementation(src, dst); } -void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst) { +void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst) { castIntoImplementation(src, dst); } -void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst) { +void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst) { castIntoImplementation(src, dst); } -void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst) { +void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst) { castIntoImplementation(src, dst); } -void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst) { +void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst) { castIntoImplementation(src, dst); } -void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst) { +void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst) { castIntoImplementation(src, dst); } -void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst) { +void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst) { castIntoImplementation(src, dst); } -void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst) { +void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst) { castIntoImplementation(src, dst); } -void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst) { +void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst) { castIntoImplementation(src, dst); } -void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst) { +void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst) { castIntoImplementation(src, dst); } -void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst) { +void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst) { castIntoImplementation(src, dst); } -void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst) { +void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst) { castIntoImplementation(src, dst); } -void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst) { +void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst) { castIntoImplementation(src, dst); } -void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst) { +void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst) { castIntoImplementation(src, dst); } -void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst) { +void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst) { castIntoImplementation(src, dst); } -void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst) { +void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst) { castIntoImplementation(src, dst); } -void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst) { +void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst) { castIntoImplementation(src, dst); } -void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst) { +void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst) { castIntoImplementation(src, dst); } -void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst) { +void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst) { castIntoImplementation(src, dst); } -void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst) { +void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst) { castIntoImplementation(src, dst); } -void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst) { +void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst) { castIntoImplementation(src, dst); } -void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst) { +void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst) { castIntoImplementation(src, dst); } -void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst) { +void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst) { castIntoImplementation(src, dst); } -void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst) { +void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst) { castIntoImplementation(src, dst); } namespace { -template inline void copyImplementation(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst) { +template inline void copyImplementation(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst) { /* Utility::copy() has its own assertions, but those are debug-only for perf reasons and don't require the second dimension to be contiguous. Here the use case is different and the behavior should be consistent @@ -415,48 +415,48 @@ template inline void copyImplementation(const Corrade::Containers::Stri CORRADE_ASSERT(dst.template isContiguous<1>(), "Math::castInto(): second destination view dimension is not contiguous", ); - Corrade::Utility::copy(src, dst); + Utility::copy(src, dst); } } -void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst) { +void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst) { copyImplementation(src, dst); } -void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst) { +void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst) { copyImplementation(src, dst); } -void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst) { +void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst) { copyImplementation(src, dst); } -void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst) { +void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst) { copyImplementation(src, dst); } -void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst) { +void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst) { copyImplementation(src, dst); } -void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst) { +void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst) { copyImplementation(src, dst); } -void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst) { +void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst) { copyImplementation(src, dst); } -void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst) { +void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst) { copyImplementation(src, dst); } -void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst) { +void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst) { copyImplementation(src, dst); } -void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst) { +void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst) { copyImplementation(src, dst); } @@ -466,7 +466,7 @@ static_assert(sizeof(HalfMantissaTable) + sizeof(HalfOffsetTable) + sizeof(HalfE static_assert(sizeof(HalfBaseTable) + sizeof(HalfShiftTable) == 1536, "improper size of float->half conversion tables"); -void unpackHalfInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst) { +void unpackHalfInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst) { CORRADE_ASSERT(src.size() == dst.size(), "Math::unpackHalfInto(): wrong destination size, got" << dst.size() << "but expected" << src.size(), ); CORRADE_ASSERT(src.isContiguous<1>(), @@ -493,7 +493,7 @@ void unpackHalfInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst) { +void packHalfInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst) { CORRADE_ASSERT(src.size() == dst.size(), "Math::packHalfInto(): wrong destination size, got" << dst.size() << "but expected" << src.size(), ); CORRADE_ASSERT(src.isContiguous<1>(), diff --git a/src/Magnum/Math/PackingBatch.h b/src/Magnum/Math/PackingBatch.h index 23bb1deba..dc82c5ffe 100644 --- a/src/Magnum/Math/PackingBatch.h +++ b/src/Magnum/Math/PackingBatch.h @@ -32,7 +32,7 @@ #include -#include "Magnum/Types.h" +#include "Magnum/Magnum.h" #include "Magnum/visibility.h" namespace Magnum { namespace Math { @@ -56,15 +56,15 @@ contain vector/matrix components, or have a size of 1 for scalars. Expects that @p src and @p dst have the same size and that the second dimension in both is contiguous. @see @ref packInto(), @ref castInto(), - @ref Corrade::Containers::StridedArrayView::isContiguous() + @relativeref{Corrade,Containers::StridedArrayView::isContiguous()} */ -MAGNUM_EXPORT void unpackInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst); +MAGNUM_EXPORT void unpackInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst); /** * @overload * @m_since{2020,06} */ -MAGNUM_EXPORT void unpackInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst); +MAGNUM_EXPORT void unpackInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst); /** @brief Unpack signed integral values into a floating-point representation @@ -78,15 +78,15 @@ contain vector/matrix components, or have a size of 1 for scalars. Expects that @p src and @p dst have the same size and that the second dimension in both is contiguous. @see @ref packInto(), @ref castInto(), - @ref Corrade::Containers::StridedArrayView::isContiguous() + @relativeref{Corrade,Containers::StridedArrayView::isContiguous()} */ -MAGNUM_EXPORT void unpackInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst); +MAGNUM_EXPORT void unpackInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst); /** * @overload * @m_since{2020,06} */ -MAGNUM_EXPORT void unpackInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst); +MAGNUM_EXPORT void unpackInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst); /** @brief Pack floating-point values into an integer representation @@ -105,27 +105,27 @@ contiguous. range is undefined. @see @ref unpackInto(), @ref castInto(), - @ref Corrade::Containers::StridedArrayView::isContiguous() + @relativeref{Corrade,Containers::StridedArrayView::isContiguous()} */ -MAGNUM_EXPORT void packInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst); +MAGNUM_EXPORT void packInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst); /** * @overload * @m_since{2020,06} */ -MAGNUM_EXPORT void packInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst); +MAGNUM_EXPORT void packInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst); /** * @overload * @m_since{2020,06} */ -MAGNUM_EXPORT void packInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst); +MAGNUM_EXPORT void packInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst); /** * @overload * @m_since{2020,06} */ -MAGNUM_EXPORT void packInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst); +MAGNUM_EXPORT void packInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst); /** @brief Pack 32-bit float values into 16-bit half-float representation @@ -144,7 +144,7 @@ Algorithm used: *Jeroen van der Zijp -- Fast Half Float Conversions, 2008, ftp://ftp.fox-toolkit.org/pub/fasthalffloatconversion.pdf* @see @ref Half */ -MAGNUM_EXPORT void packHalfInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst); +MAGNUM_EXPORT void packHalfInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst); /** @brief Unpack a range of 16-bit half-float values into 32-bit float representation @@ -163,7 +163,7 @@ Algorithm used: *Jeroen van der Zijp -- Fast Half Float Conversions, 2008, ftp://ftp.fox-toolkit.org/pub/fasthalffloatconversion.pdf* @see @ref Half */ -MAGNUM_EXPORT void unpackHalfInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst); +MAGNUM_EXPORT void unpackHalfInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst); /** @brief Cast integer values into a 32-bit floating-point representation @@ -180,40 +180,40 @@ the second dimension in both is contiguous. @attention Numbers with more than 23 bits of precision will not be represented accurately when cast into a @relativeref{Magnum,Float}. -@see @ref castInto(const Corrade::Containers::StridedArrayView2D&, const Corrade::Containers::StridedArrayView2D&), - @ref Corrade::Containers::StridedArrayView::isContiguous() +@see @ref castInto(const Containers::StridedArrayView2D&, const Containers::StridedArrayView2D&), + @relativeref{Corrade,Containers::StridedArrayView::isContiguous()} */ -MAGNUM_EXPORT void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst); +MAGNUM_EXPORT void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst); /** * @overload * @m_since{2020,06} */ -MAGNUM_EXPORT void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst); +MAGNUM_EXPORT void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst); /** * @overload * @m_since{2020,06} */ -MAGNUM_EXPORT void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst); +MAGNUM_EXPORT void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst); /** * @overload * @m_since{2020,06} */ -MAGNUM_EXPORT void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst); +MAGNUM_EXPORT void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst); /** * @overload * @m_since{2020,06} */ -MAGNUM_EXPORT void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst); +MAGNUM_EXPORT void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst); /** * @overload * @m_since{2020,06} */ -MAGNUM_EXPORT void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst); +MAGNUM_EXPORT void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst); /** @brief Cast integer values into a 64-bit floating-point representation @@ -230,40 +230,40 @@ the second dimension in both is contiguous. @attention Numbers with more than 52 bits of precision will not be represented accurately when cast into a @relativeref{Magnum,Double}. -@see @ref castInto(const Corrade::Containers::StridedArrayView2D&, const Corrade::Containers::StridedArrayView2D&), - @ref Corrade::Containers::StridedArrayView::isContiguous() +@see @ref castInto(const Containers::StridedArrayView2D&, const Containers::StridedArrayView2D&), + @relativeref{Corrade,Containers::StridedArrayView::isContiguous()} */ -MAGNUM_EXPORT void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst); +MAGNUM_EXPORT void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst); /** * @overload * @m_since_latest */ -MAGNUM_EXPORT void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst); +MAGNUM_EXPORT void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst); /** * @overload * @m_since_latest */ -MAGNUM_EXPORT void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst); +MAGNUM_EXPORT void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst); /** * @overload * @m_since_latest */ -MAGNUM_EXPORT void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst); +MAGNUM_EXPORT void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst); /** * @overload * @m_since_latest */ -MAGNUM_EXPORT void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst); +MAGNUM_EXPORT void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst); /** * @overload * @m_since_latest */ -MAGNUM_EXPORT void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst); +MAGNUM_EXPORT void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst); /** @brief Cast 32-bit floating-point values into an integer representation @@ -280,40 +280,40 @@ the second dimension in both is contiguous. @attention Fractional part of the @relativeref{Magnum,Float} input will be silently discarded when cast into an integer type. -@see @ref castInto(const Corrade::Containers::StridedArrayView2D&, const Corrade::Containers::StridedArrayView2D&), - @ref Corrade::Containers::StridedArrayView::isContiguous() +@see @ref castInto(const Containers::StridedArrayView2D&, const Containers::StridedArrayView2D&), + @relativeref{Corrade,Containers::StridedArrayView::isContiguous()} */ -MAGNUM_EXPORT void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst); +MAGNUM_EXPORT void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst); /** * @overload * @m_since{2020,06} */ -MAGNUM_EXPORT void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst); +MAGNUM_EXPORT void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst); /** * @overload * @m_since{2020,06} */ -MAGNUM_EXPORT void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst); +MAGNUM_EXPORT void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst); /** * @overload * @m_since{2020,06} */ -MAGNUM_EXPORT void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst); +MAGNUM_EXPORT void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst); /** * @overload * @m_since{2020,06} */ -MAGNUM_EXPORT void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst); +MAGNUM_EXPORT void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst); /** * @overload * @m_since{2020,06} */ -MAGNUM_EXPORT void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst); +MAGNUM_EXPORT void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst); /** @brief Cast 64-bit floating-point values into an integer representation @@ -330,40 +330,40 @@ the second dimension in both is contiguous. @attention Fractional part of the @relativeref{Magnum,Double} input will be silently discarded when cast into an integer type. -@see @ref castInto(const Corrade::Containers::StridedArrayView2D&, const Corrade::Containers::StridedArrayView2D&), - @ref Corrade::Containers::StridedArrayView::isContiguous() +@see @ref castInto(const Containers::StridedArrayView2D&, const Containers::StridedArrayView2D&), + @relativeref{Corrade,Containers::StridedArrayView::isContiguous()} */ -MAGNUM_EXPORT void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst); +MAGNUM_EXPORT void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst); /** * @overload * @m_since_latest */ -MAGNUM_EXPORT void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst); +MAGNUM_EXPORT void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst); /** * @overload * @m_since_latest */ -MAGNUM_EXPORT void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst); +MAGNUM_EXPORT void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst); /** * @overload * @m_since_latest */ -MAGNUM_EXPORT void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst); +MAGNUM_EXPORT void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst); /** * @overload * @m_since_latest */ -MAGNUM_EXPORT void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst); +MAGNUM_EXPORT void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst); /** * @overload * @m_since_latest */ -MAGNUM_EXPORT void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst); +MAGNUM_EXPORT void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst); /** @brief Cast integer values into a differently sized type @@ -378,147 +378,147 @@ the second dimension in both is contiguous. @attention Values that don't fit into the resulting type will have undefined values. -@see @ref Corrade::Containers::StridedArrayView::isContiguous() +@see @relativeref{Corrade,Containers::StridedArrayView::isContiguous()} */ -MAGNUM_EXPORT void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst); +MAGNUM_EXPORT void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst); /** * @overload * @m_since_latest */ -MAGNUM_EXPORT void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst); +MAGNUM_EXPORT void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst); /** * @overload * @m_since{2020,06} */ -MAGNUM_EXPORT void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst); +MAGNUM_EXPORT void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst); /** * @overload * @m_since{2020,06} */ -MAGNUM_EXPORT void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst); +MAGNUM_EXPORT void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst); /** * @overload * @m_since{2020,06} */ -MAGNUM_EXPORT void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst); +MAGNUM_EXPORT void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst); /** * @overload * @m_since{2020,06} */ -MAGNUM_EXPORT void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst); +MAGNUM_EXPORT void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst); /** * @overload * @m_since_latest */ -MAGNUM_EXPORT void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst); +MAGNUM_EXPORT void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst); /** * @overload * @m_since_latest */ -MAGNUM_EXPORT void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst); +MAGNUM_EXPORT void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst); /** * @overload * @m_since_latest */ -MAGNUM_EXPORT void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst); +MAGNUM_EXPORT void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst); /** * @overload * @m_since_latest */ -MAGNUM_EXPORT void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst); +MAGNUM_EXPORT void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst); /** * @overload * @m_since_latest */ -MAGNUM_EXPORT void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst); +MAGNUM_EXPORT void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst); /** * @overload * @m_since_latest */ -MAGNUM_EXPORT void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst); +MAGNUM_EXPORT void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst); /** * @overload * @m_since_latest */ -MAGNUM_EXPORT void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst); +MAGNUM_EXPORT void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst); /** * @overload * @m_since_latest */ -MAGNUM_EXPORT void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst); +MAGNUM_EXPORT void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst); /** * @overload * @m_since_latest */ -MAGNUM_EXPORT void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst); +MAGNUM_EXPORT void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst); /** * @overload * @m_since_latest */ -MAGNUM_EXPORT void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst); +MAGNUM_EXPORT void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst); /** * @overload * @m_since_latest */ -MAGNUM_EXPORT void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst); +MAGNUM_EXPORT void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst); /** * @overload * @m_since_latest */ -MAGNUM_EXPORT void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst); +MAGNUM_EXPORT void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst); /** * @overload * @m_since{2020,06} */ -MAGNUM_EXPORT void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst); +MAGNUM_EXPORT void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst); /** * @overload * @m_since{2020,06} */ -MAGNUM_EXPORT void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst); +MAGNUM_EXPORT void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst); /** * @overload * @m_since{2020,06} */ -MAGNUM_EXPORT void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst); +MAGNUM_EXPORT void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst); /** * @overload * @m_since{2020,06} */ -MAGNUM_EXPORT void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst); +MAGNUM_EXPORT void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst); /** * @overload * @m_since_latest */ -MAGNUM_EXPORT void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst); +MAGNUM_EXPORT void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst); /** * @overload * @m_since_latest */ -MAGNUM_EXPORT void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst); +MAGNUM_EXPORT void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst); /** @brief Cast 32-bit floating-point values into a 64-bit floating-point representation @@ -532,10 +532,10 @@ contain vector/matrix components, or have a size of 1 for scalars. Expects that @p src and @p dst have the same size and that the second dimension in both is contiguous. -@see @ref castInto(const Corrade::Containers::StridedArrayView2D&, const Corrade::Containers::StridedArrayView2D&), - @ref Corrade::Containers::StridedArrayView::isContiguous() +@see @ref castInto(const Containers::StridedArrayView2D&, const Containers::StridedArrayView2D&), + @relativeref{Corrade,Containers::StridedArrayView::isContiguous()} */ -MAGNUM_EXPORT void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst); +MAGNUM_EXPORT void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst); /** @brief Cast 64-bit floating-point values into a 32-bit floating-point representation @@ -552,10 +552,10 @@ contiguous. @attention Numbers with more than 23 bits of precision will not be represented accurately when cast into a @ref Magnum::Float "Float". -@see @ref castInto(const Corrade::Containers::StridedArrayView2D&, const Corrade::Containers::StridedArrayView2D&), - @ref Corrade::Containers::StridedArrayView::isContiguous() +@see @ref castInto(const Containers::StridedArrayView2D&, const Containers::StridedArrayView2D&), + @relativeref{Corrade,Containers::StridedArrayView::isContiguous()} */ -MAGNUM_EXPORT void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst); +MAGNUM_EXPORT void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst); /** @brief Copy values @@ -568,61 +568,61 @@ same size, for consistency with other @ref castInto() expects also that the second dimension in both is contiguous even though it's not required by @relativeref{Corrade,Utility::copy()}. */ -MAGNUM_EXPORT void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst); +MAGNUM_EXPORT void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst); /** * @overload * @m_since_latest */ -MAGNUM_EXPORT void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst); +MAGNUM_EXPORT void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst); /** * @overload * @m_since_latest */ -MAGNUM_EXPORT void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst); +MAGNUM_EXPORT void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst); /** * @overload * @m_since_latest */ -MAGNUM_EXPORT void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst); +MAGNUM_EXPORT void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst); /** * @overload * @m_since_latest */ -MAGNUM_EXPORT void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst); +MAGNUM_EXPORT void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst); /** * @overload * @m_since_latest */ -MAGNUM_EXPORT void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst); +MAGNUM_EXPORT void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst); /** * @overload * @m_since_latest */ -MAGNUM_EXPORT void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst); +MAGNUM_EXPORT void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst); /** * @overload * @m_since_latest */ -MAGNUM_EXPORT void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst); +MAGNUM_EXPORT void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst); /** * @overload * @m_since_latest */ -MAGNUM_EXPORT void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst); +MAGNUM_EXPORT void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst); /** * @overload * @m_since_latest */ -MAGNUM_EXPORT void castInto(const Corrade::Containers::StridedArrayView2D& src, const Corrade::Containers::StridedArrayView2D& dst); +MAGNUM_EXPORT void castInto(const Containers::StridedArrayView2D& src, const Containers::StridedArrayView2D& dst); /* Since 1.8.17, the original short-hand group closing doesn't work anymore. FFS. */ diff --git a/src/Magnum/Math/Quaternion.h b/src/Magnum/Math/Quaternion.h index ca436e3e4..75bc7e608 100644 --- a/src/Magnum/Math/Quaternion.h +++ b/src/Magnum/Math/Quaternion.h @@ -790,18 +790,18 @@ template inline Quaternion operator/(T scalar, const Quaternion& #ifndef CORRADE_SINGLES_NO_DEBUG /** @debugoperator{Quaternion} */ -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug& debug, const Quaternion& value) { - return debug << "Quaternion({" << Corrade::Utility::Debug::nospace - << value.vector().x() << Corrade::Utility::Debug::nospace << "," - << value.vector().y() << Corrade::Utility::Debug::nospace << "," - << value.vector().z() << Corrade::Utility::Debug::nospace << "}," - << value.scalar() << Corrade::Utility::Debug::nospace << ")"; +template Debug& operator<<(Debug& debug, const Quaternion& value) { + return debug << "Quaternion({" << Debug::nospace + << value.vector().x() << Debug::nospace << "," + << value.vector().y() << Debug::nospace << "," + << value.vector().z() << Debug::nospace << "}," + << value.scalar() << Debug::nospace << ")"; } /* Explicit instantiation for commonly used types */ #ifndef DOXYGEN_GENERATING_OUTPUT -extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Quaternion&); -extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Quaternion&); +extern template MAGNUM_EXPORT Debug& operator<<(Debug&, const Quaternion&); +extern template MAGNUM_EXPORT Debug& operator<<(Debug&, const Quaternion&); #endif #endif @@ -866,7 +866,7 @@ template inline Quaternion Quaternion::fromMatrix(const Matrix3x3 to Vector::isNormalized(), which compares the dot product (length squared) to 1 ± 2ε. */ CORRADE_DEBUG_ASSERT(std::abs(matrix.determinant() - T(1)) < T(3)*TypeTraits::epsilon(), - "Math::Quaternion::fromMatrix(): the matrix is not a rotation:" << Corrade::Utility::Debug::newline << matrix, {}); + "Math::Quaternion::fromMatrix(): the matrix is not a rotation:" << Debug::newline << matrix, {}); return Implementation::quaternionFromMatrix(matrix); } diff --git a/src/Magnum/Math/Range.h b/src/Magnum/Math/Range.h index 4be39755c..6cc8b0361 100644 --- a/src/Magnum/Math/Range.h +++ b/src/Magnum/Math/Range.h @@ -792,28 +792,28 @@ template inline bool intersects(const Range Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug& debug, const Range& value) { - debug << "Range({" << Corrade::Utility::Debug::nospace << Vector{value.min()}[0]; +template Debug& operator<<(Debug& debug, const Range& value) { + debug << "Range({" << Debug::nospace << Vector{value.min()}[0]; for(UnsignedInt i = 1; i != dimensions; ++i) - debug << Corrade::Utility::Debug::nospace << "," << Vector{value.min()}[i]; - debug << Corrade::Utility::Debug::nospace << "}, {" - << Corrade::Utility::Debug::nospace << Vector{value.max()}[0]; + debug << Debug::nospace << "," << Vector{value.min()}[i]; + debug << Debug::nospace << "}, {" + << Debug::nospace << Vector{value.max()}[0]; for(UnsignedInt i = 1; i != dimensions; ++i) - debug << Corrade::Utility::Debug::nospace << "," << Vector{value.max()}[i]; - return debug << Corrade::Utility::Debug::nospace << "})"; + debug << Debug::nospace << "," << Vector{value.max()}[i]; + return debug << Debug::nospace << "})"; } /* Explicit instantiation for commonly used types */ #ifndef DOXYGEN_GENERATING_OUTPUT -extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Range<1, Float>&); -extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Range<2, Float>&); -extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Range<3, Float>&); -extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Range<1, Int>&); -extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Range<2, Int>&); -extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Range<3, Int>&); -extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Range<1, Double>&); -extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Range<2, Double>&); -extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Range<3, Double>&); +extern template MAGNUM_EXPORT Debug& operator<<(Debug&, const Range<1, Float>&); +extern template MAGNUM_EXPORT Debug& operator<<(Debug&, const Range<2, Float>&); +extern template MAGNUM_EXPORT Debug& operator<<(Debug&, const Range<3, Float>&); +extern template MAGNUM_EXPORT Debug& operator<<(Debug&, const Range<1, Int>&); +extern template MAGNUM_EXPORT Debug& operator<<(Debug&, const Range<2, Int>&); +extern template MAGNUM_EXPORT Debug& operator<<(Debug&, const Range<3, Int>&); +extern template MAGNUM_EXPORT Debug& operator<<(Debug&, const Range<1, Double>&); +extern template MAGNUM_EXPORT Debug& operator<<(Debug&, const Range<2, Double>&); +extern template MAGNUM_EXPORT Debug& operator<<(Debug&, const Range<3, Double>&); #endif #endif diff --git a/src/Magnum/Math/RectangularMatrix.h b/src/Magnum/Math/RectangularMatrix.h index 7928dc938..1a46a2d91 100644 --- a/src/Magnum/Math/RectangularMatrix.h +++ b/src/Magnum/Math/RectangularMatrix.h @@ -36,21 +36,21 @@ namespace Magnum { namespace Math { namespace Implementation { template struct RectangularMatrixConverter; - template constexpr Vector valueOrZeroVector(Corrade::Containers::Implementation::Sequence, const RectangularMatrix& other) { + template constexpr Vector valueOrZeroVector(Containers::Implementation::Sequence, const RectangularMatrix& other) { return {(col < otherCols && row < otherRows ? other[col][row] : T{0})...}; } template constexpr Vector valueOrZeroVector(const RectangularMatrix& other) { - return valueOrZeroVector(typename Corrade::Containers::Implementation::GenerateSequence::Type{}, other); + return valueOrZeroVector(typename Containers::Implementation::GenerateSequence::Type{}, other); } - template constexpr Vector valueOrIdentityVector(Corrade::Containers::Implementation::Sequence, const RectangularMatrix& other, T value) { + template constexpr Vector valueOrIdentityVector(Containers::Implementation::Sequence, const RectangularMatrix& other, T value) { return {(col < otherCols && row < otherRows ? other[col][row] : col == row ? value : T{0})...}; } template constexpr Vector valueOrIdentityVector(const RectangularMatrix& other, T value) { - return valueOrIdentityVector(typename Corrade::Containers::Implementation::GenerateSequence::Type{}, other, value); + return valueOrIdentityVector(typename Containers::Implementation::GenerateSequence::Type{}, other, value); } } @@ -131,7 +131,7 @@ template class RectangularMatrix { * @see @ref diagonal() */ constexpr static RectangularMatrix fromDiagonal(const Vector& diagonal) noexcept { - return RectangularMatrix(typename Corrade::Containers::Implementation::GenerateSequence::Type{}, diagonal); + return RectangularMatrix(typename Containers::Implementation::GenerateSequence::Type{}, diagonal); } /** @@ -139,14 +139,14 @@ template class RectangularMatrix { * * Equivalent to @ref RectangularMatrix(ZeroInitT). */ - constexpr /*implicit*/ RectangularMatrix() noexcept: RectangularMatrix{typename Corrade::Containers::Implementation::GenerateSequence::Type{}, ZeroInit} {} + constexpr /*implicit*/ RectangularMatrix() noexcept: RectangularMatrix{typename Containers::Implementation::GenerateSequence::Type{}, ZeroInit} {} /** * @brief Construct a zero-filled matrix * * @see @ref RectangularMatrix(IdentityInitT, T) */ - constexpr explicit RectangularMatrix(ZeroInitT) noexcept: RectangularMatrix{typename Corrade::Containers::Implementation::GenerateSequence::Type{}, ZeroInit} {} + constexpr explicit RectangularMatrix(ZeroInitT) noexcept: RectangularMatrix{typename Containers::Implementation::GenerateSequence::Type{}, ZeroInit} {} /** * @brief Construct an identity matrix @@ -156,10 +156,10 @@ template class RectangularMatrix { * elements. The @p value allows you to specify a value on diagonal. * @see @ref RectangularMatrix(ZeroInitT), @ref fromDiagonal() */ - constexpr explicit RectangularMatrix(IdentityInitT, T value = T(1)) noexcept: RectangularMatrix{typename Corrade::Containers::Implementation::GenerateSequence::Type{}, Vector(value)} {} + constexpr explicit RectangularMatrix(IdentityInitT, T value = T(1)) noexcept: RectangularMatrix{typename Containers::Implementation::GenerateSequence::Type{}, Vector(value)} {} /** @brief Construct without initializing the contents */ - explicit RectangularMatrix(Magnum::NoInitT) noexcept: RectangularMatrix{typename Corrade::Containers::Implementation::GenerateSequence::Type{}, Magnum::NoInit} {} + explicit RectangularMatrix(Magnum::NoInitT) noexcept: RectangularMatrix{typename Containers::Implementation::GenerateSequence::Type{}, Magnum::NoInit} {} /** @brief Construct from column vectors */ template constexpr /*implicit*/ RectangularMatrix(const Vector& first, const U&... next) noexcept: _data{first, next...} { @@ -167,7 +167,7 @@ template class RectangularMatrix { } /** @brief Construct with one value for all components */ - constexpr explicit RectangularMatrix(T value) noexcept: RectangularMatrix{typename Corrade::Containers::Implementation::GenerateSequence::Type{}, value} {} + constexpr explicit RectangularMatrix(T value) noexcept: RectangularMatrix{typename Containers::Implementation::GenerateSequence::Type{}, value} {} /** * @brief Construct from a matrix of a different type @@ -177,7 +177,7 @@ template class RectangularMatrix { * * @snippet MagnumMath.cpp RectangularMatrix-conversion */ - template constexpr explicit RectangularMatrix(const RectangularMatrix& other) noexcept: RectangularMatrix(typename Corrade::Containers::Implementation::GenerateSequence::Type{}, other) {} + template constexpr explicit RectangularMatrix(const RectangularMatrix& other) noexcept: RectangularMatrix(typename Containers::Implementation::GenerateSequence::Type{}, other) {} /** * @brief Construct by slicing or expanding a matrix of different size, leaving the rest at zero @@ -186,7 +186,7 @@ template class RectangularMatrix { * If the other matrix has less columns or rows, the corresponding * vectors and components are set to zeros. */ - template constexpr explicit RectangularMatrix(ZeroInitT, const RectangularMatrix& other) noexcept: RectangularMatrix{ZeroInit, typename Corrade::Containers::Implementation::GenerateSequence::Type{}, other} {} + template constexpr explicit RectangularMatrix(ZeroInitT, const RectangularMatrix& other) noexcept: RectangularMatrix{ZeroInit, typename Containers::Implementation::GenerateSequence::Type{}, other} {} /** * @brief Construct by slicing or expanding a matrix of different size, leaving the rest at identity @@ -196,7 +196,7 @@ template class RectangularMatrix { * vectors and components are set to either zeros or @p value on the * diagonal. */ - template constexpr explicit RectangularMatrix(IdentityInitT, const RectangularMatrix& other, T value = T(1)) noexcept: RectangularMatrix{IdentityInit, typename Corrade::Containers::Implementation::GenerateSequence::Type{}, other, value} {} + template constexpr explicit RectangularMatrix(IdentityInitT, const RectangularMatrix& other, T value = T(1)) noexcept: RectangularMatrix{IdentityInit, typename Containers::Implementation::GenerateSequence::Type{}, other, value} {} /** * @brief Construct by slicing or expanding a matrix of different size @@ -206,7 +206,7 @@ template class RectangularMatrix { * Note that this default is different from @ref Matrix, where it's * equivalent to the @ref IdentityInit variant instead. */ - template constexpr explicit RectangularMatrix(const RectangularMatrix& other) noexcept: RectangularMatrix{ZeroInit, typename Corrade::Containers::Implementation::GenerateSequence::Type{}, other} {} + template constexpr explicit RectangularMatrix(const RectangularMatrix& other) noexcept: RectangularMatrix{ZeroInit, typename Containers::Implementation::GenerateSequence::Type{}, other} {} /** @brief Construct a matrix from external representation */ template::from(std::declval()))> constexpr explicit RectangularMatrix(const U& other): RectangularMatrix(Implementation::RectangularMatrixConverter::from(other)) {} @@ -484,7 +484,7 @@ template class RectangularMatrix { * @see @ref transposed(), @ref flippedRows(), @ref Vector::flipped() */ constexpr RectangularMatrix flippedCols() const { - return flippedColsInternal(typename Corrade::Containers::Implementation::GenerateSequence::Type{}); + return flippedColsInternal(typename Containers::Implementation::GenerateSequence::Type{}); } /** @@ -494,7 +494,7 @@ template class RectangularMatrix { * @see @ref transposed(), @ref flippedCols(), @ref Vector::flipped() */ constexpr RectangularMatrix flippedRows() const { - return flippedRowsInternal(typename Corrade::Containers::Implementation::GenerateSequence::Type{}); + return flippedRowsInternal(typename Containers::Implementation::GenerateSequence::Type{}); } /** @@ -506,7 +506,7 @@ template class RectangularMatrix { /* NVCC (from CUDA) has problems compiling this function under Windows when there's a separate definition due to DiagonalSize (see https://github.com/mosra/magnum/issues/345 for details) */ - return diagonalInternal(typename Corrade::Containers::Implementation::GenerateSequence::Type{}); + return diagonalInternal(typename Containers::Implementation::GenerateSequence::Type{}); } /** @@ -530,33 +530,33 @@ template class RectangularMatrix { /* Implementation for RectangularMatrix::RectangularMatrix(T) and Matrix(T) */ /* MSVC 2015 can't handle {} here */ - template constexpr explicit RectangularMatrix(Corrade::Containers::Implementation::Sequence, T value) noexcept: _data{Vector((static_cast(sequence), value))...} {} + template constexpr explicit RectangularMatrix(Containers::Implementation::Sequence, T value) noexcept: _data{Vector((static_cast(sequence), value))...} {} /* Implementation for RectangularMatrix::fromDiagonal() and RectangularMatrix(IdentityInitT, T) */ - template constexpr explicit RectangularMatrix(Corrade::Containers::Implementation::Sequence, const Vector& diagonal); + template constexpr explicit RectangularMatrix(Containers::Implementation::Sequence, const Vector& diagonal); /* Implementation for RectangularMatrix::RectangularMatrix(const RectangularMatrix&) */ - template constexpr explicit RectangularMatrix(Corrade::Containers::Implementation::Sequence, const RectangularMatrix& matrix) noexcept: _data{Vector(matrix[sequence])...} {} + template constexpr explicit RectangularMatrix(Containers::Implementation::Sequence, const RectangularMatrix& matrix) noexcept: _data{Vector(matrix[sequence])...} {} /* Implementation for RectangularMatrix::RectangularMatrix(ZeroInitT, const RectangularMatrix&) */ - template constexpr explicit RectangularMatrix(ZeroInitT, Corrade::Containers::Implementation::Sequence, const RectangularMatrix& other) noexcept: RectangularMatrix{Implementation::valueOrZeroVector(other)...} {} + template constexpr explicit RectangularMatrix(ZeroInitT, Containers::Implementation::Sequence, const RectangularMatrix& other) noexcept: RectangularMatrix{Implementation::valueOrZeroVector(other)...} {} /* Implementation for RectangularMatrix::RectangularMatrix(IdentityInitT, const RectangularMatrix&) */ - template constexpr explicit RectangularMatrix(IdentityInitT, Corrade::Containers::Implementation::Sequence, const RectangularMatrix& other, T value) noexcept: RectangularMatrix{Implementation::valueOrIdentityVector(other, value)...} {} + template constexpr explicit RectangularMatrix(IdentityInitT, Containers::Implementation::Sequence, const RectangularMatrix& other, T value) noexcept: RectangularMatrix{Implementation::valueOrIdentityVector(other, value)...} {} /* Implementation for RectangularMatrix::RectangularMatrix(ZeroInitT) and RectangularMatrix::RectangularMatrix(NoInitT) */ /* MSVC 2015 can't handle {} here */ - template constexpr explicit RectangularMatrix(Corrade::Containers::Implementation::Sequence, U) noexcept: _data{Vector((static_cast(sequence), U{typename U::Init{}}))...} {} + template constexpr explicit RectangularMatrix(Containers::Implementation::Sequence, U) noexcept: _data{Vector((static_cast(sequence), U{typename U::Init{}}))...} {} - template constexpr RectangularMatrix flippedColsInternal(Corrade::Containers::Implementation::Sequence) const { + template constexpr RectangularMatrix flippedColsInternal(Containers::Implementation::Sequence) const { return {_data[cols - 1 - sequence]...}; } - template constexpr RectangularMatrix flippedRowsInternal(Corrade::Containers::Implementation::Sequence) const { + template constexpr RectangularMatrix flippedRowsInternal(Containers::Implementation::Sequence) const { return {_data[sequence].flipped()...}; } - template constexpr Vector diagonalInternal(Corrade::Containers::Implementation::Sequence) const; + template constexpr Vector diagonalInternal(Containers::Implementation::Sequence) const; Vector _data[cols]; }; @@ -687,44 +687,44 @@ template inline RectangularMatrix Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug& debug, const Magnum::Math::RectangularMatrix& value) { +template Debug& operator<<(Debug& debug, const Magnum::Math::RectangularMatrix& value) { /** @todo might make sense to propagate the flags also, for hex value printing etc */ - const bool packed = debug.immediateFlags() >= Corrade::Utility::Debug::Flag::Packed; - debug << (packed ? "{" : "Matrix(") << Corrade::Utility::Debug::nospace; + const bool packed = debug.immediateFlags() >= Debug::Flag::Packed; + debug << (packed ? "{" : "Matrix(") << Debug::nospace; for(std::size_t row = 0; row != rows; ++row) { - if(row != 0) debug << Corrade::Utility::Debug::nospace << (packed ? ",\n" : ",\n "); + if(row != 0) debug << Debug::nospace << (packed ? ",\n" : ",\n "); for(std::size_t col = 0; col != cols; ++col) { - if(col != 0) debug << Corrade::Utility::Debug::nospace << ","; + if(col != 0) debug << Debug::nospace << ","; debug << value[col][row]; } } - return debug << Corrade::Utility::Debug::nospace << (packed ? "}" : ")"); + return debug << Debug::nospace << (packed ? "}" : ")"); } /* Explicit instantiation for commonly used types */ #ifndef DOXYGEN_GENERATING_OUTPUT /* Square matrices */ -extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const RectangularMatrix<2, 2, Float>&); -extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const RectangularMatrix<3, 3, Float>&); -extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const RectangularMatrix<4, 4, Float>&); -extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const RectangularMatrix<2, 2, Double>&); -extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const RectangularMatrix<3, 3, Double>&); -extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const RectangularMatrix<4, 4, Double>&); +extern template MAGNUM_EXPORT Debug& operator<<(Debug&, const RectangularMatrix<2, 2, Float>&); +extern template MAGNUM_EXPORT Debug& operator<<(Debug&, const RectangularMatrix<3, 3, Float>&); +extern template MAGNUM_EXPORT Debug& operator<<(Debug&, const RectangularMatrix<4, 4, Float>&); +extern template MAGNUM_EXPORT Debug& operator<<(Debug&, const RectangularMatrix<2, 2, Double>&); +extern template MAGNUM_EXPORT Debug& operator<<(Debug&, const RectangularMatrix<3, 3, Double>&); +extern template MAGNUM_EXPORT Debug& operator<<(Debug&, const RectangularMatrix<4, 4, Double>&); /* Rectangular matrices */ -extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const RectangularMatrix<2, 3, Float>&); -extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const RectangularMatrix<3, 2, Float>&); -extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const RectangularMatrix<2, 4, Float>&); -extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const RectangularMatrix<4, 2, Float>&); -extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const RectangularMatrix<3, 4, Float>&); -extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const RectangularMatrix<4, 3, Float>&); -extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const RectangularMatrix<2, 3, Double>&); -extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const RectangularMatrix<3, 2, Double>&); -extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const RectangularMatrix<2, 4, Double>&); -extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const RectangularMatrix<4, 2, Double>&); -extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const RectangularMatrix<3, 4, Double>&); -extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const RectangularMatrix<4, 3, Double>&); +extern template MAGNUM_EXPORT Debug& operator<<(Debug&, const RectangularMatrix<2, 3, Float>&); +extern template MAGNUM_EXPORT Debug& operator<<(Debug&, const RectangularMatrix<3, 2, Float>&); +extern template MAGNUM_EXPORT Debug& operator<<(Debug&, const RectangularMatrix<2, 4, Float>&); +extern template MAGNUM_EXPORT Debug& operator<<(Debug&, const RectangularMatrix<4, 2, Float>&); +extern template MAGNUM_EXPORT Debug& operator<<(Debug&, const RectangularMatrix<3, 4, Float>&); +extern template MAGNUM_EXPORT Debug& operator<<(Debug&, const RectangularMatrix<4, 3, Float>&); +extern template MAGNUM_EXPORT Debug& operator<<(Debug&, const RectangularMatrix<2, 3, Double>&); +extern template MAGNUM_EXPORT Debug& operator<<(Debug&, const RectangularMatrix<3, 2, Double>&); +extern template MAGNUM_EXPORT Debug& operator<<(Debug&, const RectangularMatrix<2, 4, Double>&); +extern template MAGNUM_EXPORT Debug& operator<<(Debug&, const RectangularMatrix<4, 2, Double>&); +extern template MAGNUM_EXPORT Debug& operator<<(Debug&, const RectangularMatrix<3, 4, Double>&); +extern template MAGNUM_EXPORT Debug& operator<<(Debug&, const RectangularMatrix<4, 3, Double>&); #endif #endif @@ -805,15 +805,15 @@ extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utili #endif namespace Implementation { - template constexpr Vector diagonalMatrixColumn2(Corrade::Containers::Implementation::Sequence, const T& number) { + template constexpr Vector diagonalMatrixColumn2(Containers::Implementation::Sequence, const T& number) { return {(sequence == i ? number : T(0))...}; } template constexpr Vector diagonalMatrixColumn(const T& number) { - return diagonalMatrixColumn2(typename Corrade::Containers::Implementation::GenerateSequence::Type{}, number); + return diagonalMatrixColumn2(typename Containers::Implementation::GenerateSequence::Type{}, number); } } -template template constexpr RectangularMatrix::RectangularMatrix(Corrade::Containers::Implementation::Sequence, const Vector& diagonal): _data{Implementation::diagonalMatrixColumn(sequence < DiagonalSize ? diagonal[sequence] : T{})...} {} +template template constexpr RectangularMatrix::RectangularMatrix(Containers::Implementation::Sequence, const Vector& diagonal): _data{Implementation::diagonalMatrixColumn(sequence < DiagonalSize ? diagonal[sequence] : T{})...} {} template inline Vector RectangularMatrix::row(std::size_t row) const { Vector out; @@ -868,7 +868,7 @@ template inline RectangularMatrix template constexpr auto RectangularMatrix::diagonalInternal(Corrade::Containers::Implementation::Sequence) const -> Vector { +template template constexpr auto RectangularMatrix::diagonalInternal(Containers::Implementation::Sequence) const -> Vector { return {_data[sequence][sequence]...}; } #endif diff --git a/src/Magnum/Math/Swizzle.h b/src/Magnum/Math/Swizzle.h index 6bb2a2b68..ac35a5bc1 100644 --- a/src/Magnum/Math/Swizzle.h +++ b/src/Magnum/Math/Swizzle.h @@ -90,7 +90,7 @@ namespace Implementation { template struct ScatterComponent: ScatterComponentOr {}; template struct ScatterComponent: ScatterComponentOr {}; - template constexpr T scatterComponentOr(const T& vector, const typename T::Type& value, Corrade::Containers::Implementation::Sequence) { + template constexpr T scatterComponentOr(const T& vector, const typename T::Type& value, Containers::Implementation::Sequence) { return {ScatterComponent::value(vector, value)...}; } template constexpr T scatterRecursive(const T& vector, const Vector&, std::size_t) { @@ -98,7 +98,7 @@ namespace Implementation { } template constexpr T scatterRecursive(const T& vector, const Vector& values, std::size_t valueIndex) { return scatterRecursive( - scatterComponentOr(vector, values._data[valueIndex], typename Corrade::Containers::Implementation::GenerateSequence::Type{}), + scatterComponentOr(vector, values._data[valueIndex], typename Containers::Implementation::GenerateSequence::Type{}), values, valueIndex + 1); } } diff --git a/src/Magnum/Math/Test/AngleTest.cpp b/src/Magnum/Math/Test/AngleTest.cpp index 4bf68ebcf..96be720c9 100644 --- a/src/Magnum/Math/Test/AngleTest.cpp +++ b/src/Magnum/Math/Test/AngleTest.cpp @@ -39,7 +39,7 @@ namespace Magnum { namespace Math { namespace Test { namespace { -struct AngleTest: Corrade::TestSuite::Tester { +struct AngleTest: TestSuite::Tester { explicit AngleTest(); void construct(); @@ -84,16 +84,16 @@ constexpr struct { constexpr struct { const char* name; const char* data; - Corrade::Utility::TweakableState state; + Utility::TweakableState state; const char* error; } TweakableErrorData[] { - {"empty", "", Corrade::Utility::TweakableState::Recompile, + {"empty", "", Utility::TweakableState::Recompile, "Utility::TweakableParser: is not an angle literal\n"}, - {"integral", "42_{}", Corrade::Utility::TweakableState::Recompile, + {"integral", "42_{}", Utility::TweakableState::Recompile, "Utility::TweakableParser: 42_{} is not an angle literal\n"}, - {"garbage after", "42.b_{}", Corrade::Utility::TweakableState::Recompile, + {"garbage after", "42.b_{}", Utility::TweakableState::Recompile, "Utility::TweakableParser: unexpected characters b_{} after an angle literal\n"}, - {"different suffix", "42.0u", Corrade::Utility::TweakableState::Recompile, /* not for double */ + {"different suffix", "42.0u", Utility::TweakableState::Recompile, /* not for double */ "Utility::TweakableParser: 42.0u has an unexpected suffix, expected _{}\n"} }; @@ -157,7 +157,7 @@ AngleTest::AngleTest() { &AngleTest::tweakable>, &AngleTest::tweakable, &AngleTest::tweakable>}, - Corrade::Containers::arraySize(TweakableData)); + Containers::arraySize(TweakableData)); addInstancedTests({ &AngleTest::tweakableError, @@ -168,7 +168,7 @@ AngleTest::AngleTest() { &AngleTest::tweakableError>, &AngleTest::tweakableError, &AngleTest::tweakableError>}, - Corrade::Containers::arraySize(TweakableErrorData)); + Containers::arraySize(TweakableErrorData)); #endif } @@ -351,8 +351,8 @@ template void AngleTest::tweakable() { auto&& data = TweakableData[testCaseInstanceId()]; setTestCaseTemplateName(TweakableTraits::name()); setTestCaseDescription(data.name); - auto result = Corrade::Utility::TweakableParser::parse(Corrade::Utility::format(data.data, TweakableTraits::literal())); - CORRADE_COMPARE(result.first(), Corrade::Utility::TweakableState::Success); + auto result = Utility::TweakableParser::parse(Utility::format(data.data, TweakableTraits::literal())); + CORRADE_COMPARE(result.first(), Utility::TweakableState::Success); CORRADE_COMPARE(result.second(), T(typename T::Type(data.result))); } @@ -364,8 +364,8 @@ template void AngleTest::tweakableError() { std::ostringstream out; Warning redirectWarning{&out}; Error redirectError{&out}; - Corrade::Utility::TweakableState state = Corrade::Utility::TweakableParser::parse(Corrade::Utility::format(data.data, TweakableTraits::literal())).first(); - CORRADE_COMPARE(out.str(), Corrade::Utility::formatString(data.error, TweakableTraits::literal())); + Utility::TweakableState state = Utility::TweakableParser::parse(Utility::format(data.data, TweakableTraits::literal())).first(); + CORRADE_COMPARE(out.str(), Utility::formatString(data.error, TweakableTraits::literal())); CORRADE_COMPARE(state, data.state); } #endif diff --git a/src/Magnum/Math/Test/BezierTest.cpp b/src/Magnum/Math/Test/BezierTest.cpp index 9389648d4..b63b46c8e 100644 --- a/src/Magnum/Math/Test/BezierTest.cpp +++ b/src/Magnum/Math/Test/BezierTest.cpp @@ -64,7 +64,7 @@ typedef Math::QuadraticBezier2D QuadraticBezier2Dd; typedef Math::CubicBezier2D CubicBezier2D; typedef Math::CubicHermite2D CubicHermite2D; -struct BezierTest: Corrade::TestSuite::Tester { +struct BezierTest: TestSuite::Tester { explicit BezierTest(); void construct(); @@ -248,8 +248,8 @@ void BezierTest::data() { CORRADE_COMPARE(d, (Vector2{3.5f, 0.1f})); /* It actually returns an array */ - CORRADE_COMPARE(Corrade::Containers::arraySize(a.data()), 3); - CORRADE_COMPARE(Corrade::Containers::arraySize(ca.data()), 3); + CORRADE_COMPARE(Containers::arraySize(a.data()), 3); + CORRADE_COMPARE(Containers::arraySize(ca.data()), 3); } void BezierTest::compare() { diff --git a/src/Magnum/Math/Test/BitVectorTest.cpp b/src/Magnum/Math/Test/BitVectorTest.cpp index 30f9b23ae..44da01787 100644 --- a/src/Magnum/Math/Test/BitVectorTest.cpp +++ b/src/Magnum/Math/Test/BitVectorTest.cpp @@ -52,7 +52,7 @@ template<> struct BitVectorConverter<3, BVec3> { namespace Test { namespace { -struct BitVectorTest: Corrade::TestSuite::Tester { +struct BitVectorTest: TestSuite::Tester { explicit BitVectorTest(); void construct(); @@ -242,8 +242,8 @@ void BitVectorTest::data() { CORRADE_COMPARE(c, 0x08); /* It actually returns an array */ - CORRADE_COMPARE(Corrade::Containers::arraySize(a1.data()), 3); - CORRADE_COMPARE(Corrade::Containers::arraySize(ca.data()), 3); + CORRADE_COMPARE(Containers::arraySize(a1.data()), 3); + CORRADE_COMPARE(Containers::arraySize(ca.data()), 3); } void BitVectorTest::compare() { diff --git a/src/Magnum/Math/Test/ColorBatchTest.cpp b/src/Magnum/Math/Test/ColorBatchTest.cpp index cc963e8ea..9c0fcfcbc 100644 --- a/src/Magnum/Math/Test/ColorBatchTest.cpp +++ b/src/Magnum/Math/Test/ColorBatchTest.cpp @@ -47,7 +47,7 @@ namespace Magnum { namespace Math { namespace Test { namespace { -struct ColorBatchTest: Corrade::TestSuite::Tester { +struct ColorBatchTest: TestSuite::Tester { explicit ColorBatchTest(); void yFlip(); @@ -296,7 +296,7 @@ void ColorBatchTest::yFlip() { setTestCaseDescription(data.name); /* Copy to a mutable array first to operate in-place */ - Containers::Array blocks{Corrade::NoInit, data.input.size()}; + Containers::Array blocks{Magnum::NoInit, data.input.size()}; Utility::copy(data.input, blocks); /* Using expanded() instead of the constructor as it catches issues where the size would be smaller than the actual data */ @@ -323,22 +323,22 @@ void ColorBatchTest::yFlip() { if(decoded->format() == PixelFormat::RGBA8Unorm) CORRADE_COMPARE_WITH(decoded->pixels().flipped<0>(), - Corrade::Utility::Path::join(COLORBATCH_TEST_DIR, data.file), + Utility::Path::join(COLORBATCH_TEST_DIR, data.file), (DebugTools::CompareImageToFile{_importerManager, _converterManager})); else if(decoded->format() == PixelFormat::RG8Unorm) CORRADE_COMPARE_WITH(decoded->pixels().flipped<0>(), - Corrade::Utility::Path::join(COLORBATCH_TEST_DIR, data.file), + Utility::Path::join(COLORBATCH_TEST_DIR, data.file), (DebugTools::CompareImageToFile{_importerManager, _converterManager})); else if(decoded->format() == PixelFormat::R8Unorm) CORRADE_COMPARE_WITH(decoded->pixels().flipped<0>(), - Corrade::Utility::Path::join(COLORBATCH_TEST_DIR, data.file), + Utility::Path::join(COLORBATCH_TEST_DIR, data.file), (DebugTools::CompareImageToFile{_importerManager, _converterManager})); else CORRADE_FAIL("Unexpected format" << decoded->format()); } void ColorBatchTest::yFlip3D() { /* Copy to a mutable array first to operate in-place */ - Containers::Array blocks{Corrade::NoInit, Containers::arraySize(CheckerboardBC1)}; + Containers::Array blocks{Magnum::NoInit, Containers::arraySize(CheckerboardBC1)}; Utility::copy(CheckerboardBC1, blocks); /* The 2D 4x6 blocks image is turned into 4 slices of 1x6 blocks each. diff --git a/src/Magnum/Math/Test/ColorTest.cpp b/src/Magnum/Math/Test/ColorTest.cpp index aebd4d6b3..d2dbaf329 100644 --- a/src/Magnum/Math/Test/ColorTest.cpp +++ b/src/Magnum/Math/Test/ColorTest.cpp @@ -74,7 +74,7 @@ template<> struct VectorConverter<4, float, Vec4> { namespace Test { namespace { -struct ColorTest: Corrade::TestSuite::Tester { +struct ColorTest: TestSuite::Tester { explicit ColorTest(); void construct(); @@ -193,20 +193,20 @@ const struct { constexpr struct { const char* name; const char* data; - Corrade::Utility::TweakableState state; + Utility::TweakableState state; const char* error; } TweakableErrorData[] { - {"empty", "", Corrade::Utility::TweakableState::Recompile, + {"empty", "", Utility::TweakableState::Recompile, "Utility::TweakableParser: is not a hexadecimal color literal\n"}, - {"char", "'a'", Corrade::Utility::TweakableState::Recompile, + {"char", "'a'", Utility::TweakableState::Recompile, "Utility::TweakableParser: 'a' is not a hexadecimal color literal\n"}, - {"not hex", "{}_{}", Corrade::Utility::TweakableState::Recompile, + {"not hex", "{}_{}", Utility::TweakableState::Recompile, "Utility::TweakableParser: {0}_{2}{1} is not a hexadecimal color literal\n"}, - {"garbage after", "0x{}._{}", Corrade::Utility::TweakableState::Recompile, + {"garbage after", "0x{}._{}", Utility::TweakableState::Recompile, "Utility::TweakableParser: unexpected characters ._{2}{1} after a color literal\n"}, - {"different suffix", "0x{}f", Corrade::Utility::TweakableState::Recompile, + {"different suffix", "0x{}f", Utility::TweakableState::Recompile, "Utility::TweakableParser: 0x{0}f has an unexpected suffix, expected _{1} or _s{1}\n"}, - {"bad size", "0x333_{1}", Corrade::Utility::TweakableState::Error, + {"bad size", "0x333_{1}", Utility::TweakableState::Error, "Utility::TweakableParser: 0x333_{2}{1} doesn't have expected number of digits\n"}, }; #endif @@ -280,7 +280,7 @@ ColorTest::ColorTest() { &ColorTest::tweakableSrgbf, &ColorTest::tweakableRgbaf, &ColorTest::tweakableSrgbaf}, - Corrade::Containers::arraySize(TweakableData)); + Containers::arraySize(TweakableData)); addInstancedTests({&ColorTest::tweakableErrorRgb, &ColorTest::tweakableErrorSrgb, @@ -290,7 +290,7 @@ ColorTest::ColorTest() { &ColorTest::tweakableErrorSrgbf, &ColorTest::tweakableErrorRgbaf, &ColorTest::tweakableErrorSrgbaf}, - Corrade::Containers::arraySize(TweakableErrorData)); + Containers::arraySize(TweakableErrorData)); #endif } @@ -973,8 +973,8 @@ void ColorTest::integralLinearRgbToIntegral() { void ColorTest::srgbMonotonic() { Color3 rgbPrevious = Color3::fromSrgb(Vector3us(testCaseRepeatId())); Color3 rgb = Color3::fromSrgb(Vector3us(testCaseRepeatId() + 1)); - CORRADE_COMPARE_AS(rgb, rgbPrevious, Corrade::TestSuite::Compare::Greater); - CORRADE_COMPARE_AS(rgb, Color3(0.0f), Corrade::TestSuite::Compare::GreaterOrEqual); + CORRADE_COMPARE_AS(rgb, rgbPrevious, TestSuite::Compare::Greater); + CORRADE_COMPARE_AS(rgb, Color3(0.0f), TestSuite::Compare::GreaterOrEqual); { #ifdef CORRADE_TARGET_EMSCRIPTEN CORRADE_EXPECT_FAIL_IF(testCaseRepeatId() == 65534 && !!(rgb > Color3(1.0f)), @@ -982,7 +982,7 @@ void ColorTest::srgbMonotonic() { "optimizations. Happens only on larger optimization levels, not " "on -O1."); #endif - CORRADE_COMPARE_AS(rgb, Color3(1.0f), Corrade::TestSuite::Compare::LessOrEqual); + CORRADE_COMPARE_AS(rgb, Color3(1.0f), TestSuite::Compare::LessOrEqual); } } @@ -1187,8 +1187,8 @@ void ColorTest::tweakableRgb() { auto&& data = TweakableData[testCaseInstanceId()]; setTestCaseDescription(data.name); - Corrade::Containers::Pair result = Corrade::Utility::TweakableParser::parse(Corrade::Utility::format(data.dataRgb, "rgb")); - CORRADE_COMPARE(result.first(), Corrade::Utility::TweakableState::Success); + Containers::Pair result = Utility::TweakableParser::parse(Utility::format(data.dataRgb, "rgb")); + CORRADE_COMPARE(result.first(), Utility::TweakableState::Success); CORRADE_COMPARE(result.second(), data.resultUb.rgb()); } @@ -1196,8 +1196,8 @@ void ColorTest::tweakableSrgb() { auto&& data = TweakableData[testCaseInstanceId()]; setTestCaseDescription(data.name); - Corrade::Containers::Pair result = Corrade::Utility::TweakableParser::parse(Corrade::Utility::format(data.dataRgb, "srgb")); - CORRADE_COMPARE(result.first(), Corrade::Utility::TweakableState::Success); + Containers::Pair result = Utility::TweakableParser::parse(Utility::format(data.dataRgb, "srgb")); + CORRADE_COMPARE(result.first(), Utility::TweakableState::Success); CORRADE_COMPARE(result.second(), data.resultUb.rgb()); } @@ -1205,8 +1205,8 @@ void ColorTest::tweakableRgba() { auto&& data = TweakableData[testCaseInstanceId()]; setTestCaseDescription(data.name); - Corrade::Containers::Pair result = Corrade::Utility::TweakableParser::parse(Corrade::Utility::format(data.dataRgba, "rgba")); - CORRADE_COMPARE(result.first(), Corrade::Utility::TweakableState::Success); + Containers::Pair result = Utility::TweakableParser::parse(Utility::format(data.dataRgba, "rgba")); + CORRADE_COMPARE(result.first(), Utility::TweakableState::Success); CORRADE_COMPARE(result.second(), data.resultUb); } @@ -1214,8 +1214,8 @@ void ColorTest::tweakableSrgba() { auto&& data = TweakableData[testCaseInstanceId()]; setTestCaseDescription(data.name); - Corrade::Containers::Pair result = Corrade::Utility::TweakableParser::parse(Corrade::Utility::format(data.dataRgba, "srgba")); - CORRADE_COMPARE(result.first(), Corrade::Utility::TweakableState::Success); + Containers::Pair result = Utility::TweakableParser::parse(Utility::format(data.dataRgba, "srgba")); + CORRADE_COMPARE(result.first(), Utility::TweakableState::Success); CORRADE_COMPARE(result.second(), data.resultUb); } @@ -1223,8 +1223,8 @@ void ColorTest::tweakableRgbf() { auto&& data = TweakableData[testCaseInstanceId()]; setTestCaseDescription(data.name); - Corrade::Containers::Pair result = Corrade::Utility::TweakableParser::parse(Corrade::Utility::format(data.dataRgb, "rgbf")); - CORRADE_COMPARE(result.first(), Corrade::Utility::TweakableState::Success); + Containers::Pair result = Utility::TweakableParser::parse(Utility::format(data.dataRgb, "rgbf")); + CORRADE_COMPARE(result.first(), Utility::TweakableState::Success); CORRADE_COMPARE(result.second(), data.result.rgb()); } @@ -1232,8 +1232,8 @@ void ColorTest::tweakableSrgbf() { auto&& data = TweakableData[testCaseInstanceId()]; setTestCaseDescription(data.name); - Corrade::Containers::Pair result = Corrade::Utility::TweakableParser::parse(Corrade::Utility::format(data.dataRgb, "srgbf")); - CORRADE_COMPARE(result.first(), Corrade::Utility::TweakableState::Success); + Containers::Pair result = Utility::TweakableParser::parse(Utility::format(data.dataRgb, "srgbf")); + CORRADE_COMPARE(result.first(), Utility::TweakableState::Success); CORRADE_COMPARE(result.second(), data.resultSrgba.rgb()); } @@ -1241,8 +1241,8 @@ void ColorTest::tweakableRgbaf() { auto&& data = TweakableData[testCaseInstanceId()]; setTestCaseDescription(data.name); - Corrade::Containers::Pair result = Corrade::Utility::TweakableParser::parse(Corrade::Utility::format(data.dataRgba, "rgbaf")); - CORRADE_COMPARE(result.first(), Corrade::Utility::TweakableState::Success); + Containers::Pair result = Utility::TweakableParser::parse(Utility::format(data.dataRgba, "rgbaf")); + CORRADE_COMPARE(result.first(), Utility::TweakableState::Success); CORRADE_COMPARE(result.second(), data.result); } @@ -1250,8 +1250,8 @@ void ColorTest::tweakableSrgbaf() { auto&& data = TweakableData[testCaseInstanceId()]; setTestCaseDescription(data.name); - Corrade::Containers::Pair result = Corrade::Utility::TweakableParser::parse(Corrade::Utility::format(data.dataRgba, "srgbaf")); - CORRADE_COMPARE(result.first(), Corrade::Utility::TweakableState::Success); + Containers::Pair result = Utility::TweakableParser::parse(Utility::format(data.dataRgba, "srgbaf")); + CORRADE_COMPARE(result.first(), Utility::TweakableState::Success); CORRADE_COMPARE(result.second(), data.resultSrgba); } @@ -1262,8 +1262,8 @@ void ColorTest::tweakableErrorRgb() { std::ostringstream out; Warning redirectWarning{&out}; Error redirectError{&out}; - Corrade::Utility::TweakableState state = Corrade::Utility::TweakableParser::parse(Corrade::Utility::format(data.data, "ff3366", "rgb")).first(); - CORRADE_COMPARE(out.str(), Corrade::Utility::formatString(data.error, "ff3366", "rgb", "")); + Utility::TweakableState state = Utility::TweakableParser::parse(Utility::format(data.data, "ff3366", "rgb")).first(); + CORRADE_COMPARE(out.str(), Utility::formatString(data.error, "ff3366", "rgb", "")); CORRADE_COMPARE(state, data.state); } @@ -1274,8 +1274,8 @@ void ColorTest::tweakableErrorSrgb() { std::ostringstream out; Warning redirectWarning{&out}; Error redirectError{&out}; - Corrade::Utility::TweakableState state = Corrade::Utility::TweakableParser::parse(Corrade::Utility::format(data.data, "ff3366", "srgb")).first(); - CORRADE_COMPARE(out.str(), Corrade::Utility::formatString(data.error, "ff3366", "rgb", "s")); + Utility::TweakableState state = Utility::TweakableParser::parse(Utility::format(data.data, "ff3366", "srgb")).first(); + CORRADE_COMPARE(out.str(), Utility::formatString(data.error, "ff3366", "rgb", "s")); CORRADE_COMPARE(state, data.state); } @@ -1286,8 +1286,8 @@ void ColorTest::tweakableErrorRgba() { std::ostringstream out; Warning redirectWarning{&out}; Error redirectError{&out}; - Corrade::Utility::TweakableState state = Corrade::Utility::TweakableParser::parse(Corrade::Utility::format(data.data, "ff3366aa", "rgba")).first(); - CORRADE_COMPARE(out.str(), Corrade::Utility::formatString(data.error, "ff3366aa", "rgba", "")); + Utility::TweakableState state = Utility::TweakableParser::parse(Utility::format(data.data, "ff3366aa", "rgba")).first(); + CORRADE_COMPARE(out.str(), Utility::formatString(data.error, "ff3366aa", "rgba", "")); CORRADE_COMPARE(state, data.state); } @@ -1298,8 +1298,8 @@ void ColorTest::tweakableErrorSrgba() { std::ostringstream out; Warning redirectWarning{&out}; Error redirectError{&out}; - Corrade::Utility::TweakableState state = Corrade::Utility::TweakableParser::parse(Corrade::Utility::format(data.data, "ff3366aa", "srgba")).first(); - CORRADE_COMPARE(out.str(), Corrade::Utility::formatString(data.error, "ff3366aa", "rgba", "s")); + Utility::TweakableState state = Utility::TweakableParser::parse(Utility::format(data.data, "ff3366aa", "srgba")).first(); + CORRADE_COMPARE(out.str(), Utility::formatString(data.error, "ff3366aa", "rgba", "s")); CORRADE_COMPARE(state, data.state); } @@ -1310,8 +1310,8 @@ void ColorTest::tweakableErrorRgbf() { std::ostringstream out; Warning redirectWarning{&out}; Error redirectError{&out}; - Corrade::Utility::TweakableState state = Corrade::Utility::TweakableParser::parse(Corrade::Utility::format(data.data, "ff3366", "rgbf")).first(); - CORRADE_COMPARE(out.str(), Corrade::Utility::formatString(data.error, "ff3366", "rgbf", "")); + Utility::TweakableState state = Utility::TweakableParser::parse(Utility::format(data.data, "ff3366", "rgbf")).first(); + CORRADE_COMPARE(out.str(), Utility::formatString(data.error, "ff3366", "rgbf", "")); CORRADE_COMPARE(state, data.state); } @@ -1322,8 +1322,8 @@ void ColorTest::tweakableErrorSrgbf() { std::ostringstream out; Warning redirectWarning{&out}; Error redirectError{&out}; - Corrade::Utility::TweakableState state = Corrade::Utility::TweakableParser::parse(Corrade::Utility::format(data.data, "ff3366", "srgbf")).first(); - CORRADE_COMPARE(out.str(), Corrade::Utility::formatString(data.error, "ff3366", "rgbf", "s")); + Utility::TweakableState state = Utility::TweakableParser::parse(Utility::format(data.data, "ff3366", "srgbf")).first(); + CORRADE_COMPARE(out.str(), Utility::formatString(data.error, "ff3366", "rgbf", "s")); CORRADE_COMPARE(state, data.state); } @@ -1334,8 +1334,8 @@ void ColorTest::tweakableErrorRgbaf() { std::ostringstream out; Warning redirectWarning{&out}; Error redirectError{&out}; - Corrade::Utility::TweakableState state = Corrade::Utility::TweakableParser::parse(Corrade::Utility::format(data.data, "ff3366aa", "rgbaf")).first(); - CORRADE_COMPARE(out.str(), Corrade::Utility::formatString(data.error, "ff3366aa", "rgbaf", "")); + Utility::TweakableState state = Utility::TweakableParser::parse(Utility::format(data.data, "ff3366aa", "rgbaf")).first(); + CORRADE_COMPARE(out.str(), Utility::formatString(data.error, "ff3366aa", "rgbaf", "")); CORRADE_COMPARE(state, data.state); } @@ -1346,8 +1346,8 @@ void ColorTest::tweakableErrorSrgbaf() { std::ostringstream out; Warning redirectWarning{&out}; Error redirectError{&out}; - Corrade::Utility::TweakableState state = Corrade::Utility::TweakableParser::parse(Corrade::Utility::format(data.data, "ff3366aa", "srgbaf")).first(); - CORRADE_COMPARE(out.str(), Corrade::Utility::formatString(data.error, "ff3366aa", "rgbaf", "s")); + Utility::TweakableState state = Utility::TweakableParser::parse(Utility::format(data.data, "ff3366aa", "srgbaf")).first(); + CORRADE_COMPARE(out.str(), Utility::formatString(data.error, "ff3366aa", "rgbaf", "s")); CORRADE_COMPARE(state, data.state); } #endif diff --git a/src/Magnum/Math/Test/ComplexTest.cpp b/src/Magnum/Math/Test/ComplexTest.cpp index e0369993d..6af9268fc 100644 --- a/src/Magnum/Math/Test/ComplexTest.cpp +++ b/src/Magnum/Math/Test/ComplexTest.cpp @@ -53,7 +53,7 @@ template<> struct ComplexConverter { namespace Test { namespace { -struct ComplexTest: Corrade::TestSuite::Tester { +struct ComplexTest: TestSuite::Tester { explicit ComplexTest(); void construct(); @@ -305,8 +305,8 @@ void ComplexTest::data() { CORRADE_COMPARE(*ca.data(), 1.5f); /* It actually returns an array */ - CORRADE_COMPARE(Corrade::Containers::arraySize(a.data()), 2); - CORRADE_COMPARE(Corrade::Containers::arraySize(ca.data()), 2); + CORRADE_COMPARE(Containers::arraySize(a.data()), 2); + CORRADE_COMPARE(Containers::arraySize(ca.data()), 2); } void ComplexTest::compare() { diff --git a/src/Magnum/Math/Test/ConfigurationValueTest.cpp b/src/Magnum/Math/Test/ConfigurationValueTest.cpp index 396c38ca6..be810a0e1 100644 --- a/src/Magnum/Math/Test/ConfigurationValueTest.cpp +++ b/src/Magnum/Math/Test/ConfigurationValueTest.cpp @@ -31,7 +31,7 @@ namespace Magnum { namespace Math { namespace Test { namespace { -struct ConfigurationValueTest: Corrade::TestSuite::Tester { +struct ConfigurationValueTest: TestSuite::Tester { explicit ConfigurationValueTest(); void deg(); @@ -86,7 +86,7 @@ ConfigurationValueTest::ConfigurationValueTest() { void ConfigurationValueTest::deg() { typedef Math::Deg Deg; - Corrade::Utility::Configuration c; + Utility::Configuration c; Deg angle{25.3f}; std::string value("25.3"); @@ -99,7 +99,7 @@ void ConfigurationValueTest::deg() { void ConfigurationValueTest::rad() { typedef Math::Rad Rad; - Corrade::Utility::Configuration c; + Utility::Configuration c; Rad angle{3.14159f}; std::string value("3.14159"); @@ -112,7 +112,7 @@ void ConfigurationValueTest::rad() { void ConfigurationValueTest::vector() { typedef Vector<4, Float> Vector4; - Corrade::Utility::Configuration c; + Utility::Configuration c; Vector4 vec(3.0f, 3.125f, 9.0f, 9.55f); std::string value("3 3.125 9 9.55"); @@ -133,7 +133,7 @@ void ConfigurationValueTest::vector() { void ConfigurationValueTest::vector2() { typedef Math::Vector2 Vector2; - Corrade::Utility::Configuration c; + Utility::Configuration c; Vector2 vec(3.125f, 9.0f); std::string value("3.125 9"); @@ -146,7 +146,7 @@ void ConfigurationValueTest::vector2() { void ConfigurationValueTest::vector3() { typedef Math::Vector3 Vector3; - Corrade::Utility::Configuration c; + Utility::Configuration c; Vector3 vec(3.0f, 3.125f, 9.55f); std::string value("3 3.125 9.55"); @@ -159,7 +159,7 @@ void ConfigurationValueTest::vector3() { void ConfigurationValueTest::vector4() { typedef Math::Vector4 Vector4; - Corrade::Utility::Configuration c; + Utility::Configuration c; Vector4 vec(3.0f, 3.125f, 9.0f, 9.55f); std::string value("3 3.125 9 9.55"); @@ -173,7 +173,7 @@ void ConfigurationValueTest::color() { typedef Math::Color3 Color3; typedef Math::Color4 Color4; - Corrade::Utility::Configuration c; + Utility::Configuration c; Color3 color3(0.5f, 0.75f, 1.0f); std::string value3("0.5 0.75 1"); @@ -199,7 +199,7 @@ void ConfigurationValueTest::rectangularMatrix() { Vector4(7.0f, -1.0f, 8.0f, 9.55f)); std::string value("3 4 7 5 4 -1 8 7 8 4 3.125 9.55"); - Corrade::Utility::Configuration c; + Utility::Configuration c; c.setValue("matrix", m); CORRADE_COMPARE(c.value("matrix"), value); @@ -224,7 +224,7 @@ void ConfigurationValueTest::matrix() { typedef Math::Vector4 Vector4; typedef Math::Matrix4x4 Matrix4x4; - Corrade::Utility::Configuration c; + Utility::Configuration c; Matrix4x4 m(Vector4(3.0f, 5.0f, 8.0f, 4.0f), Vector4(4.0f, 4.0f, 7.0f, 3.125f), @@ -240,7 +240,7 @@ void ConfigurationValueTest::matrix() { void ConfigurationValueTest::matrix3() { typedef Math::Matrix3 Matrix3; - Corrade::Utility::Configuration c; + Utility::Configuration c; Matrix3 m({5.0f, 8.0f, 4.0f}, {4.0f, 7.0f, 3.125f}, @@ -255,7 +255,7 @@ void ConfigurationValueTest::matrix3() { void ConfigurationValueTest::matrix4() { typedef Math::Matrix4 Matrix4; - Corrade::Utility::Configuration c; + Utility::Configuration c; Matrix4 m({3.0f, 5.0f, 8.0f, 4.0f}, {4.0f, 4.0f, 7.0f, 3.125f}, @@ -271,7 +271,7 @@ void ConfigurationValueTest::matrix4() { void ConfigurationValueTest::complex() { typedef Math::Complex Complex; - Corrade::Utility::Configuration c; + Utility::Configuration c; Complex x{3.0f, 3.125f}; std::string value{"3 3.125"}; @@ -292,7 +292,7 @@ void ConfigurationValueTest::complex() { void ConfigurationValueTest::dualComplex() { typedef Math::DualComplex DualComplex; - Corrade::Utility::Configuration c; + Utility::Configuration c; DualComplex a{{3.0f, 3.125f}, {9.0f, 9.55f}}; std::string value("3 3.125 9 9.55"); @@ -313,7 +313,7 @@ void ConfigurationValueTest::dualComplex() { void ConfigurationValueTest::quaternion() { typedef Math::Quaternion Quaternion; - Corrade::Utility::Configuration c; + Utility::Configuration c; Quaternion q{{3.0f, 3.125f, 9.0f}, 9.55f}; std::string value{"3 3.125 9 9.55"}; @@ -334,7 +334,7 @@ void ConfigurationValueTest::quaternion() { void ConfigurationValueTest::dualQuaternion() { typedef Math::DualQuaternion DualQuaternion; - Corrade::Utility::Configuration c; + Utility::Configuration c; DualQuaternion a{{{3.0f, 3.125f, 9.0f}, 9.55f}, {{-1.2f, 0.3f, 1.1f}, 92.05f}}; std::string value{"3 3.125 9 9.55 -1.2 0.3 1.1 92.05"}; @@ -355,7 +355,7 @@ void ConfigurationValueTest::dualQuaternion() { void ConfigurationValueTest::range() { typedef Math::Range2D Range2D; - Corrade::Utility::Configuration c; + Utility::Configuration c; Range2D rect({3.0f, 3.125f}, {9.0f, 9.55f}); std::string value("3 3.125 9 9.55"); @@ -369,7 +369,7 @@ void ConfigurationValueTest::bezier() { typedef Math::Vector2 Vector2; typedef Math::CubicBezier2D CubicBezier2D; - Corrade::Utility::Configuration c; + Utility::Configuration c; CubicBezier2D bezier{Vector2{0.0f, 1.0f}, Vector2{1.5f, -0.3f}, Vector2{2.1f, 0.5f}, Vector2{0.0f, 2.0f}}; std::string value("0 1 1.5 -0.3 2.1 0.5 0 2"); diff --git a/src/Magnum/Math/Test/ConstantsTest.cpp b/src/Magnum/Math/Test/ConstantsTest.cpp index 5abb9b446..0d36c6411 100644 --- a/src/Magnum/Math/Test/ConstantsTest.cpp +++ b/src/Magnum/Math/Test/ConstantsTest.cpp @@ -31,7 +31,7 @@ namespace Magnum { namespace Math { namespace Test { namespace { -struct ConstantsTest: Corrade::TestSuite::Tester { +struct ConstantsTest: TestSuite::Tester { explicit ConstantsTest(); template void constants(); diff --git a/src/Magnum/Math/Test/CubicHermiteTest.cpp b/src/Magnum/Math/Test/CubicHermiteTest.cpp index ac6b6cab9..6fee39860 100644 --- a/src/Magnum/Math/Test/CubicHermiteTest.cpp +++ b/src/Magnum/Math/Test/CubicHermiteTest.cpp @@ -35,7 +35,7 @@ namespace Magnum { namespace Math { namespace Test { namespace { -struct CubicHermiteTest: Corrade::TestSuite::Tester { +struct CubicHermiteTest: TestSuite::Tester { explicit CubicHermiteTest(); void constructScalar(); @@ -677,8 +677,8 @@ void CubicHermiteTest::dataScalar() { CORRADE_COMPARE(a.data()[2], 2.1f); /* It actually returns an array */ - CORRADE_COMPARE(Corrade::Containers::arraySize(a.data()), 3); - CORRADE_COMPARE(Corrade::Containers::arraySize(ca.data()), 3); + CORRADE_COMPARE(Containers::arraySize(a.data()), 3); + CORRADE_COMPARE(Containers::arraySize(ca.data()), 3); } void CubicHermiteTest::dataVector() { @@ -702,8 +702,8 @@ void CubicHermiteTest::dataVector() { CORRADE_COMPARE(*ca.data(), (Vector2{1.0f, 2.0f})); /* It actually returns an array */ - CORRADE_COMPARE(Corrade::Containers::arraySize(a.data()), 3); - CORRADE_COMPARE(Corrade::Containers::arraySize(ca.data()), 3); + CORRADE_COMPARE(Containers::arraySize(a.data()), 3); + CORRADE_COMPARE(Containers::arraySize(ca.data()), 3); } void CubicHermiteTest::dataComplex() { @@ -727,8 +727,8 @@ void CubicHermiteTest::dataComplex() { CORRADE_COMPARE(*ca.data(), (Complex{1.0f, 2.0f})); /* It actually returns an array */ - CORRADE_COMPARE(Corrade::Containers::arraySize(a.data()), 3); - CORRADE_COMPARE(Corrade::Containers::arraySize(ca.data()), 3); + CORRADE_COMPARE(Containers::arraySize(a.data()), 3); + CORRADE_COMPARE(Containers::arraySize(ca.data()), 3); } void CubicHermiteTest::dataQuaternion() { @@ -762,8 +762,8 @@ void CubicHermiteTest::dataQuaternion() { CORRADE_COMPARE(*ca.data(), (Quaternion{{1.0f, 2.0f, -1.0f}, 3.0f})); /* It actually returns an array */ - CORRADE_COMPARE(Corrade::Containers::arraySize(a.data()), 3); - CORRADE_COMPARE(Corrade::Containers::arraySize(ca.data()), 3); + CORRADE_COMPARE(Containers::arraySize(a.data()), 3); + CORRADE_COMPARE(Containers::arraySize(ca.data()), 3); } void CubicHermiteTest::compareScalar() { diff --git a/src/Magnum/Math/Test/DistanceTest.cpp b/src/Magnum/Math/Test/DistanceTest.cpp index 6283e9f9c..651297ae1 100644 --- a/src/Magnum/Math/Test/DistanceTest.cpp +++ b/src/Magnum/Math/Test/DistanceTest.cpp @@ -33,7 +33,7 @@ namespace Magnum { namespace Math { namespace Test { namespace { -struct DistanceTest: Corrade::TestSuite::Tester { +struct DistanceTest: TestSuite::Tester { explicit DistanceTest(); void pointPoint2D(); diff --git a/src/Magnum/Math/Test/DualComplexTest.cpp b/src/Magnum/Math/Test/DualComplexTest.cpp index 64348392d..46d763992 100644 --- a/src/Magnum/Math/Test/DualComplexTest.cpp +++ b/src/Magnum/Math/Test/DualComplexTest.cpp @@ -54,7 +54,7 @@ template<> struct DualComplexConverter { namespace Test { namespace { -struct DualComplexTest: Corrade::TestSuite::Tester { +struct DualComplexTest: TestSuite::Tester { explicit DualComplexTest(); void construct(); @@ -298,8 +298,8 @@ void DualComplexTest::data() { CORRADE_COMPARE(a.data()[3], -7.5f); /* It actually returns an array */ - CORRADE_COMPARE(Corrade::Containers::arraySize(a.data()), 4); - CORRADE_COMPARE(Corrade::Containers::arraySize(ca.data()), 4); + CORRADE_COMPARE(Containers::arraySize(a.data()), 4); + CORRADE_COMPARE(Containers::arraySize(ca.data()), 4); } void DualComplexTest::isNormalized() { diff --git a/src/Magnum/Math/Test/DualQuaternionTest.cpp b/src/Magnum/Math/Test/DualQuaternionTest.cpp index 04eaf6565..7db262982 100644 --- a/src/Magnum/Math/Test/DualQuaternionTest.cpp +++ b/src/Magnum/Math/Test/DualQuaternionTest.cpp @@ -56,7 +56,7 @@ template<> struct DualQuaternionConverter { namespace Test { namespace { -struct DualQuaternionTest: Corrade::TestSuite::Tester { +struct DualQuaternionTest: TestSuite::Tester { explicit DualQuaternionTest(); void construct(); @@ -332,8 +332,8 @@ void DualQuaternionTest::data() { CORRADE_COMPARE(ca.data()[4], 0.5f); /* It actually returns an array */ - CORRADE_COMPARE(Corrade::Containers::arraySize(a.data()), 8); - CORRADE_COMPARE(Corrade::Containers::arraySize(ca.data()), 8); + CORRADE_COMPARE(Containers::arraySize(a.data()), 8); + CORRADE_COMPARE(Containers::arraySize(ca.data()), 8); } void DualQuaternionTest::isNormalized() { diff --git a/src/Magnum/Math/Test/DualTest.cpp b/src/Magnum/Math/Test/DualTest.cpp index f40e428d3..18d1ad33c 100644 --- a/src/Magnum/Math/Test/DualTest.cpp +++ b/src/Magnum/Math/Test/DualTest.cpp @@ -34,7 +34,7 @@ namespace Magnum { namespace Math { namespace Test { namespace { -struct DualTest: Corrade::TestSuite::Tester { +struct DualTest: TestSuite::Tester { explicit DualTest(); void construct(); @@ -213,8 +213,8 @@ void DualTest::data() { CORRADE_COMPARE(a.data()[1], -3.5f); /* It actually returns an array */ - CORRADE_COMPARE(Corrade::Containers::arraySize(a.data()), 2); - CORRADE_COMPARE(Corrade::Containers::arraySize(ca.data()), 2); + CORRADE_COMPARE(Containers::arraySize(a.data()), 2); + CORRADE_COMPARE(Containers::arraySize(ca.data()), 2); } void DualTest::compare() { diff --git a/src/Magnum/Math/Test/FrustumTest.cpp b/src/Magnum/Math/Test/FrustumTest.cpp index d1c2c2c8f..63c85f923 100644 --- a/src/Magnum/Math/Test/FrustumTest.cpp +++ b/src/Magnum/Math/Test/FrustumTest.cpp @@ -65,7 +65,7 @@ template<> struct FrustumConverter { namespace Test { namespace { -struct FrustumTest: Corrade::TestSuite::Tester { +struct FrustumTest: TestSuite::Tester { explicit FrustumTest(); void construct(); @@ -303,9 +303,9 @@ void FrustumTest::convert() { #else constexpr Frstm d(b); #endif - CORRADE_COMPARE_AS(Corrade::Containers::arrayView(d.data), - Corrade::Containers::arrayView(a.data), - Corrade::TestSuite::Compare::Container); + CORRADE_COMPARE_AS(Containers::arrayView(d.data), + Containers::arrayView(a.data), + TestSuite::Compare::Container); /* Implicit conversion is not allowed */ CORRADE_VERIFY(!std::is_convertible::value); @@ -348,8 +348,8 @@ void FrustumTest::data() { CORRADE_COMPARE(ca.data()[4], -1.0f); /* It actually returns an array */ - CORRADE_COMPARE(Corrade::Containers::arraySize(a.data()), 24); - CORRADE_COMPARE(Corrade::Containers::arraySize(ca.data()), 24); + CORRADE_COMPARE(Containers::arraySize(a.data()), 24); + CORRADE_COMPARE(Containers::arraySize(ca.data()), 24); } void FrustumTest::dataOutOfRange() { diff --git a/src/Magnum/Math/Test/FunctionsBatchTest.cpp b/src/Magnum/Math/Test/FunctionsBatchTest.cpp index 9f9516f58..588caefd9 100644 --- a/src/Magnum/Math/Test/FunctionsBatchTest.cpp +++ b/src/Magnum/Math/Test/FunctionsBatchTest.cpp @@ -33,7 +33,7 @@ namespace Magnum { namespace Math { namespace Test { namespace { -struct FunctionsBatchTest: Corrade::TestSuite::Tester { +struct FunctionsBatchTest: TestSuite::Tester { explicit FunctionsBatchTest(); void isInf(); @@ -93,7 +93,7 @@ void FunctionsBatchTest::isInf() { Vector2 c[]{{5.0f, -3.0f}, {-2.0f, 14.0f}, {Constants::inf(), -5.0f}}; CORRADE_COMPARE(Math::isInf(c), BitVector<2>{1}); /* Mutable view */ - CORRADE_COMPARE(Math::isInf(Corrade::Containers::StridedArrayView1D{c}), BitVector<2>{1}); + CORRADE_COMPARE(Math::isInf(Containers::StridedArrayView1D{c}), BitVector<2>{1}); /* This should work without explicit casts or types */ CORRADE_VERIFY(!Math::isInf(std::vector{5.0f, -2.0f, -1.0f})); @@ -125,7 +125,7 @@ void FunctionsBatchTest::isNan() { Vector2 c[]{{5.0f, -3.0f}, {14.0f, Constants::nan()}, {-2.0f, -5.0f}}; CORRADE_COMPARE(Math::isNan(c), BitVector<2>{2}); /* Mutable view */ - CORRADE_COMPARE(Math::isNan(Corrade::Containers::StridedArrayView1D{c}), BitVector<2>{2}); + CORRADE_COMPARE(Math::isNan(Containers::StridedArrayView1D{c}), BitVector<2>{2}); /* This should work without explicit casts or types */ CORRADE_VERIFY(!Math::isNan(std::vector{5.0f, -2.0f, -1.0f})); @@ -146,7 +146,7 @@ void FunctionsBatchTest::min() { CORRADE_COMPARE(Math::min(array), -2); /* Mutable view */ Int marray[]{5, -2, 9}; - CORRADE_COMPARE(Math::min(Corrade::Containers::StridedArrayView1D{marray}), -2); + CORRADE_COMPARE(Math::min(Containers::StridedArrayView1D{marray}), -2); /* This should work without explicit casts or types */ CORRADE_COMPARE(Math::min(std::vector{5, -2, 9}), -2); @@ -167,7 +167,7 @@ void FunctionsBatchTest::max() { CORRADE_COMPARE(Math::max(array), 9); /* Mutable view */ Int marray[]{5, -2, 9}; - CORRADE_COMPARE(Math::max(Corrade::Containers::StridedArrayView1D{marray}), 9); + CORRADE_COMPARE(Math::max(Containers::StridedArrayView1D{marray}), 9); /* This should work without explicit casts or types */ CORRADE_COMPARE(Math::max(std::vector{5, -2, 9}), 9); @@ -197,7 +197,7 @@ void FunctionsBatchTest::minmax() { CORRADE_COMPARE(Math::minmax(array), expected); /* Mutable view */ Float marray[]{-1.0f, 2.0f, -3.0f}; - CORRADE_COMPARE(Math::minmax(Corrade::Containers::StridedArrayView1D{marray}), expected); + CORRADE_COMPARE(Math::minmax(Containers::StridedArrayView1D{marray}), expected); /* This should work without explicit casts or types */ CORRADE_COMPARE(Math::minmax(std::vector{-1.0f, 2.0f, -3.0f}), expected); @@ -295,11 +295,11 @@ void FunctionsBatchTest::constIterable() { /* It shouldn't try to operate with a const type (such as trying to to assign to `std::pair`) internally, instead it should remove the const */ - CORRADE_COMPARE(Math::min(Corrade::Containers::arrayView(data)), + CORRADE_COMPARE(Math::min(Containers::arrayView(data)), (Vector2{-2, -5})); - CORRADE_COMPARE(Math::max(Corrade::Containers::stridedArrayView(data)), + CORRADE_COMPARE(Math::max(Containers::stridedArrayView(data)), (Vector2{9, 14})); - CORRADE_COMPARE(Math::minmax(Corrade::Containers::Array{data, 3, [](const Vector2*, std::size_t){}}), + CORRADE_COMPARE(Math::minmax(Containers::Array{data, 3, [](const Vector2*, std::size_t){}}), std::make_pair(Vector2{-2, -5}, Vector2{9, 14})); } diff --git a/src/Magnum/Math/Test/FunctionsBenchmark.cpp b/src/Magnum/Math/Test/FunctionsBenchmark.cpp index 631bfd51c..84fd6558f 100644 --- a/src/Magnum/Math/Test/FunctionsBenchmark.cpp +++ b/src/Magnum/Math/Test/FunctionsBenchmark.cpp @@ -34,7 +34,7 @@ namespace Magnum { namespace Math { namespace Test { namespace { -struct FunctionsBenchmark: Corrade::TestSuite::Tester { +struct FunctionsBenchmark: TestSuite::Tester { explicit FunctionsBenchmark(); void sqrt(); @@ -125,7 +125,7 @@ template void FunctionsBenchmark::sqrtInvertedFast() { setTestCaseTemplateName(TypeTraits::name()); CORRADE_COMPARE_WITH(Test::sqrtInvertedFast(T(25.0)), 1/T(5.0), - Corrade::TestSuite::Compare::around(T(0.0005))); + TestSuite::Compare::around(T(0.0005))); T a = T(1000000.0); @@ -134,7 +134,7 @@ template void FunctionsBenchmark::sqrtInvertedFast() { } CORRADE_COMPARE_WITH(a, T(1.0), - Corrade::TestSuite::Compare::around(T(0.002))); + TestSuite::Compare::around(T(0.002))); } #ifdef CORRADE_TARGET_SSE2 @@ -161,7 +161,7 @@ inline Float sqrtSseFromInverted(Float a) { void FunctionsBenchmark::sqrtSseFromInverted() { CORRADE_COMPARE_WITH(Test::sqrtSseFromInverted(25.0f), 5.0f, - Corrade::TestSuite::Compare::around(0.0005f)); + TestSuite::Compare::around(0.0005f)); Float a = 1000000.0f; @@ -170,7 +170,7 @@ void FunctionsBenchmark::sqrtSseFromInverted() { } CORRADE_COMPARE_WITH(a, 1.0f, - Corrade::TestSuite::Compare::around(0.0002f)); + TestSuite::Compare::around(0.0002f)); } inline Float sqrtInvertedSse(Float a) { @@ -179,7 +179,7 @@ inline Float sqrtInvertedSse(Float a) { void FunctionsBenchmark::sqrtInvertedSse() { CORRADE_COMPARE_WITH(Test::sqrtInvertedSse(25.0f), 1/5.0f, - Corrade::TestSuite::Compare::around(0.00002f)); + TestSuite::Compare::around(0.00002f)); Float a = 1000000.1f; @@ -188,7 +188,7 @@ void FunctionsBenchmark::sqrtInvertedSse() { } CORRADE_COMPARE_WITH(a, 1.0f, - Corrade::TestSuite::Compare::around(0.0003f)); + TestSuite::Compare::around(0.0003f)); } #endif @@ -200,7 +200,7 @@ void FunctionsBenchmark::sinCosSeparate() { a += 0.1f; } - CORRADE_COMPARE_AS(a, 10.0f, Corrade::TestSuite::Compare::Greater); + CORRADE_COMPARE_AS(a, 10.0f, TestSuite::Compare::Greater); /* To avoid the whole loop being optimized away */ CORRADE_VERIFY(sin == sin); @@ -216,7 +216,7 @@ void FunctionsBenchmark::sinCosCombined() { a += 0.1f; } - CORRADE_COMPARE_AS(a, 10.0f, Corrade::TestSuite::Compare::Greater); + CORRADE_COMPARE_AS(a, 10.0f, TestSuite::Compare::Greater); /* To avoid the whole loop being optimized away */ CORRADE_VERIFY(sin == sin); diff --git a/src/Magnum/Math/Test/FunctionsTest.cpp b/src/Magnum/Math/Test/FunctionsTest.cpp index 9b102fcc8..780fca20f 100644 --- a/src/Magnum/Math/Test/FunctionsTest.cpp +++ b/src/Magnum/Math/Test/FunctionsTest.cpp @@ -33,7 +33,7 @@ namespace Magnum { namespace Math { namespace Test { namespace { -struct FunctionsTest: Corrade::TestSuite::Tester { +struct FunctionsTest: TestSuite::Tester { explicit FunctionsTest(); template void popcount(); diff --git a/src/Magnum/Math/Test/HalfTest.cpp b/src/Magnum/Math/Test/HalfTest.cpp index 737cbb9c4..163595a36 100644 --- a/src/Magnum/Math/Test/HalfTest.cpp +++ b/src/Magnum/Math/Test/HalfTest.cpp @@ -40,7 +40,7 @@ namespace Magnum { namespace Math { namespace Test { namespace { -struct HalfTest: Corrade::TestSuite::Tester { +struct HalfTest: TestSuite::Tester { explicit HalfTest(); void unpack(); @@ -98,16 +98,16 @@ const struct { constexpr struct { const char* name; const char* data; - Corrade::Utility::TweakableState state; + Utility::TweakableState state; const char* error; } TweakableErrorData[] { - {"empty", "", Corrade::Utility::TweakableState::Recompile, + {"empty", "", Utility::TweakableState::Recompile, "Utility::TweakableParser: is not a half literal\n"}, - {"integral", "42_h", Corrade::Utility::TweakableState::Recompile, + {"integral", "42_h", Utility::TweakableState::Recompile, "Utility::TweakableParser: 42_h is not a half literal\n"}, - {"garbage after", "42.b_h", Corrade::Utility::TweakableState::Recompile, + {"garbage after", "42.b_h", Utility::TweakableState::Recompile, "Utility::TweakableParser: unexpected characters b_h after a half literal\n"}, - {"different suffix", "42.0u", Corrade::Utility::TweakableState::Recompile, /* not for double */ + {"different suffix", "42.0u", Utility::TweakableState::Recompile, /* not for double */ "Utility::TweakableParser: 42.0u has an unexpected suffix, expected _h\n"} }; #endif @@ -146,10 +146,10 @@ HalfTest::HalfTest() { #if defined(DOXYGEN_GENERATING_OUTPUT) || defined(CORRADE_TARGET_UNIX) || (defined(CORRADE_TARGET_WINDOWS) && !defined(CORRADE_TARGET_WINDOWS_RT)) || defined(CORRADE_TARGET_EMSCRIPTEN) addInstancedTests({&HalfTest::tweakable}, - Corrade::Containers::arraySize(TweakableData)); + Containers::arraySize(TweakableData)); addInstancedTests({&HalfTest::tweakableError}, - Corrade::Containers::arraySize(TweakableErrorData)); + Containers::arraySize(TweakableErrorData)); #endif } @@ -275,16 +275,16 @@ Float unpackNaive(UnsignedShort value) { UnsignedShort packTable(const Float value) { UnsignedShort out; packHalfInto( - Corrade::Containers::StridedArrayView2D{{&value, 1}, {1, 1}}, - Corrade::Containers::StridedArrayView2D{{&out, 1}, {1, 1}}); + Containers::StridedArrayView2D{{&value, 1}, {1, 1}}, + Containers::StridedArrayView2D{{&out, 1}, {1, 1}}); return out; } Float unpackTable(const UnsignedShort value) { Float out; unpackHalfInto( - Corrade::Containers::StridedArrayView2D{{&value, 1}, {1, 1}}, - Corrade::Containers::StridedArrayView2D{{&out, 1}, {1, 1}}); + Containers::StridedArrayView2D{{&value, 1}, {1, 1}}, + Containers::StridedArrayView2D{{&out, 1}, {1, 1}}); return out; } @@ -455,8 +455,8 @@ void HalfTest::pack1kTable() { src[i] = i*65; CORRADE_BENCHMARK(100) { - packHalfInto(Corrade::Containers::StridedArrayView2D{src, {1, 1000}}, - Corrade::Containers::StridedArrayView2D{dst, {1, 1000}}); + packHalfInto(Containers::StridedArrayView2D{src, {1, 1000}}, + Containers::StridedArrayView2D{dst, {1, 1000}}); } } @@ -487,8 +487,8 @@ void HalfTest::unpack1kTable() { src[i] = i*65; CORRADE_BENCHMARK(100) { - unpackHalfInto(Corrade::Containers::StridedArrayView2D{src, {1, 1000}}, - Corrade::Containers::StridedArrayView2D{dst, {1, 1000}}); + unpackHalfInto(Containers::StridedArrayView2D{src, {1, 1000}}, + Containers::StridedArrayView2D{dst, {1, 1000}}); } } @@ -638,8 +638,8 @@ void HalfTest::debug() { void HalfTest::tweakable() { auto&& data = TweakableData[testCaseInstanceId()]; setTestCaseDescription(data.name); - auto result = Corrade::Utility::TweakableParser::parse(data.data); - CORRADE_COMPARE(result.first(), Corrade::Utility::TweakableState::Success); + auto result = Utility::TweakableParser::parse(data.data); + CORRADE_COMPARE(result.first(), Utility::TweakableState::Success); CORRADE_COMPARE(result.second(), data.result); } @@ -650,7 +650,7 @@ void HalfTest::tweakableError() { std::ostringstream out; Warning redirectWarning{&out}; Error redirectError{&out}; - Corrade::Utility::TweakableState state = Corrade::Utility::TweakableParser::parse(data.data).first(); + Utility::TweakableState state = Utility::TweakableParser::parse(data.data).first(); CORRADE_COMPARE(out.str(), data.error); CORRADE_COMPARE(state, data.state); } diff --git a/src/Magnum/Math/Test/InterpolationBenchmark.cpp b/src/Magnum/Math/Test/InterpolationBenchmark.cpp index b715625a1..4b5804d64 100644 --- a/src/Magnum/Math/Test/InterpolationBenchmark.cpp +++ b/src/Magnum/Math/Test/InterpolationBenchmark.cpp @@ -33,7 +33,7 @@ namespace Magnum { namespace Math { namespace Test { namespace { -struct InterpolationBenchmark: Corrade::TestSuite::Tester { +struct InterpolationBenchmark: TestSuite::Tester { explicit InterpolationBenchmark(); void baseline(); diff --git a/src/Magnum/Math/Test/IntersectionBenchmark.cpp b/src/Magnum/Math/Test/IntersectionBenchmark.cpp index ad36d2c68..5e3e9cb8e 100644 --- a/src/Magnum/Math/Test/IntersectionBenchmark.cpp +++ b/src/Magnum/Math/Test/IntersectionBenchmark.cpp @@ -96,7 +96,7 @@ typedef Math::Range3D Range3D; typedef Math::Deg Deg; typedef Math::Rad Rad; -struct IntersectionBenchmark: Corrade::TestSuite::Tester { +struct IntersectionBenchmark: TestSuite::Tester { explicit IntersectionBenchmark(); void rangeFrustumNaive(); diff --git a/src/Magnum/Math/Test/IntersectionTest.cpp b/src/Magnum/Math/Test/IntersectionTest.cpp index 9a8094de8..47d5e3e96 100644 --- a/src/Magnum/Math/Test/IntersectionTest.cpp +++ b/src/Magnum/Math/Test/IntersectionTest.cpp @@ -35,7 +35,7 @@ namespace Magnum { namespace Math { namespace Test { namespace { using namespace Literals; -struct IntersectionTest: Corrade::TestSuite::Tester { +struct IntersectionTest: TestSuite::Tester { explicit IntersectionTest(); void pointCircle(); diff --git a/src/Magnum/Math/Test/Matrix3Test.cpp b/src/Magnum/Math/Test/Matrix3Test.cpp index b1dcadfbb..3ac4a3e76 100644 --- a/src/Magnum/Math/Test/Matrix3Test.cpp +++ b/src/Magnum/Math/Test/Matrix3Test.cpp @@ -57,7 +57,7 @@ template<> struct RectangularMatrixConverter<3, 3, float, Mat3> { namespace Test { namespace { -struct Matrix3Test: Corrade::TestSuite::Tester { +struct Matrix3Test: TestSuite::Tester { explicit Matrix3Test(); void construct(); diff --git a/src/Magnum/Math/Test/Matrix4Test.cpp b/src/Magnum/Math/Test/Matrix4Test.cpp index f27da2326..57b7a8e12 100644 --- a/src/Magnum/Math/Test/Matrix4Test.cpp +++ b/src/Magnum/Math/Test/Matrix4Test.cpp @@ -60,7 +60,7 @@ template<> struct RectangularMatrixConverter<4, 4, float, Mat4> { namespace Test { namespace { -struct Matrix4Test: Corrade::TestSuite::Tester { +struct Matrix4Test: TestSuite::Tester { explicit Matrix4Test(); void construct(); @@ -648,7 +648,7 @@ void Matrix4Test::lookAt() { CORRADE_COMPARE(dot(-a.backward(), (target - translation).normalized()), 1.0f); /* Up vector should be in the same direction as X axis */ - CORRADE_COMPARE_AS(dot(Vector3::xAxis(), a.up()), 0.0f, Corrade::TestSuite::Compare::Greater); + CORRADE_COMPARE_AS(dot(Vector3::xAxis(), a.up()), 0.0f, TestSuite::Compare::Greater); /* Just to be sure */ CORRADE_COMPARE(a, Matrix4({ 0.0f, 0.253247f, -0.967402f, 0.0f}, diff --git a/src/Magnum/Math/Test/MatrixBenchmark.cpp b/src/Magnum/Math/Test/MatrixBenchmark.cpp index 65c122637..ba01b1494 100644 --- a/src/Magnum/Math/Test/MatrixBenchmark.cpp +++ b/src/Magnum/Math/Test/MatrixBenchmark.cpp @@ -31,7 +31,7 @@ namespace Magnum { namespace Math { namespace Test { namespace { -struct MatrixBenchmark: Corrade::TestSuite::Tester { +struct MatrixBenchmark: TestSuite::Tester { explicit MatrixBenchmark(); void multiply3(); diff --git a/src/Magnum/Math/Test/MatrixTest.cpp b/src/Magnum/Math/Test/MatrixTest.cpp index 26fb04ec3..fb1c9f399 100644 --- a/src/Magnum/Math/Test/MatrixTest.cpp +++ b/src/Magnum/Math/Test/MatrixTest.cpp @@ -57,7 +57,7 @@ template<> struct RectangularMatrixConverter<3, 3, float, Mat3> { namespace Test { namespace { -struct MatrixTest: Corrade::TestSuite::Tester { +struct MatrixTest: TestSuite::Tester { explicit MatrixTest(); void construct(); diff --git a/src/Magnum/Math/Test/PackingBatchTest.cpp b/src/Magnum/Math/Test/PackingBatchTest.cpp index c87ea8a60..6c5398077 100644 --- a/src/Magnum/Math/Test/PackingBatchTest.cpp +++ b/src/Magnum/Math/Test/PackingBatchTest.cpp @@ -36,7 +36,7 @@ namespace Magnum { namespace Math { namespace Test { namespace { -struct PackingBatchTest: Corrade::TestSuite::Tester { +struct PackingBatchTest: TestSuite::Tester { explicit PackingBatchTest(); void unpackUnsignedByte(); @@ -184,15 +184,15 @@ void PackingBatchTest::unpackUnsignedByte() { {0.0f, 1.0f} }; - Corrade::Containers::StridedArrayView1D src{data, &data[0].src, 3, sizeof(Data)}; - Corrade::Containers::StridedArrayView1D dst{data, &data[0].dst, 3, sizeof(Data)}; - unpackInto(Corrade::Containers::arrayCast<2, UnsignedByte>(src), - Corrade::Containers::arrayCast<2, Float>(dst)); - CORRADE_COMPARE_AS(dst, Corrade::Containers::stridedArrayView(expected), - Corrade::TestSuite::Compare::Container); + Containers::StridedArrayView1D src{data, &data[0].src, 3, sizeof(Data)}; + Containers::StridedArrayView1D dst{data, &data[0].dst, 3, sizeof(Data)}; + unpackInto(Containers::arrayCast<2, UnsignedByte>(src), + Containers::arrayCast<2, Float>(dst)); + CORRADE_COMPARE_AS(dst, Containers::stridedArrayView(expected), + TestSuite::Compare::Container); /* Ensure the results are consistent with non-batch APIs */ - for(std::size_t i = 0; i != Corrade::Containers::arraySize(data); ++i) + for(std::size_t i = 0; i != Containers::arraySize(data); ++i) CORRADE_COMPARE(Math::unpack(data[i].src), data[i].dst); } @@ -213,15 +213,15 @@ void PackingBatchTest::unpackUnsignedShort() { {0.0f, 1.0f} }; - Corrade::Containers::StridedArrayView1D src{data, &data[0].src, 3, sizeof(Data)}; - Corrade::Containers::StridedArrayView1D dst{data, &data[0].dst, 3, sizeof(Data)}; - unpackInto(Corrade::Containers::arrayCast<2, UnsignedShort>(src), - Corrade::Containers::arrayCast<2, Float>(dst)); - CORRADE_COMPARE_AS(dst, Corrade::Containers::stridedArrayView(expected), - Corrade::TestSuite::Compare::Container); + Containers::StridedArrayView1D src{data, &data[0].src, 3, sizeof(Data)}; + Containers::StridedArrayView1D dst{data, &data[0].dst, 3, sizeof(Data)}; + unpackInto(Containers::arrayCast<2, UnsignedShort>(src), + Containers::arrayCast<2, Float>(dst)); + CORRADE_COMPARE_AS(dst, Containers::stridedArrayView(expected), + TestSuite::Compare::Container); /* Ensure the results are consistent with non-batch APIs */ - for(std::size_t i = 0; i != Corrade::Containers::arraySize(data); ++i) + for(std::size_t i = 0; i != Containers::arraySize(data); ++i) CORRADE_COMPARE(Math::unpack(data[i].src), data[i].dst); } @@ -242,15 +242,15 @@ void PackingBatchTest::unpackSignedByte() { {-1.0f, -1.0f} }; - Corrade::Containers::StridedArrayView1D src{data, &data[0].src, 3, sizeof(Data)}; - Corrade::Containers::StridedArrayView1D dst{data, &data[0].dst, 3, sizeof(Data)}; - unpackInto(Corrade::Containers::arrayCast<2, Byte>(src), - Corrade::Containers::arrayCast<2, Float>(dst)); - CORRADE_COMPARE_AS(dst, Corrade::Containers::stridedArrayView(expected), - Corrade::TestSuite::Compare::Container); + Containers::StridedArrayView1D src{data, &data[0].src, 3, sizeof(Data)}; + Containers::StridedArrayView1D dst{data, &data[0].dst, 3, sizeof(Data)}; + unpackInto(Containers::arrayCast<2, Byte>(src), + Containers::arrayCast<2, Float>(dst)); + CORRADE_COMPARE_AS(dst, Containers::stridedArrayView(expected), + TestSuite::Compare::Container); /* Ensure the results are consistent with non-batch APIs */ - for(std::size_t i = 0; i != Corrade::Containers::arraySize(data); ++i) + for(std::size_t i = 0; i != Containers::arraySize(data); ++i) CORRADE_COMPARE(Math::unpack(data[i].src), data[i].dst); } @@ -271,15 +271,15 @@ void PackingBatchTest::unpackSignedShort() { {-1.0f, -1.0f} }; - Corrade::Containers::StridedArrayView1D src{data, &data[0].src, 3, sizeof(Data)}; - Corrade::Containers::StridedArrayView1D dst{data, &data[0].dst, 3, sizeof(Data)}; - unpackInto(Corrade::Containers::arrayCast<2, Short>(src), - Corrade::Containers::arrayCast<2, Float>(dst)); - CORRADE_COMPARE_AS(dst, Corrade::Containers::stridedArrayView(expected), - Corrade::TestSuite::Compare::Container); + Containers::StridedArrayView1D src{data, &data[0].src, 3, sizeof(Data)}; + Containers::StridedArrayView1D dst{data, &data[0].dst, 3, sizeof(Data)}; + unpackInto(Containers::arrayCast<2, Short>(src), + Containers::arrayCast<2, Float>(dst)); + CORRADE_COMPARE_AS(dst, Containers::stridedArrayView(expected), + TestSuite::Compare::Container); /* Ensure the results are consistent with non-batch APIs */ - for(std::size_t i = 0; i != Corrade::Containers::arraySize(data); ++i) + for(std::size_t i = 0; i != Containers::arraySize(data); ++i) CORRADE_COMPARE(Math::unpack(data[i].src), data[i].dst); } @@ -300,15 +300,15 @@ void PackingBatchTest::packUnsignedByte() { {255, 255} }; - Corrade::Containers::StridedArrayView1D src{data, &data[0].src, 3, sizeof(Data)}; - Corrade::Containers::StridedArrayView1D dst{data, &data[0].dst, 3, sizeof(Data)}; - packInto(Corrade::Containers::arrayCast<2, Float>(src), - Corrade::Containers::arrayCast<2, UnsignedByte>(dst)); - CORRADE_COMPARE_AS(dst, Corrade::Containers::stridedArrayView(expected), - Corrade::TestSuite::Compare::Container); + Containers::StridedArrayView1D src{data, &data[0].src, 3, sizeof(Data)}; + Containers::StridedArrayView1D dst{data, &data[0].dst, 3, sizeof(Data)}; + packInto(Containers::arrayCast<2, Float>(src), + Containers::arrayCast<2, UnsignedByte>(dst)); + CORRADE_COMPARE_AS(dst, Containers::stridedArrayView(expected), + TestSuite::Compare::Container); /* Ensure the results are consistent with non-batch APIs */ - for(std::size_t i = 0; i != Corrade::Containers::arraySize(data); ++i) + for(std::size_t i = 0; i != Containers::arraySize(data); ++i) CORRADE_COMPARE(Math::pack(data[i].src), data[i].dst); } @@ -329,15 +329,15 @@ void PackingBatchTest::packUnsignedShort() { {65535, 65535} }; - Corrade::Containers::StridedArrayView1D src{data, &data[0].src, 3, sizeof(Data)}; - Corrade::Containers::StridedArrayView1D dst{data, &data[0].dst, 3, sizeof(Data)}; - packInto(Corrade::Containers::arrayCast<2, Float>(src), - Corrade::Containers::arrayCast<2, UnsignedShort>(dst)); - CORRADE_COMPARE_AS(dst, Corrade::Containers::stridedArrayView(expected), - Corrade::TestSuite::Compare::Container); + Containers::StridedArrayView1D src{data, &data[0].src, 3, sizeof(Data)}; + Containers::StridedArrayView1D dst{data, &data[0].dst, 3, sizeof(Data)}; + packInto(Containers::arrayCast<2, Float>(src), + Containers::arrayCast<2, UnsignedShort>(dst)); + CORRADE_COMPARE_AS(dst, Containers::stridedArrayView(expected), + TestSuite::Compare::Container); /* Ensure the results are consistent with non-batch APIs */ - for(std::size_t i = 0; i != Corrade::Containers::arraySize(data); ++i) + for(std::size_t i = 0; i != Containers::arraySize(data); ++i) CORRADE_COMPARE(Math::pack(data[i].src), data[i].dst); } @@ -358,15 +358,15 @@ void PackingBatchTest::packSignedByte() { {127, 127} }; - Corrade::Containers::StridedArrayView1D src{data, &data[0].src, 3, sizeof(Data)}; - Corrade::Containers::StridedArrayView1D dst{data, &data[0].dst, 3, sizeof(Data)}; - packInto(Corrade::Containers::arrayCast<2, Float>(src), - Corrade::Containers::arrayCast<2, Byte>(dst)); - CORRADE_COMPARE_AS(dst, Corrade::Containers::stridedArrayView(expected), - Corrade::TestSuite::Compare::Container); + Containers::StridedArrayView1D src{data, &data[0].src, 3, sizeof(Data)}; + Containers::StridedArrayView1D dst{data, &data[0].dst, 3, sizeof(Data)}; + packInto(Containers::arrayCast<2, Float>(src), + Containers::arrayCast<2, Byte>(dst)); + CORRADE_COMPARE_AS(dst, Containers::stridedArrayView(expected), + TestSuite::Compare::Container); /* Ensure the results are consistent with non-batch APIs */ - for(std::size_t i = 0; i != Corrade::Containers::arraySize(data); ++i) + for(std::size_t i = 0; i != Containers::arraySize(data); ++i) CORRADE_COMPARE(Math::pack(data[i].src), data[i].dst); } @@ -387,15 +387,15 @@ void PackingBatchTest::packSignedShort() { {32767, 32767} }; - Corrade::Containers::StridedArrayView1D src{data, &data[0].src, 3, sizeof(Data)}; - Corrade::Containers::StridedArrayView1D dst{data, &data[0].dst, 3, sizeof(Data)}; - packInto(Corrade::Containers::arrayCast<2, Float>(src), - Corrade::Containers::arrayCast<2, Short>(dst)); - CORRADE_COMPARE_AS(dst, Corrade::Containers::stridedArrayView(expected), - Corrade::TestSuite::Compare::Container); + Containers::StridedArrayView1D src{data, &data[0].src, 3, sizeof(Data)}; + Containers::StridedArrayView1D dst{data, &data[0].dst, 3, sizeof(Data)}; + packInto(Containers::arrayCast<2, Float>(src), + Containers::arrayCast<2, Short>(dst)); + CORRADE_COMPARE_AS(dst, Containers::stridedArrayView(expected), + TestSuite::Compare::Container); /* Ensure the results are consistent with non-batch APIs */ - for(std::size_t i = 0; i != Corrade::Containers::arraySize(data); ++i) + for(std::size_t i = 0; i != Containers::arraySize(data); ++i) CORRADE_COMPARE(Math::pack(data[i].src), data[i].dst); } @@ -418,17 +418,17 @@ void PackingBatchTest::unpackHalf() { {-Constants::inf(), +Constants::inf()} }; - Corrade::Containers::StridedArrayView1D src{data, &data[0].src, - Corrade::Containers::arraySize(data), sizeof(Data)}; - Corrade::Containers::StridedArrayView1D dst{data, &data[0].dst, - Corrade::Containers::arraySize(data), sizeof(Data)}; - unpackHalfInto(Corrade::Containers::arrayCast<2, UnsignedShort>(src), - Corrade::Containers::arrayCast<2, Float>(dst)); - CORRADE_COMPARE_AS(dst, Corrade::Containers::stridedArrayView(expected), - Corrade::TestSuite::Compare::Container); + Containers::StridedArrayView1D src{data, &data[0].src, + Containers::arraySize(data), sizeof(Data)}; + Containers::StridedArrayView1D dst{data, &data[0].dst, + Containers::arraySize(data), sizeof(Data)}; + unpackHalfInto(Containers::arrayCast<2, UnsignedShort>(src), + Containers::arrayCast<2, Float>(dst)); + CORRADE_COMPARE_AS(dst, Containers::stridedArrayView(expected), + TestSuite::Compare::Container); /* Ensure the results are consistent with non-batch APIs */ - for(std::size_t i = 0; i != Corrade::Containers::arraySize(data); ++i) + for(std::size_t i = 0; i != Containers::arraySize(data); ++i) CORRADE_COMPARE(Math::unpackHalf(data[i].src), data[i].dst); } @@ -451,17 +451,17 @@ void PackingBatchTest::packHalf() { {0xfc00, 0x7c00} }; - Corrade::Containers::StridedArrayView1D src{data, &data[0].src, - Corrade::Containers::arraySize(data), sizeof(Data)}; - Corrade::Containers::StridedArrayView1D dst{data, &data[0].dst, - Corrade::Containers::arraySize(data), sizeof(Data)}; - packHalfInto(Corrade::Containers::arrayCast<2, Float>(src), - Corrade::Containers::arrayCast<2, UnsignedShort>(dst)); - CORRADE_COMPARE_AS(dst, Corrade::Containers::stridedArrayView(expected), - Corrade::TestSuite::Compare::Container); + Containers::StridedArrayView1D src{data, &data[0].src, + Containers::arraySize(data), sizeof(Data)}; + Containers::StridedArrayView1D dst{data, &data[0].dst, + Containers::arraySize(data), sizeof(Data)}; + packHalfInto(Containers::arrayCast<2, Float>(src), + Containers::arrayCast<2, UnsignedShort>(dst)); + CORRADE_COMPARE_AS(dst, Containers::stridedArrayView(expected), + TestSuite::Compare::Container); /* Ensure the results are consistent with non-batch APIs */ - for(std::size_t i = 0; i != Corrade::Containers::arraySize(data); ++i) + for(std::size_t i = 0; i != Containers::arraySize(data); ++i) CORRADE_COMPARE(Math::packHalf(data[i].src), data[i].dst); } @@ -491,18 +491,18 @@ template void PackingBatchTest::castUnsigne {13, 255} }; - Corrade::Containers::StridedArrayView1D> src{data, &data[0].src, 3, sizeof(Data)}; - Corrade::Containers::StridedArrayView1D> dst{data, &data[0].dst, 3, sizeof(Data)}; - castInto(Corrade::Containers::arrayCast<2, Integral>(src), - Corrade::Containers::arrayCast<2, FloatingPoint>(dst)); - CORRADE_COMPARE_AS(dst, Corrade::Containers::stridedArrayView(expectedFloatingPoint), - Corrade::TestSuite::Compare::Container); + Containers::StridedArrayView1D> src{data, &data[0].src, 3, sizeof(Data)}; + Containers::StridedArrayView1D> dst{data, &data[0].dst, 3, sizeof(Data)}; + castInto(Containers::arrayCast<2, Integral>(src), + Containers::arrayCast<2, FloatingPoint>(dst)); + CORRADE_COMPARE_AS(dst, Containers::stridedArrayView(expectedFloatingPoint), + TestSuite::Compare::Container); /* Test the other way around as well */ - castInto(Corrade::Containers::arrayCast<2, FloatingPoint>(dst), - Corrade::Containers::arrayCast<2, Integral>(src)); - CORRADE_COMPARE_AS(src, Corrade::Containers::stridedArrayView(expectedIntegral), - Corrade::TestSuite::Compare::Container); + castInto(Containers::arrayCast<2, FloatingPoint>(dst), + Containers::arrayCast<2, Integral>(src)); + CORRADE_COMPARE_AS(src, Containers::stridedArrayView(expectedIntegral), + TestSuite::Compare::Container); } template void PackingBatchTest::castSignedFloatingPoint() { @@ -531,18 +531,18 @@ template void PackingBatchTest::castSignedF {13, 127} }; - Corrade::Containers::StridedArrayView1D> src{data, &data[0].src, 3, sizeof(Data)}; - Corrade::Containers::StridedArrayView1D> dst{data, &data[0].dst, 3, sizeof(Data)}; - castInto(Corrade::Containers::arrayCast<2, Integral>(src), - Corrade::Containers::arrayCast<2, FloatingPoint>(dst)); - CORRADE_COMPARE_AS(dst, Corrade::Containers::stridedArrayView(expectedFloatingPoint), - Corrade::TestSuite::Compare::Container); + Containers::StridedArrayView1D> src{data, &data[0].src, 3, sizeof(Data)}; + Containers::StridedArrayView1D> dst{data, &data[0].dst, 3, sizeof(Data)}; + castInto(Containers::arrayCast<2, Integral>(src), + Containers::arrayCast<2, FloatingPoint>(dst)); + CORRADE_COMPARE_AS(dst, Containers::stridedArrayView(expectedFloatingPoint), + TestSuite::Compare::Container); /* Test the other way around as well */ - castInto(Corrade::Containers::arrayCast<2, FloatingPoint>(dst), - Corrade::Containers::arrayCast<2, Integral>(src)); - CORRADE_COMPARE_AS(src, Corrade::Containers::stridedArrayView(expectedIntegral), - Corrade::TestSuite::Compare::Container); + castInto(Containers::arrayCast<2, FloatingPoint>(dst), + Containers::arrayCast<2, Integral>(src)); + CORRADE_COMPARE_AS(src, Containers::stridedArrayView(expectedIntegral), + TestSuite::Compare::Container); } template void PackingBatchTest::castUnsignedInteger() { @@ -569,18 +569,18 @@ template void PackingBatchTest::castUnsignedInteger() { {13, 255} }; - Corrade::Containers::StridedArrayView1D> src{data, &data[0].src, 3, sizeof(Data)}; - Corrade::Containers::StridedArrayView1D> dst{data, &data[0].dst, 3, sizeof(Data)}; - castInto(Corrade::Containers::arrayCast<2, T>(src), - Corrade::Containers::arrayCast<2, U>(dst)); - CORRADE_COMPARE_AS(dst, Corrade::Containers::stridedArrayView(expectedTargetType), - Corrade::TestSuite::Compare::Container); + Containers::StridedArrayView1D> src{data, &data[0].src, 3, sizeof(Data)}; + Containers::StridedArrayView1D> dst{data, &data[0].dst, 3, sizeof(Data)}; + castInto(Containers::arrayCast<2, T>(src), + Containers::arrayCast<2, U>(dst)); + CORRADE_COMPARE_AS(dst, Containers::stridedArrayView(expectedTargetType), + TestSuite::Compare::Container); /* Test the other way around as well */ - castInto(Corrade::Containers::arrayCast<2, U>(dst), - Corrade::Containers::arrayCast<2, T>(src)); - CORRADE_COMPARE_AS(src, Corrade::Containers::stridedArrayView(expectedOriginalType), - Corrade::TestSuite::Compare::Container); + castInto(Containers::arrayCast<2, U>(dst), + Containers::arrayCast<2, T>(src)); + CORRADE_COMPARE_AS(src, Containers::stridedArrayView(expectedOriginalType), + TestSuite::Compare::Container); } template void PackingBatchTest::castSignedInteger() { @@ -607,18 +607,18 @@ template void PackingBatchTest::castSignedInteger() { {13, 127} }; - Corrade::Containers::StridedArrayView1D> src{data, &data[0].src, 3, sizeof(Data)}; - Corrade::Containers::StridedArrayView1D> dst{data, &data[0].dst, 3, sizeof(Data)}; - castInto(Corrade::Containers::arrayCast<2, T>(src), - Corrade::Containers::arrayCast<2, U>(dst)); - CORRADE_COMPARE_AS(dst, Corrade::Containers::stridedArrayView(expectedTargetType), - Corrade::TestSuite::Compare::Container); + Containers::StridedArrayView1D> src{data, &data[0].src, 3, sizeof(Data)}; + Containers::StridedArrayView1D> dst{data, &data[0].dst, 3, sizeof(Data)}; + castInto(Containers::arrayCast<2, T>(src), + Containers::arrayCast<2, U>(dst)); + CORRADE_COMPARE_AS(dst, Containers::stridedArrayView(expectedTargetType), + TestSuite::Compare::Container); /* Test the other way around as well */ - castInto(Corrade::Containers::arrayCast<2, U>(dst), - Corrade::Containers::arrayCast<2, T>(src)); - CORRADE_COMPARE_AS(src, Corrade::Containers::stridedArrayView(expectedOriginalType), - Corrade::TestSuite::Compare::Container); + castInto(Containers::arrayCast<2, U>(dst), + Containers::arrayCast<2, T>(src)); + CORRADE_COMPARE_AS(src, Containers::stridedArrayView(expectedOriginalType), + TestSuite::Compare::Container); } template void PackingBatchTest::castFloatDouble() { @@ -643,18 +643,18 @@ template void PackingBatchTest::castFloatDouble() { {T(13.0), T(127.5)} }; - Corrade::Containers::StridedArrayView1D> src{data, &data[0].src, 3, sizeof(Data)}; - Corrade::Containers::StridedArrayView1D> dst{data, &data[0].dst, 3, sizeof(Data)}; - castInto(Corrade::Containers::arrayCast<2, T>(src), - Corrade::Containers::arrayCast<2, U>(dst)); - CORRADE_COMPARE_AS(dst, Corrade::Containers::stridedArrayView(expectedTargetType), - Corrade::TestSuite::Compare::Container); + Containers::StridedArrayView1D> src{data, &data[0].src, 3, sizeof(Data)}; + Containers::StridedArrayView1D> dst{data, &data[0].dst, 3, sizeof(Data)}; + castInto(Containers::arrayCast<2, T>(src), + Containers::arrayCast<2, U>(dst)); + CORRADE_COMPARE_AS(dst, Containers::stridedArrayView(expectedTargetType), + TestSuite::Compare::Container); /* Test the other way around as well */ - castInto(Corrade::Containers::arrayCast<2, U>(dst), - Corrade::Containers::arrayCast<2, T>(src)); - CORRADE_COMPARE_AS(src, Corrade::Containers::stridedArrayView(expectedOriginalType), - Corrade::TestSuite::Compare::Container); + castInto(Containers::arrayCast<2, U>(dst), + Containers::arrayCast<2, T>(src)); + CORRADE_COMPARE_AS(src, Containers::stridedArrayView(expectedOriginalType), + TestSuite::Compare::Container); } template void PackingBatchTest::assertionsPackUnpack() { @@ -667,18 +667,18 @@ template void PackingBatchTest::assertionsPackUnpack() { Vector3 resultWrongVectorSize[2]{}; Vector4 resultNonContiguous[2]{}; - auto src = Corrade::Containers::arrayCast<2, T>( - Corrade::Containers::arrayView(data)); - auto srcNonContiguous = Corrade::Containers::arrayCast<2, T>( - Corrade::Containers::arrayView(dataNonContiguous)).every({1, 2}); - auto dst = Corrade::Containers::arrayCast<2, Float>( - Corrade::Containers::arrayView(result)); - auto dstWrongCount = Corrade::Containers::arrayCast<2, Float>( - Corrade::Containers::arrayView(resultWrongCount)); - auto dstWrongVectorSize = Corrade::Containers::arrayCast<2, Float>( - Corrade::Containers::arrayView(resultWrongVectorSize)); - auto dstNotContiguous = Corrade::Containers::arrayCast<2, Float>( - Corrade::Containers::arrayView(resultNonContiguous)).every({1, 2}); + auto src = Containers::arrayCast<2, T>( + Containers::arrayView(data)); + auto srcNonContiguous = Containers::arrayCast<2, T>( + Containers::arrayView(dataNonContiguous)).every({1, 2}); + auto dst = Containers::arrayCast<2, Float>( + Containers::arrayView(result)); + auto dstWrongCount = Containers::arrayCast<2, Float>( + Containers::arrayView(resultWrongCount)); + auto dstWrongVectorSize = Containers::arrayCast<2, Float>( + Containers::arrayView(resultWrongVectorSize)); + auto dstNotContiguous = Containers::arrayCast<2, Float>( + Containers::arrayView(resultNonContiguous)).every({1, 2}); std::ostringstream out; Error redirectError{&out}; @@ -711,18 +711,18 @@ void PackingBatchTest::assertionsPackUnpackHalf() { Vector3 resultWrongVectorSize[2]{}; Vector4 resultNonContiguous[2]{}; - auto src = Corrade::Containers::arrayCast<2, UnsignedShort>( - Corrade::Containers::arrayView(data)); - auto srcNonContiguous = Corrade::Containers::arrayCast<2, UnsignedShort>( - Corrade::Containers::arrayView(dataNonContiguous)).every({1, 2}); - auto dst = Corrade::Containers::arrayCast<2, Float>( - Corrade::Containers::arrayView(result)); - auto dstWrongCount = Corrade::Containers::arrayCast<2, Float>( - Corrade::Containers::arrayView(resultWrongCount)); - auto dstWrongVectorSize = Corrade::Containers::arrayCast<2, Float>( - Corrade::Containers::arrayView(resultWrongVectorSize)); - auto dstNotContiguous = Corrade::Containers::arrayCast<2, Float>( - Corrade::Containers::arrayView(resultNonContiguous)).every({1, 2}); + auto src = Containers::arrayCast<2, UnsignedShort>( + Containers::arrayView(data)); + auto srcNonContiguous = Containers::arrayCast<2, UnsignedShort>( + Containers::arrayView(dataNonContiguous)).every({1, 2}); + auto dst = Containers::arrayCast<2, Float>( + Containers::arrayView(result)); + auto dstWrongCount = Containers::arrayCast<2, Float>( + Containers::arrayView(resultWrongCount)); + auto dstWrongVectorSize = Containers::arrayCast<2, Float>( + Containers::arrayView(resultWrongVectorSize)); + auto dstNotContiguous = Containers::arrayCast<2, Float>( + Containers::arrayView(resultNonContiguous)).every({1, 2}); std::ostringstream out; Error redirectError{&out}; @@ -755,14 +755,14 @@ template void PackingBatchTest::assertionsCast() { Math::Vector3 resultWrongVectorSize[2]{}; Math::Vector4 resultNonContiguous[2]{}; - auto src = Corrade::Containers::arrayCast<2, T>( - Corrade::Containers::arrayView(data)); - auto dstWrongCount = Corrade::Containers::arrayCast<2, U>( - Corrade::Containers::arrayView(resultWrongCount)); - auto dstWrongVectorSize = Corrade::Containers::arrayCast<2, U>( - Corrade::Containers::arrayView(resultWrongVectorSize)); - auto dstNotContiguous = Corrade::Containers::arrayCast<2, U>( - Corrade::Containers::arrayView(resultNonContiguous)).every({1, 2}); + auto src = Containers::arrayCast<2, T>( + Containers::arrayView(data)); + auto dstWrongCount = Containers::arrayCast<2, U>( + Containers::arrayView(resultWrongCount)); + auto dstWrongVectorSize = Containers::arrayCast<2, U>( + Containers::arrayView(resultWrongVectorSize)); + auto dstNotContiguous = Containers::arrayCast<2, U>( + Containers::arrayView(resultNonContiguous)).every({1, 2}); std::ostringstream out; Error redirectError{&out}; diff --git a/src/Magnum/Math/Test/PackingTest.cpp b/src/Magnum/Math/Test/PackingTest.cpp index 6d2bf6974..437253b60 100644 --- a/src/Magnum/Math/Test/PackingTest.cpp +++ b/src/Magnum/Math/Test/PackingTest.cpp @@ -31,7 +31,7 @@ namespace Magnum { namespace Math { namespace Test { namespace { -struct PackingTest: Corrade::TestSuite::Tester { +struct PackingTest: TestSuite::Tester { explicit PackingTest(); void bitMax(); diff --git a/src/Magnum/Math/Test/QuaternionTest.cpp b/src/Magnum/Math/Test/QuaternionTest.cpp index 4e892d305..ee2938a75 100644 --- a/src/Magnum/Math/Test/QuaternionTest.cpp +++ b/src/Magnum/Math/Test/QuaternionTest.cpp @@ -55,7 +55,7 @@ template<> struct QuaternionConverter { namespace Test { namespace { -struct QuaternionTest: Corrade::TestSuite::Tester { +struct QuaternionTest: TestSuite::Tester { explicit QuaternionTest(); void construct(); @@ -350,8 +350,8 @@ void QuaternionTest::data() { CORRADE_COMPARE(ca.data()[1], 2.0f); /* It actually returns an array */ - CORRADE_COMPARE(Corrade::Containers::arraySize(a.data()), 4); - CORRADE_COMPARE(Corrade::Containers::arraySize(ca.data()), 4); + CORRADE_COMPARE(Containers::arraySize(a.data()), 4); + CORRADE_COMPARE(Containers::arraySize(ca.data()), 4); } void QuaternionTest::compare() { @@ -554,9 +554,9 @@ void QuaternionTest::angle() { /* Same / opposite. Well, almost. It's interesting how imprecise normalization can get. */ CORRADE_COMPARE_WITH(Math::halfAngle(a, a), 0.0_radf, - Corrade::TestSuite::Compare::around(0.0005_radf)); + TestSuite::Compare::around(0.0005_radf)); CORRADE_COMPARE_WITH(Math::halfAngle(a, -a), 180.0_degf, - Corrade::TestSuite::Compare::around(0.0005_radf)); + TestSuite::Compare::around(0.0005_radf)); /* Trivial case, to verify it's actually returning the right value (hah) */ CORRADE_COMPARE(Math::halfAngle( @@ -601,36 +601,36 @@ void QuaternionTest::matrix() { CORRADE_COMPARE((-q).toMatrix(), m); /* Trace > 0 */ - CORRADE_COMPARE_AS(m.trace(), 0.0f, Corrade::TestSuite::Compare::Greater); + CORRADE_COMPARE_AS(m.trace(), 0.0f, TestSuite::Compare::Greater); CORRADE_COMPARE(Quaternion::fromMatrix(m), q); /* Trace < 0, max is diagonal[2] */ Matrix3x3 m2 = Matrix4::rotation(130.0_degf, axis).rotationScaling(); Quaternion q2 = Quaternion::rotation(130.0_degf, axis); - CORRADE_COMPARE_AS(m2.trace(), 0.0f, Corrade::TestSuite::Compare::Less); + CORRADE_COMPARE_AS(m2.trace(), 0.0f, TestSuite::Compare::Less); CORRADE_COMPARE_AS(m2.diagonal()[2], Math::max(m2.diagonal()[0], m2.diagonal()[1]), - Corrade::TestSuite::Compare::Greater); + TestSuite::Compare::Greater); CORRADE_COMPARE(Quaternion::fromMatrix(m2), q2); /* Trace < 0, max is diagonal[1] */ Vector3 axis2 = Vector3(-3.0f, 5.0f, 1.0f).normalized(); Matrix3x3 m3 = Matrix4::rotation(130.0_degf, axis2).rotationScaling(); Quaternion q3 = Quaternion::rotation(130.0_degf, axis2); - CORRADE_COMPARE_AS(m3.trace(), 0.0f, Corrade::TestSuite::Compare::Less); + CORRADE_COMPARE_AS(m3.trace(), 0.0f, TestSuite::Compare::Less); CORRADE_COMPARE_AS(m3.diagonal()[1], Math::max(m3.diagonal()[0], m3.diagonal()[2]), - Corrade::TestSuite::Compare::Greater); + TestSuite::Compare::Greater); CORRADE_COMPARE(Quaternion::fromMatrix(m3), q3); /* Trace < 0, max is diagonal[0] */ Vector3 axis3 = Vector3(5.0f, -3.0f, 1.0f).normalized(); Matrix3x3 m4 = Matrix4::rotation(130.0_degf, axis3).rotationScaling(); Quaternion q4 = Quaternion::rotation(130.0_degf, axis3); - CORRADE_COMPARE_AS(m4.trace(), 0.0f, Corrade::TestSuite::Compare::Less); + CORRADE_COMPARE_AS(m4.trace(), 0.0f, TestSuite::Compare::Less); CORRADE_COMPARE_AS(m4.diagonal()[0], Math::max(m4.diagonal()[1], m4.diagonal()[2]), - Corrade::TestSuite::Compare::Greater); + TestSuite::Compare::Greater); CORRADE_COMPARE(Quaternion::fromMatrix(m4), q4); /* One reflection is bad (asserts in the test below), but two are fine */ diff --git a/src/Magnum/Math/Test/RangeTest.cpp b/src/Magnum/Math/Test/RangeTest.cpp index b29635465..76e4bd3b2 100644 --- a/src/Magnum/Math/Test/RangeTest.cpp +++ b/src/Magnum/Math/Test/RangeTest.cpp @@ -96,7 +96,7 @@ template<> struct RangeConverter<3, Float, Box> { namespace Test { namespace { -struct RangeTest: Corrade::TestSuite::Tester { +struct RangeTest: TestSuite::Tester { explicit RangeTest(); void construct(); @@ -460,12 +460,12 @@ void RangeTest::data() { CORRADE_COMPARE(ccube.data()[2], -17); /* It actually returns an array */ - CORRADE_COMPARE(Corrade::Containers::arraySize(line.data()), 2); - CORRADE_COMPARE(Corrade::Containers::arraySize(cline.data()), 2); - CORRADE_COMPARE(Corrade::Containers::arraySize(rect.data()), 4); - CORRADE_COMPARE(Corrade::Containers::arraySize(crect.data()), 4); - CORRADE_COMPARE(Corrade::Containers::arraySize(cube.data()), 6); - CORRADE_COMPARE(Corrade::Containers::arraySize(ccube.data()), 6); + CORRADE_COMPARE(Containers::arraySize(line.data()), 2); + CORRADE_COMPARE(Containers::arraySize(cline.data()), 2); + CORRADE_COMPARE(Containers::arraySize(rect.data()), 4); + CORRADE_COMPARE(Containers::arraySize(crect.data()), 4); + CORRADE_COMPARE(Containers::arraySize(cube.data()), 6); + CORRADE_COMPARE(Containers::arraySize(ccube.data()), 6); } void RangeTest::access() { diff --git a/src/Magnum/Math/Test/RectangularMatrixTest.cpp b/src/Magnum/Math/Test/RectangularMatrixTest.cpp index da21f7387..96c53681e 100644 --- a/src/Magnum/Math/Test/RectangularMatrixTest.cpp +++ b/src/Magnum/Math/Test/RectangularMatrixTest.cpp @@ -55,7 +55,7 @@ template<> struct RectangularMatrixConverter<2, 3, Float, Mat2x3> { namespace Test { namespace { -struct RectangularMatrixTest: Corrade::TestSuite::Tester { +struct RectangularMatrixTest: TestSuite::Tester { explicit RectangularMatrixTest(); void construct(); @@ -438,8 +438,8 @@ void RectangularMatrixTest::data() { CORRADE_COMPARE(ca.data()[1], 5.0f); /* It actually returns an array */ - CORRADE_COMPARE(Corrade::Containers::arraySize(a.data()), 12); - CORRADE_COMPARE(Corrade::Containers::arraySize(ca.data()), 12); + CORRADE_COMPARE(Containers::arraySize(a.data()), 12); + CORRADE_COMPARE(Containers::arraySize(ca.data()), 12); } void RectangularMatrixTest::row() { diff --git a/src/Magnum/Math/Test/StrictWeakOrderingTest.cpp b/src/Magnum/Math/Test/StrictWeakOrderingTest.cpp index 7bfd122e7..96d7eda0e 100644 --- a/src/Magnum/Math/Test/StrictWeakOrderingTest.cpp +++ b/src/Magnum/Math/Test/StrictWeakOrderingTest.cpp @@ -37,7 +37,7 @@ namespace std { namespace Magnum { namespace Math { namespace Test { namespace { -struct StrictWeakOrderingTest: Corrade::TestSuite::Tester { +struct StrictWeakOrderingTest: TestSuite::Tester { explicit StrictWeakOrderingTest(); void base(); diff --git a/src/Magnum/Math/Test/SwizzleTest.cpp b/src/Magnum/Math/Test/SwizzleTest.cpp index 10e70230c..cb6236727 100644 --- a/src/Magnum/Math/Test/SwizzleTest.cpp +++ b/src/Magnum/Math/Test/SwizzleTest.cpp @@ -29,7 +29,7 @@ namespace Magnum { namespace Math { namespace Test { namespace { -struct SwizzleTest: Corrade::TestSuite::Tester { +struct SwizzleTest: TestSuite::Tester { explicit SwizzleTest(); void gather(); diff --git a/src/Magnum/Math/Test/TagsTest.cpp b/src/Magnum/Math/Test/TagsTest.cpp index 83a154aab..d75cc9b6c 100644 --- a/src/Magnum/Math/Test/TagsTest.cpp +++ b/src/Magnum/Math/Test/TagsTest.cpp @@ -25,11 +25,12 @@ #include +#include "Magnum/Magnum.h" #include "Magnum/Math/Tags.h" namespace Magnum { namespace Math { namespace Test { namespace { -struct TagsTest: Corrade::TestSuite::Tester { +struct TagsTest: TestSuite::Tester { explicit TagsTest(); void noDefaultConstructor(); diff --git a/src/Magnum/Math/Test/TypeTraitsTest.cpp b/src/Magnum/Math/Test/TypeTraitsTest.cpp index 3ba2c9bb8..0f193f734 100644 --- a/src/Magnum/Math/Test/TypeTraitsTest.cpp +++ b/src/Magnum/Math/Test/TypeTraitsTest.cpp @@ -34,7 +34,7 @@ namespace Magnum { namespace Math { namespace Test { namespace { -struct TypeTraitsTest: Corrade::TestSuite::Tester { +struct TypeTraitsTest: TestSuite::Tester { explicit TypeTraitsTest(); void name(); @@ -155,13 +155,13 @@ TypeTraitsTest::TypeTraitsTest() { &TypeTraitsTest::equalsZeroFloatingPoint, &TypeTraitsTest::equalsZeroFloatingPoint, &TypeTraitsTest::equalsZeroFloatingPoint}, - Corrade::Containers::arraySize(EqualsZeroData)); + Containers::arraySize(EqualsZeroData)); addTests({&TypeTraitsTest::equal}); } void TypeTraitsTest::name() { - using namespace Corrade::Containers::Literals; + using namespace Containers::Literals; CORRADE_COMPARE(TypeTraits::name(), "UnsignedShort"_s); CORRADE_COMPARE(TypeTraits::name(), "Float"_s); } @@ -244,7 +244,7 @@ template void TypeTraitsTest::epsilonConsistentWithCorrade() { /* Using VERIFY because we *don't* want fuzzy comparison in this case. The equals*() tests below do further checks against TestSuite. */ - CORRADE_VERIFY(TypeTraits::epsilon() == Corrade::Utility::Implementation::FloatPrecision::epsilon()); + CORRADE_VERIFY(TypeTraits::epsilon() == Utility::Implementation::FloatPrecision::epsilon()); } template void TypeTraitsTest::equalsIntegral() { @@ -271,12 +271,12 @@ template void TypeTraitsTest::equalsFloatingPoint0() { /* Ensure we have the same behavior as TestSuite. Done in addition to the epsilonConsistentWithCorrade() test above, since that one alone might give a false sense of security. */ - CORRADE_COMPARE(Corrade::TestSuite::Implementation::FloatComparator{}( + CORRADE_COMPARE(TestSuite::Implementation::FloatComparator{}( T(0)+TypeTraits::epsilon()/T(2), T(0)), - Corrade::TestSuite::ComparisonStatusFlags{}); - CORRADE_COMPARE(Corrade::TestSuite::Implementation::FloatComparator{}( + TestSuite::ComparisonStatusFlags{}); + CORRADE_COMPARE(TestSuite::Implementation::FloatComparator{}( T(0)+TypeTraits::epsilon()*T(2), T(0)), - Corrade::TestSuite::ComparisonStatusFlag::Failed); + TestSuite::ComparisonStatusFlag::Failed); } template void TypeTraitsTest::equalsFloatingPoint1() { @@ -288,12 +288,12 @@ template void TypeTraitsTest::equalsFloatingPoint1() { /* Ensure we have the same behavior as TestSuite. Done in addition to the epsilonConsistentWithCorrade() test above, since that one alone might give a false sense of security. */ - CORRADE_COMPARE(Corrade::TestSuite::Implementation::FloatComparator{}( + CORRADE_COMPARE(TestSuite::Implementation::FloatComparator{}( T(1)+TypeTraits::epsilon()/T(2), T(1)), - Corrade::TestSuite::ComparisonStatusFlags{}); - CORRADE_COMPARE(Corrade::TestSuite::Implementation::FloatComparator{}( + TestSuite::ComparisonStatusFlags{}); + CORRADE_COMPARE(TestSuite::Implementation::FloatComparator{}( T(1)+TypeTraits::epsilon()*T(3), T(1)), - Corrade::TestSuite::ComparisonStatusFlag::Failed); + TestSuite::ComparisonStatusFlag::Failed); } template void TypeTraitsTest::equalsFloatingPointLarge() { @@ -305,12 +305,12 @@ template void TypeTraitsTest::equalsFloatingPointLarge() { /* Ensure we have the same behavior as TestSuite. Done in addition to the epsilonConsistentWithCorrade() test above, since that one alone might give a false sense of security. */ - CORRADE_COMPARE(Corrade::TestSuite::Implementation::FloatComparator{}( + CORRADE_COMPARE(TestSuite::Implementation::FloatComparator{}( T(25)+TypeTraits::epsilon()*T(2), T(25)), - Corrade::TestSuite::ComparisonStatusFlags{}); - CORRADE_COMPARE(Corrade::TestSuite::Implementation::FloatComparator{}( + TestSuite::ComparisonStatusFlags{}); + CORRADE_COMPARE(TestSuite::Implementation::FloatComparator{}( T(25)+TypeTraits::epsilon()*T(75), T(25)), - Corrade::TestSuite::ComparisonStatusFlag::Failed); + TestSuite::ComparisonStatusFlag::Failed); } template void TypeTraitsTest::equalsFloatingPointInfinity() { @@ -324,12 +324,12 @@ template void TypeTraitsTest::equalsFloatingPointInfinity() { /* Ensure we have the same behavior as TestSuite. Done in addition to the epsilonConsistentWithCorrade() test above, since that one alone might give a false sense of security. */ - CORRADE_COMPARE(Corrade::TestSuite::Implementation::FloatComparator{}( + CORRADE_COMPARE(TestSuite::Implementation::FloatComparator{}( Constants::inf(), Constants::inf()), - Corrade::TestSuite::ComparisonStatusFlags{}); - CORRADE_COMPARE(Corrade::TestSuite::Implementation::FloatComparator{}( + TestSuite::ComparisonStatusFlags{}); + CORRADE_COMPARE(TestSuite::Implementation::FloatComparator{}( Constants::inf(), -Constants::inf()), - Corrade::TestSuite::ComparisonStatusFlag::Failed); + TestSuite::ComparisonStatusFlag::Failed); } template void TypeTraitsTest::equalsFloatingPointNaN() { @@ -340,9 +340,9 @@ template void TypeTraitsTest::equalsFloatingPointNaN() { /* OTOH, TestSuite compares two NaNs as equal -- since that makes more sense in the context of tests */ - CORRADE_COMPARE(Corrade::TestSuite::Implementation::FloatComparator{}( + CORRADE_COMPARE(TestSuite::Implementation::FloatComparator{}( Constants::nan(), Constants::nan()), - Corrade::TestSuite::ComparisonStatusFlags{}); + TestSuite::ComparisonStatusFlags{}); } /* Argh! Why there is no standard std::abs() for unsigned types? */ diff --git a/src/Magnum/Math/Test/UnitTest.cpp b/src/Magnum/Math/Test/UnitTest.cpp index dfd85e070..a60bdf5a7 100644 --- a/src/Magnum/Math/Test/UnitTest.cpp +++ b/src/Magnum/Math/Test/UnitTest.cpp @@ -26,12 +26,13 @@ #include #include +#include "Magnum/Magnum.h" #include "Magnum/Math/Constants.h" #include "Magnum/Math/Unit.h" namespace Magnum { namespace Math { namespace Test { namespace { -struct UnitTest: Corrade::TestSuite::Tester { +struct UnitTest: TestSuite::Tester { explicit UnitTest(); void construct(); @@ -68,7 +69,7 @@ typedef Unit Sec; typedef Unit Seci; typedef Constants Constants; -inline Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug& debug, Sec value) { +inline Debug& operator<<(Debug& debug, Sec value) { return debug << Float(value); } diff --git a/src/Magnum/Math/Test/Vector2Test.cpp b/src/Magnum/Math/Test/Vector2Test.cpp index cc8b90a6a..ac07fd9ca 100644 --- a/src/Magnum/Math/Test/Vector2Test.cpp +++ b/src/Magnum/Math/Test/Vector2Test.cpp @@ -53,7 +53,7 @@ template<> struct VectorConverter<2, float, Vec2> { namespace Test { namespace { -struct Vector2Test: Corrade::TestSuite::Tester { +struct Vector2Test: TestSuite::Tester { explicit Vector2Test(); void construct(); diff --git a/src/Magnum/Math/Test/Vector3Test.cpp b/src/Magnum/Math/Test/Vector3Test.cpp index 0f3a7ac91..4bd94cb5f 100644 --- a/src/Magnum/Math/Test/Vector3Test.cpp +++ b/src/Magnum/Math/Test/Vector3Test.cpp @@ -53,7 +53,7 @@ template<> struct VectorConverter<3, float, Vec3> { namespace Test { namespace { -struct Vector3Test: Corrade::TestSuite::Tester { +struct Vector3Test: TestSuite::Tester { explicit Vector3Test(); void construct(); diff --git a/src/Magnum/Math/Test/Vector4Test.cpp b/src/Magnum/Math/Test/Vector4Test.cpp index 5c2832e9c..2f98c4fd9 100644 --- a/src/Magnum/Math/Test/Vector4Test.cpp +++ b/src/Magnum/Math/Test/Vector4Test.cpp @@ -53,7 +53,7 @@ template<> struct VectorConverter<4, float, Vec4> { namespace Test { namespace { -struct Vector4Test: Corrade::TestSuite::Tester { +struct Vector4Test: TestSuite::Tester { explicit Vector4Test(); void construct(); diff --git a/src/Magnum/Math/Test/VectorBenchmark.cpp b/src/Magnum/Math/Test/VectorBenchmark.cpp index 8f0d64281..2309567bc 100644 --- a/src/Magnum/Math/Test/VectorBenchmark.cpp +++ b/src/Magnum/Math/Test/VectorBenchmark.cpp @@ -33,7 +33,7 @@ namespace Magnum { namespace Math { namespace Test { namespace { -struct VectorBenchmark: Corrade::TestSuite::Tester { +struct VectorBenchmark: TestSuite::Tester { explicit VectorBenchmark(); void dot(); diff --git a/src/Magnum/Math/Test/VectorTest.cpp b/src/Magnum/Math/Test/VectorTest.cpp index b829b6f26..8eb942058 100644 --- a/src/Magnum/Math/Test/VectorTest.cpp +++ b/src/Magnum/Math/Test/VectorTest.cpp @@ -54,7 +54,7 @@ template<> struct VectorConverter<3, Float, Vec3> { namespace Test { namespace { -struct VectorTest: Corrade::TestSuite::Tester { +struct VectorTest: TestSuite::Tester { explicit VectorTest(); void construct(); @@ -366,8 +366,8 @@ void VectorTest::data() { CORRADE_COMPARE(g, 1.0f); /* It actually returns an array */ - CORRADE_COMPARE(Corrade::Containers::arraySize(a.data()), 4); - CORRADE_COMPARE(Corrade::Containers::arraySize(ca.data()), 4); + CORRADE_COMPARE(Containers::arraySize(a.data()), 4); + CORRADE_COMPARE(Containers::arraySize(ca.data()), 4); } void VectorTest::compare() { @@ -605,9 +605,9 @@ void VectorTest::angle() { /* Same / opposite. Well, almost. It's interesting how imprecise normalization can get. */ CORRADE_COMPARE_WITH(Math::angle(a, a), 0.0_radf, - Corrade::TestSuite::Compare::around(0.0005_radf)); + TestSuite::Compare::around(0.0005_radf)); CORRADE_COMPARE_WITH(Math::angle(a, -a), 180.0_degf, - Corrade::TestSuite::Compare::around(0.0005_radf)); + TestSuite::Compare::around(0.0005_radf)); } void VectorTest::angleNormalizedButOver1() { diff --git a/src/Magnum/Math/TypeTraits.h b/src/Magnum/Math/TypeTraits.h index 6039ca9c6..8f23c5ab4 100644 --- a/src/Magnum/Math/TypeTraits.h +++ b/src/Magnum/Math/TypeTraits.h @@ -351,9 +351,9 @@ template struct TypeTraits: Implementation::TypeTraitsDefault { * 80-bit, and @cpp 1.0e-14l @ce on platforms * @ref CORRADE_LONG_DOUBLE_SAME_AS_DOUBLE "where it is 64-bit". * - * This matches fuzzy comparison precision in @ref Corrade::TestSuite and - * is always one digit less than how @ref Corrade::Utility::Debug or - * @ref Corrade::Utility::format() prints given type. + * This matches fuzzy comparison precision in + * @relativeref{Corrade,TestSuite} and is always one digit less than how + * @ref Debug or @ref Utility::format() prints given type. */ constexpr static T epsilon(); diff --git a/src/Magnum/Math/Vector.h b/src/Magnum/Math/Vector.h index 60b29ef80..5e995b6f7 100644 --- a/src/Magnum/Math/Vector.h +++ b/src/Magnum/Math/Vector.h @@ -36,6 +36,7 @@ #include #include +#include "Magnum/Magnum.h" #include "Magnum/visibility.h" #include "Magnum/Math/Angle.h" #include "Magnum/Math/BitVector.h" @@ -177,7 +178,7 @@ template class Vector { * @see @ref Vector4::pad(const Vector&, T, T) */ template constexpr static Vector pad(const Vector& a, T value = T()) { - return padInternal(typename Corrade::Containers::Implementation::GenerateSequence::Type{}, a, value); + return padInternal(typename Containers::Implementation::GenerateSequence::Type{}, a, value); } /** @@ -210,7 +211,7 @@ template class Vector { #ifdef DOXYGEN_GENERATING_OUTPUT constexpr explicit Vector(T value) noexcept; #else - template::value && size != 1, T>::type> constexpr explicit Vector(U value) noexcept: Vector(typename Corrade::Containers::Implementation::GenerateSequence::Type{}, value) {} + template::value && size != 1, T>::type> constexpr explicit Vector(U value) noexcept: Vector(typename Containers::Implementation::GenerateSequence::Type{}, value) {} #endif /** @@ -221,7 +222,7 @@ template class Vector { * * @snippet MagnumMath.cpp Vector-conversion */ - template constexpr explicit Vector(const Vector& other) noexcept: Vector(typename Corrade::Containers::Implementation::GenerateSequence::Type{}, other) {} + template constexpr explicit Vector(const Vector& other) noexcept: Vector(typename Containers::Implementation::GenerateSequence::Type{}, other) {} /** @brief Construct a vector from external representation */ template::from(std::declval()))> constexpr explicit Vector(const U& other) noexcept: Vector(Implementation::VectorConverter::from(other)) {} @@ -641,7 +642,7 @@ template class Vector { * @ref RectangularMatrix::flippedRows() */ constexpr Vector flipped() const { - return flippedInternal(typename Corrade::Containers::Implementation::GenerateSequence::Type{}); + return flippedInternal(typename Containers::Implementation::GenerateSequence::Type{}); } /** @@ -715,16 +716,16 @@ template class Vector { template friend U dot(const Vector&, const Vector&); /* Implementation for Vector::Vector(const Vector&) */ - template constexpr explicit Vector(Corrade::Containers::Implementation::Sequence, const Vector& vector) noexcept: _data{T(vector._data[sequence])...} {} + template constexpr explicit Vector(Containers::Implementation::Sequence, const Vector& vector) noexcept: _data{T(vector._data[sequence])...} {} /* Implementation for Vector::Vector(U) */ - template constexpr explicit Vector(Corrade::Containers::Implementation::Sequence, T value) noexcept: _data{Implementation::repeat(value, sequence)...} {} + template constexpr explicit Vector(Containers::Implementation::Sequence, T value) noexcept: _data{Implementation::repeat(value, sequence)...} {} - template constexpr static Vector padInternal(Corrade::Containers::Implementation::Sequence, const Vector& a, T value) { + template constexpr static Vector padInternal(Containers::Implementation::Sequence, const Vector& a, T value) { return {sequence < otherSize ? a[sequence] : value...}; } - template constexpr Vector flippedInternal(Corrade::Containers::Implementation::Sequence) const { + template constexpr Vector flippedInternal(Containers::Implementation::Sequence) const { return {_data[size - 1 - sequence]...}; } }; @@ -1249,32 +1250,32 @@ operator/(const Vector& a, const Vector& b) #ifndef CORRADE_SINGLES_NO_DEBUG /** @debugoperator{Vector} */ -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug& debug, const Vector& value) { +template Debug& operator<<(Debug& debug, const Vector& value) { /** @todo might make sense to propagate the flags also, for hex value printing etc */ - const bool packed = debug.immediateFlags() >= Corrade::Utility::Debug::Flag::Packed; - debug << (packed ? "{" : "Vector(") << Corrade::Utility::Debug::nospace; + const bool packed = debug.immediateFlags() >= Debug::Flag::Packed; + debug << (packed ? "{" : "Vector(") << Debug::nospace; for(std::size_t i = 0; i != size; ++i) { - if(i != 0) debug << Corrade::Utility::Debug::nospace << ","; + if(i != 0) debug << Debug::nospace << ","; debug << value[i]; } - return debug << Corrade::Utility::Debug::nospace << (packed ? "}" : ")"); + return debug << Debug::nospace << (packed ? "}" : ")"); } /* Explicit instantiation for commonly used types */ #ifndef DOXYGEN_GENERATING_OUTPUT -extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Vector<2, Float>&); -extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Vector<3, Float>&); -extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Vector<4, Float>&); -extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Vector<2, Int>&); -extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Vector<3, Int>&); -extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Vector<4, Int>&); -extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Vector<2, UnsignedInt>&); -extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Vector<3, UnsignedInt>&); -extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Vector<4, UnsignedInt>&); -extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Vector<2, Double>&); -extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Vector<3, Double>&); -extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Vector<4, Double>&); +extern template MAGNUM_EXPORT Debug& operator<<(Debug&, const Vector<2, Float>&); +extern template MAGNUM_EXPORT Debug& operator<<(Debug&, const Vector<3, Float>&); +extern template MAGNUM_EXPORT Debug& operator<<(Debug&, const Vector<4, Float>&); +extern template MAGNUM_EXPORT Debug& operator<<(Debug&, const Vector<2, Int>&); +extern template MAGNUM_EXPORT Debug& operator<<(Debug&, const Vector<3, Int>&); +extern template MAGNUM_EXPORT Debug& operator<<(Debug&, const Vector<4, Int>&); +extern template MAGNUM_EXPORT Debug& operator<<(Debug&, const Vector<2, UnsignedInt>&); +extern template MAGNUM_EXPORT Debug& operator<<(Debug&, const Vector<3, UnsignedInt>&); +extern template MAGNUM_EXPORT Debug& operator<<(Debug&, const Vector<4, UnsignedInt>&); +extern template MAGNUM_EXPORT Debug& operator<<(Debug&, const Vector<2, Double>&); +extern template MAGNUM_EXPORT Debug& operator<<(Debug&, const Vector<3, Double>&); +extern template MAGNUM_EXPORT Debug& operator<<(Debug&, const Vector<4, Double>&); #endif #endif diff --git a/src/Magnum/Math/instantiation.cpp b/src/Magnum/Math/instantiation.cpp index 485d96d52..0f55a6431 100644 --- a/src/Magnum/Math/instantiation.cpp +++ b/src/Magnum/Math/instantiation.cpp @@ -102,39 +102,39 @@ template struct MAGNUM_EXPORT_TEMPLATE ConfigurationValue&); -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Bezier<2, 3, Float>&); -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Bezier<3, 2, Float>&); -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Bezier<3, 3, Float>&); -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Bezier<2, 2, Double>&); -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Bezier<2, 3, Double>&); -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Bezier<3, 2, Double>&); -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Bezier<3, 3, Double>&); - -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const CubicHermite&); -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const CubicHermite&); -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const CubicHermite>&); -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const CubicHermite>&); -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const CubicHermite>&); -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const CubicHermite>&); -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const CubicHermite>&); -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const CubicHermite>&); -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const CubicHermite>&); -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const CubicHermite>&); - -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Complex&); -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Complex&); - -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const DualComplex&); -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const DualComplex&); - -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const DualQuaternion&); -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const DualQuaternion&); - -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Quaternion&); -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Quaternion&); - -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const ColorHsv&); +template Debug& operator<<(Debug&, const Bezier<2, 2, Float>&); +template Debug& operator<<(Debug&, const Bezier<2, 3, Float>&); +template Debug& operator<<(Debug&, const Bezier<3, 2, Float>&); +template Debug& operator<<(Debug&, const Bezier<3, 3, Float>&); +template Debug& operator<<(Debug&, const Bezier<2, 2, Double>&); +template Debug& operator<<(Debug&, const Bezier<2, 3, Double>&); +template Debug& operator<<(Debug&, const Bezier<3, 2, Double>&); +template Debug& operator<<(Debug&, const Bezier<3, 3, Double>&); + +template Debug& operator<<(Debug&, const CubicHermite&); +template Debug& operator<<(Debug&, const CubicHermite&); +template Debug& operator<<(Debug&, const CubicHermite>&); +template Debug& operator<<(Debug&, const CubicHermite>&); +template Debug& operator<<(Debug&, const CubicHermite>&); +template Debug& operator<<(Debug&, const CubicHermite>&); +template Debug& operator<<(Debug&, const CubicHermite>&); +template Debug& operator<<(Debug&, const CubicHermite>&); +template Debug& operator<<(Debug&, const CubicHermite>&); +template Debug& operator<<(Debug&, const CubicHermite>&); + +template Debug& operator<<(Debug&, const Complex&); +template Debug& operator<<(Debug&, const Complex&); + +template Debug& operator<<(Debug&, const DualComplex&); +template Debug& operator<<(Debug&, const DualComplex&); + +template Debug& operator<<(Debug&, const DualQuaternion&); +template Debug& operator<<(Debug&, const DualQuaternion&); + +template Debug& operator<<(Debug&, const Quaternion&); +template Debug& operator<<(Debug&, const Quaternion&); + +template Debug& operator<<(Debug&, const ColorHsv&); /* Check proper size of GL types */ static_assert(sizeof(Vector<2, Float>) == 8, "Improper size of 2-element Float vector"); @@ -170,56 +170,56 @@ static_assert(sizeof(RectangularMatrix<4, 2, Double>) == 64, "Improper size of 4 static_assert(sizeof(RectangularMatrix<3, 4, Double>) == 96, "Improper size of 3x4 Double matrix"); static_assert(sizeof(RectangularMatrix<4, 3, Double>) == 96, "Improper size of 4x3 Double matrix"); -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const RectangularMatrix<2, 2, Float>&); -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const RectangularMatrix<3, 3, Float>&); -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const RectangularMatrix<4, 4, Float>&); -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const RectangularMatrix<2, 2, Double>&); -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const RectangularMatrix<3, 3, Double>&); -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const RectangularMatrix<4, 4, Double>&); - -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const RectangularMatrix<2, 3, Float>&); -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const RectangularMatrix<3, 2, Float>&); -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const RectangularMatrix<2, 4, Float>&); -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const RectangularMatrix<4, 2, Float>&); -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const RectangularMatrix<3, 4, Float>&); -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const RectangularMatrix<4, 3, Float>&); -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const RectangularMatrix<2, 3, Double>&); -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const RectangularMatrix<3, 2, Double>&); -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const RectangularMatrix<2, 4, Double>&); -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const RectangularMatrix<4, 2, Double>&); -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const RectangularMatrix<3, 4, Double>&); -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const RectangularMatrix<4, 3, Double>&); - -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Unit&); -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Unit&); -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Unit&); -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Unit&); - -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Vector<2, Float>&); -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Vector<3, Float>&); -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Vector<4, Float>&); -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Vector<2, Int>&); -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Vector<3, Int>&); -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Vector<4, Int>&); -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Vector<2, UnsignedInt>&); -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Vector<3, UnsignedInt>&); -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Vector<4, UnsignedInt>&); -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Vector<2, Double>&); -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Vector<3, Double>&); -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Vector<4, Double>&); - -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Frustum&); -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Frustum&); - -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Range<1, Float>&); -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Range<2, Float>&); -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Range<3, Float>&); -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Range<1, Int>&); -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Range<2, Int>&); -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Range<3, Int>&); -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Range<1, Double>&); -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Range<2, Double>&); -template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Range<3, Double>&); +template Debug& operator<<(Debug&, const RectangularMatrix<2, 2, Float>&); +template Debug& operator<<(Debug&, const RectangularMatrix<3, 3, Float>&); +template Debug& operator<<(Debug&, const RectangularMatrix<4, 4, Float>&); +template Debug& operator<<(Debug&, const RectangularMatrix<2, 2, Double>&); +template Debug& operator<<(Debug&, const RectangularMatrix<3, 3, Double>&); +template Debug& operator<<(Debug&, const RectangularMatrix<4, 4, Double>&); + +template Debug& operator<<(Debug&, const RectangularMatrix<2, 3, Float>&); +template Debug& operator<<(Debug&, const RectangularMatrix<3, 2, Float>&); +template Debug& operator<<(Debug&, const RectangularMatrix<2, 4, Float>&); +template Debug& operator<<(Debug&, const RectangularMatrix<4, 2, Float>&); +template Debug& operator<<(Debug&, const RectangularMatrix<3, 4, Float>&); +template Debug& operator<<(Debug&, const RectangularMatrix<4, 3, Float>&); +template Debug& operator<<(Debug&, const RectangularMatrix<2, 3, Double>&); +template Debug& operator<<(Debug&, const RectangularMatrix<3, 2, Double>&); +template Debug& operator<<(Debug&, const RectangularMatrix<2, 4, Double>&); +template Debug& operator<<(Debug&, const RectangularMatrix<4, 2, Double>&); +template Debug& operator<<(Debug&, const RectangularMatrix<3, 4, Double>&); +template Debug& operator<<(Debug&, const RectangularMatrix<4, 3, Double>&); + +template Debug& operator<<(Debug&, const Unit&); +template Debug& operator<<(Debug&, const Unit&); +template Debug& operator<<(Debug&, const Unit&); +template Debug& operator<<(Debug&, const Unit&); + +template Debug& operator<<(Debug&, const Vector<2, Float>&); +template Debug& operator<<(Debug&, const Vector<3, Float>&); +template Debug& operator<<(Debug&, const Vector<4, Float>&); +template Debug& operator<<(Debug&, const Vector<2, Int>&); +template Debug& operator<<(Debug&, const Vector<3, Int>&); +template Debug& operator<<(Debug&, const Vector<4, Int>&); +template Debug& operator<<(Debug&, const Vector<2, UnsignedInt>&); +template Debug& operator<<(Debug&, const Vector<3, UnsignedInt>&); +template Debug& operator<<(Debug&, const Vector<4, UnsignedInt>&); +template Debug& operator<<(Debug&, const Vector<2, Double>&); +template Debug& operator<<(Debug&, const Vector<3, Double>&); +template Debug& operator<<(Debug&, const Vector<4, Double>&); + +template Debug& operator<<(Debug&, const Frustum&); +template Debug& operator<<(Debug&, const Frustum&); + +template Debug& operator<<(Debug&, const Range<1, Float>&); +template Debug& operator<<(Debug&, const Range<2, Float>&); +template Debug& operator<<(Debug&, const Range<3, Float>&); +template Debug& operator<<(Debug&, const Range<1, Int>&); +template Debug& operator<<(Debug&, const Range<2, Int>&); +template Debug& operator<<(Debug&, const Range<3, Int>&); +template Debug& operator<<(Debug&, const Range<1, Double>&); +template Debug& operator<<(Debug&, const Range<2, Double>&); +template Debug& operator<<(Debug&, const Range<3, Double>&); #endif }}