|
OpenQMC API
|
Namespaces | |
| namespace | bntables |
| namespace | pcg |
Classes | |
| struct | EncodeKey |
| Key to encode pixel coordinates. More... | |
| class | SamplerInterface |
| Public sampler API. More... | |
| struct | State64Bit |
| Generic sampler state type. More... | |
Typedefs | |
| using | LatticeSampler = SamplerInterface< LatticeImpl > |
| Rank one lattice sampler. | |
| using | LatticeBnSampler = SamplerInterface< LatticeBnImpl > |
| Blue noise variant of lattice sampler. | |
| using | PmjSampler = SamplerInterface< PmjImpl > |
| Low discrepancy pmj sampler. | |
| using | PmjBnSampler = SamplerInterface< PmjBnImpl > |
| Blue noise variant of pmj sampler. | |
| using | SobolSampler = SamplerInterface< SobolImpl > |
| Owen scrambled sobol sampler. | |
| using | SobolBnSampler = SamplerInterface< SobolBnImpl > |
| Blue noise variant of sobol sampler. | |
Functions | |
| template<int XBits, int YBits, int ZBits> | |
| std::uint16_t | encodeBits16 (EncodeKey key) |
| Encode a key value into 16 bits. | |
| template<int XBits, int YBits, int ZBits> | |
| EncodeKey | decodeBits16 (std::uint16_t value) |
| Decode a value back into a key. | |
| float | uintToFloat (std::uint32_t value) |
| Convert an integer into a [0, 1) float. | |
| constexpr std::uint32_t | randomDigitScramble (std::uint32_t value, std::uint32_t hash) |
| Random digit scramble an element in a sequence. | |
| template<int Table, int Depth> | |
| void | shuffledScrambledLookup (std::uint32_t index, std::uint32_t hash, const std::uint32_t table[][Table], std::uint32_t sample[Depth]) |
| Compute a randomised value from a pre-computed table. | |
| std::uint16_t | sobolReversedIndex (std::uint16_t index, int dimension) |
| Compute sobol sequence value at an index with reversed bits. | |
| constexpr std::uint32_t | scrambleAndReverse (std::uint32_t value, std::uint32_t seed) |
| Permute an input integer and reverse the bits. | |
| template<int Depth> | |
| void | shuffledScrambledSobol (std::uint32_t index, std::uint32_t seed, std::uint32_t sample[Depth]) |
| Compute a randomised sobol sequence value. | |
| constexpr std::uint32_t | laineKarrasPermutation (std::uint32_t value, std::uint32_t seed) |
| Laine and Karras style permutation. | |
| constexpr std::uint32_t | reverseAndShuffle (std::uint32_t value, std::uint32_t seed) |
| Reverse input bits and shuffle order. | |
| constexpr std::uint32_t | shuffle (std::uint32_t value, std::uint32_t seed) |
| Compute a hash based owen scramble. | |
| constexpr std::uint32_t | uintToRange (std::uint32_t value, std::uint32_t range) |
| Compute an unsigned integer within 0-bounded half-open range. | |
| constexpr std::uint32_t | uintToRange (std::uint32_t value, std::uint32_t begin, std::uint32_t end) |
| Compute an unsigned integer within half-open range. | |
| constexpr std::uint32_t | rotate (std::uint32_t value, std::uint32_t distance) |
| Rotate an integer a given distance. | |
| constexpr std::uint32_t | latticeReversedIndex (std::uint32_t index, int dimension) |
| Compute a rank 1 lattice value at an index with reversed bits. | |
| template<int Depth> | |
| constexpr void | shuffledRotatedLattice (std::uint32_t index, std::uint32_t patternId, std::uint32_t sample[Depth]) |
| Compute a randomised rank 1 lattice value. | |
| constexpr std::uint32_t | reverseBits32 (std::uint32_t value) |
| Reverse bits of an unsigned 32 bit integer. | |
| constexpr std::uint16_t | reverseBits16 (std::uint16_t value) |
| Reverse bits of an unsigned 16 bit integer. | |
| constexpr std::uint32_t | rotateBits (std::uint32_t value, std::uint32_t distance) |
| Rotate bits in an integer value. | |
| constexpr std::uint32_t | rotateBytes (std::uint32_t value, int distance) |
| Rotate bytes in an integer value. | |
| constexpr int | computeIndexKey (int index) |
| Compute 16-bit key from index. | |
| constexpr int | computeIndexId (int index) |
| Compute new 16-bit index from index. | |
| void | stochasticPmjInit (int nsamples, std::uint32_t table[][4]) |
| Initialise a table with a progressive mult-jittered (0,2) sequence. | |
Variables | |
| constexpr auto | floatOneOverUintMax = 2.3283064365386962890625e-10f |
| 0x1p-32 | |
| constexpr auto | floatOneMinusEpsilon = 0.999999940395355224609375f |
| max flt | |
|
inline |
Given a 16 bit index, where the order of bits in the index have been reversed, compute a sobol sequence value to 16 bits of precision for a given dimension. Dimensions must be within the range [0, 4).
| [in] | index | Bit reversed index of element. |
| [in] | dimension | Dimension of sobol sequence. |

|
constexpr |
Given an input integer value, perform a Laine and Karras style permutation and reverse the resulting bits. The permutation can be randomised with a given seed value. This will be equivalent to an Owen scramble when the input bits of the integer are already reversed.
| [in] | value | Input integer value. |
| [in] | seed | Seed to change the permutation. |

|
inline |
Given an index and a seed, compute an Owen scrambled sobol sequence value. The index will be shuffled in a manner that is progressive friendly. The value can be multi-dimensional. For a given sequence, the seed value must be constant. An index greater than 2^16 will repeat values.
| Depth | Dimensional space of output, up to 4 dimensions. |
| [in] | index | Input index of sequence value. |
| [in] | seed | Seed to randomise the sequence. |
| [out] | sample | Randomised sequence value. |
|
constexpr |
Given a 32 bit unsigned integer value, offset the value a given distance, and rely on integer overflow for the value to wrap around. When applied to elements in a lattice, this represents a toroidal shift or rotation, upon the range of representable values. When the distance is constant for all elements, this can be used to efficiently randomise the values.
| [in] | value | Integer value to offset. |
| [in] | distance | Distance to offset value. |

Given a 32 bit index, where the order of bits in the index have been reversed, compute a rank 1 lattice value to 32 bits of precision for a given dimension. Dimensions must be within the range [0, 4).
| [in] | index | Bit reversed index of element. |
| [in] | dimension | Dimension of rank 1 lattice. |

|
constexpr |
Given an index and a patternId, compute a rank 1 lattice value. The index will be shuffled in a manner that is progressive friendly. The value can be multi-dimensional. For a given lattice, the patternId value must be constant.
| Depth | Dimensional space of output, up to 4 dimensions. |
| [in] | index | Input index of lattice value. |
| [in] | patternId | Seed to randomise the lattice. |
| [out] | sample | Randomised lattice value. |
Given a sample index, compute a key value based on the top 16-bits of the integer range. Use computeIndexId() to compute the corrosponding new index to pair with the key.
| [in] | index | Sample index. |

Given a sample index, compute a new index value based on the bottom 16-bits of the integer range. Use computeIndexKey() to compute the corrosponding key value to pair with the new index.
| [in] | index | Sample index. |

Given a data array and size, compute the corresponding progressive multi-jittered (0,2) sequence value for each element of the array. Each element in the array is a 4 dimensional sample. Number of samples must be larger than zero and no more than 2^16.
| [in] | nsamples | Size of the table array. |
| [out] | table | Output array of 4 dimensional samples. |