Magnum/Math/Packing.h file

Functions Magnum::Math::pack(), Magnum::Math::unpack(), Magnum::Math::packHalf(), Magnum::Math::unpackHalf()

Namespaces

namespace Magnum
Root namespace.
namespace Magnum::Math
Math library.

Packing and unpacking functions

Similarly to scalar/vector functions these work on both scalars and vectors, including Deg and Rad.

template<class FloatingPoint, class Integral>
auto unpack(const Integral& value) -> FloatingPoint
Unpack integral value into a floating-point representation.
template<class FloatingPoint, class Integral, UnsignedInt bits>
auto unpack(const Integral& value) -> FloatingPoint
Unpack integer bits into a floating-point representation.
template<class Integral, class FloatingPoint>
auto pack(const FloatingPoint& value) -> Integral
Pack floating-point value into an integer representation.
template<class Integral, UnsignedInt bits, class FloatingPoint>
auto pack(FloatingPoint value) -> Integral
Pack floating-point value into integer bits.
auto packHalf(Float value) -> UnsignedShort
Pack 32-bit float value into 16-bit half-float representation.
template<std::size_t size>
auto packHalf(const Vector<size, Float>& value) -> Vector<size, UnsignedShort>
auto unpackHalf(UnsignedShort value) -> Float
Unpack 16-bit half-float value into 32-bit float representation.
template<std::size_t size>
auto unpackHalf(const Vector<size, UnsignedShort>& value) -> Vector<size, Float>