JPL Spatial
Sound spatialization and propagation library
Loading...
Searching...
No Matches
JPL::Octahedron Namespace Reference

Type traits and utilities for octahedron encoder. More...

Namespaces

namespace  Internal
 

Concepts

concept  CPrecision
 Constraint for valid precision types.
 

Typedefs

using Precision4bits = Internal::PrecisionType< uint8 >
 Available precision types.
 
using Precision8bits = Internal::PrecisionType< uint16 >
 
using Precision16bits = Internal::PrecisionType< uint32 >
 
using Precision32bits = Internal::PrecisionType< uint64 >
 

Functions

JPL_INLINE constexpr double MaxComponentError (size_t bitsPerAxis) noexcept
 Run-time variant of 'cMaxComponentError'.
 
JPL_INLINE constexpr double MaxVectorError (size_t bitsPerAxis) noexcept
 Run-time variant of 'cMaxVectorError'.
 

Variables

template<size_t BitsPerAxis>
constexpr double cMaxComponentError = 4.0 / (static_cast<double>((1ULL << BitsPerAxis)) - 1.0)
 
template<size_t BitsPerAxis>
constexpr double cMaxVectorError = cMaxComponentError<BitsPerAxis> * std::numbers::sqrt3
 

Detailed Description

Type traits and utilities for octahedron encoder.

Typedef Documentation

◆ Precision16bits

◆ Precision32bits

◆ Precision4bits

◆ Precision8bits

Function Documentation

◆ MaxComponentError()

JPL_INLINE constexpr double JPL::Octahedron::MaxComponentError ( size_t  bitsPerAxis)
constexprnoexcept

Run-time variant of 'cMaxComponentError'.

◆ MaxVectorError()

JPL_INLINE constexpr double JPL::Octahedron::MaxVectorError ( size_t  bitsPerAxis)
constexprnoexcept

Run-time variant of 'cMaxVectorError'.

Variable Documentation

◆ cMaxComponentError

template<size_t BitsPerAxis>
constexpr double JPL::Octahedron::cMaxComponentError = 4.0 / (static_cast<double>((1ULL << BitsPerAxis)) - 1.0)
constexpr

Maximum "per-component" error after Encode -> Decode for an octahedral map with B bits per axis. Valid for any vector on the unit sphere.

◆ cMaxVectorError

template<size_t BitsPerAxis>
constexpr double JPL::Octahedron::cMaxVectorError = cMaxComponentError<BitsPerAxis> * std::numbers::sqrt3
constexpr