Vladimír Vondruš
2b97e53360
Math: sRGB support in Color classes.
...
At first I designed a hugely disrupting change that basically deprecated
everything related to 8-bit linear RGB colors, but then I took a step
back and reconsidered 8-bit linear RGB as a valid use case.
The documentation of Color classes, typedefs and literals was clarified
to mention that these classes should always represent linear RGB and
that 8-bit colors are commonly treated as *not* linear and one should be
aware of it.
There is now a new Color3::fromSrgb() and Color3::toSrgb() that converts
from sRGB representation to a linear RGB usable for calculations and
then back. For four-component colors, there is now
Color4::fromSrgbAlpha() and Color4::toSrgbAlpha(). Similarly to what
OpenGL sRGB behavior is regarding to alpha, the alpha channel is kept
linear, that's why I'm also calling it sRGB + alpha instead of sRGBA.
Besides that, there are four new literals _srgb, _srgba, _srgbf and
_srgbaf that have different semantics to support the sRGB workflow. The
8-bit versions are equivalent to _rgb and _rgba, though they don't
return Color3 but a non-color Vector3 to hint that the result is not a
linear RGB color. Main purpose of these is documentation. The float
versions apply an inverse sRGB curve to the input, returning a linear
RGB color.
10 years ago
Vladimír Vondruš
8f88e0ea02
Math: improve Color::red() etc. test.
...
Testing both floats and integer colors.
10 years ago
Vladimír Vondruš
a61f0f47f4
Math: reduce literal scope in Color test.
10 years ago
Vladimír Vondruš
dba0ea320d
Math: vector/scalar overload for pow().
10 years ago
Vladimír Vondruš
41aaf1321f
Math: construct fully-overwritten outputs in functions with NoInit.
...
Slightly faster on non-optimized builds (I would assume the optimizer
does this anyway).
10 years ago
Vladimír Vondruš
8e576d9c73
Math: improved HSV color tests.
...
Testing both RGB and RGBA implementation for both floating-point
and integral types.
10 years ago
Vladimír Vondruš
dbe787c404
Math: doc++
10 years ago
Vladimír Vondruš
ccb85ec65b
Math: pass largish things as const references instead of a copy.
10 years ago
Vladimír Vondruš
c27a12bb30
Math: renamed Color[34]::*HSV types and functions to Color[34]::*Hsv.
...
For consistency with naming scheme for other color spaces (upcoming
Srgb, Xyz, Lab etc.). The old uppercase names are now marked as
deprecated and will be removed in some future release.
10 years ago
Vladimír Vondruš
4db86bad97
Math: doc++
10 years ago
Vladimír Vondruš
d2eae35966
Math: these functions are not constexpr.
10 years ago
Vladimír Vondruš
a8d1fc4d84
Math: work around constexpr issues on old GCCs in Frustum test.
...
Travis CI GCC 4.7 and Android NDK GCC 4.9 fail to compile that. GCC 6
works, not sure about GCC 5.
10 years ago
Vladimír Vondruš
e75bef1d53
Math: MSVC 2015 workarounds for constexpr in Frustum tests.
10 years ago
Vladimír Vondruš
7f89105a51
Math: converted Geometry::Distance and Intersection to namespaces.
...
No need for them to be classes, less indentation, less keywords and
boilerplate, more space for documentation, better `using` usage. Also
revised and fixed various issues in the documentation.
10 years ago
Vladimír Vondruš
e722286200
Math: reference intersection functions from Frustum docs.
10 years ago
Vladimír Vondruš
b6858030b8
Math: ability to convert Frustum from/to external representations.
10 years ago
Vladimír Vondruš
421218c2d1
Math: return const& from Frustum::operator[].
...
So constexpr access on Vector elements is possible as well.
10 years ago
Vladimír Vondruš
20b3adbc55
Math: ability to convert Bezier from/to external representation.
10 years ago
Vladimír Vondruš
620b571766
Math: fix template declaration for Range converter.
10 years ago
Vladimír Vondruš
54f4087ab8
Math: return const& from Bezier::operator[].
...
So constexpr access on Vector elements is possible as well.
10 years ago
Vladimír Vondruš
e5fd5b56f8
Math: document why RectangularMatrix::operator[] returns const&.
10 years ago
Vladimír Vondruš
3cedefe14b
Math: remove GCC constexpr workaround from the tests.
10 years ago
Vladimír Vondruš
90c5001673
Math: remove dead frustum/box intersection code.
...
The additional corner checks are not implemented now, thus the code is
more complex than it needs to be.
10 years ago
Vladimír Vondruš
87f4fc46c2
Math: simplify the distance math.
...
Sum of all components of a component-wise vector multiplication is, in
fact, a dot product.
10 years ago
Vladimír Vondruš
01fa24910f
Math: conversion constructor for Frustum.
10 years ago
Vladimír Vondruš
3952a20099
Math: verify that the Frustum constructor is implicit.
10 years ago
Vladimír Vondruš
8d1d786698
Math: more Frustum data access functions, test for constexprness.
10 years ago
Vladimír Vondruš
3e2464cded
Math: default/identity and NoInit constructors for Frustum, tests.
10 years ago
Vladimír Vondruš
70ef473710
Math: verify that the NoInit constructors are explicit.
10 years ago
Vladimír Vondruš
310e1c1c25
Math: noexcept constructor for Frustum.
10 years ago
Vladimír Vondruš
54d1aefcba
Math: equality comparison for Frustum.
...
Together with the debug operator it allows for much simpler testing.
10 years ago
Vladimír Vondruš
376ea1e0b2
Math: debug operator for Frustum.
10 years ago
Vladimír Vondruš
28c31bfc96
Math: I don't see why we should have those overloads.
...
The compiler does that for us. Probably a brain fart from 2010. On the
other hand, the ConfigurationValue specializations need to be there,
because the type is used explicitly as template parameter.
10 years ago
Vladimír Vondruš
cfc622c92c
Math: explicitly instantiate commonly used Range debug operators.
...
Might save some executable bloat. Not sure why this wasn't done already.
10 years ago
Vladimír Vondruš
32f357752f
Math: the world is not just about OpenGL.
10 years ago
Vladimír Vondruš
605b34079e
Added typedefs and forward declaration for Math::Frustum.
10 years ago
Vladimír Vondruš
b7eb367dde
Math: cleanup, code compression.
10 years ago
Vladimír Vondruš
7bc1d9f129
Update credits.
10 years ago
Squareys
1f995d1ab2
Math: Add Distance::pointPlane* and two frustum intersection functions
...
`Intersection::pointFrustum` and `Intersection::boxFrustum`
Signed-off-by: Squareys <Squareys@googlemail.com>
10 years ago
Squareys
0062fbf78e
Math: Add rudimentary Frustum class
...
Signed-off-by: Squareys <Squareys@googlemail.com>
10 years ago
Vladimír Vondruš
1a077391ce
Math: expect failure in Double SVD test on recent Emscripten versions.
...
Something got broken (1.36.13, 14). Was working fine with 1.36.5.
10 years ago
Vladimír Vondruš
37565d5414
Math: print 8-bit colors as hex in Debug.
...
So #ffffff00 instead of Vector(255, 255, 255, 0). Much shorter with the
same information value.
10 years ago
Vladimír Vondruš
1fdd532910
Math: return proper subclass from Matrix::transposed().
10 years ago
Vladimír Vondruš
930018c2ad
Math: doc++
10 years ago
Vladimír Vondruš
5fcdd48808
Math: clarify what Matrix4::lookAt() does.
10 years ago
Vladimír Vondruš
69dfc39f30
Math: don't compare const char* as pointers in test by accident.
10 years ago
Vladimír Vondruš
210949f2dd
Math: long double is the same as double also on Android.
10 years ago
Vladimír Vondruš
c47f8e04e3
Math: test for size of long double.
...
In order to have predictable results in the tests.
10 years ago
Vladimír Vondruš
60b56b0999
Math: no need for that GCC type deduction workaround anymore.
10 years ago
Vladimír Vondruš
a2c8435ede
Use new TestSuite numeric comparators where appropriate.
10 years ago