Lightmetrica
0.0.1.50dbee3 (yosakoi)
|
#include <rewindablesampler.h>
Public Member Functions | |
LM_COMPONENT_INTERFACE_DEF ("rewindablesampler") | |
virtual void | Configure (Random *rng)=0 |
virtual void | Rewind (int index)=0 |
virtual int | SampleIndex () const =0 |
Public Member Functions inherited from Sampler | |
virtual Sampler * | Clone () const =0 |
virtual void | SetSeed (unsigned int seed)=0 |
virtual Math::Float | Next ()=0 |
virtual unsigned int | NextUInt ()=0 |
virtual Math::Vec2 | NextVec2 ()=0 |
virtual Random * | Rng ()=0 |
LM_PUBLIC_API void | SetSeedWithCurrentTime () |
Public Member Functions inherited from Component | |
virtual std::string | ComponentInterfaceTypeName () const =0 |
virtual std::string | ComponentImplTypeName () const =0 |
Public Member Functions inherited from SIMDAlignedType | |
void * | operator new (std::size_t size) throw (std::bad_alloc) |
void | operator delete (void *p) |
Rewindable sampler. A sampler implementation for restoring sample sequence afterwards. This sampler is introduced to avoid to save unnecessary light paths in the initial sampling process of MLT or PSSMLT.
|
pure virtual |
Configure the sampler. Initializes underlying random number generator with the given value. This function must be called before use. Ownership of #rng is delegated to this class. Seed is not explicitly refreshed, so do not forget to call SetSeed after calling this function before use.
rng | Random number generator. |
Implemented in RewindableSamplerImpl.
|
pure virtual |
Rewind the sampler to the given index. Moves the index of the sampler to #index and gets the sampler ready to regenerate random numbers after #index. The index values can be obtained by SampleIndex function. In the condition of the same seed, this function guarantees to generate same sequence of samples after #index.
index | Sample index. |
Implemented in RewindableSamplerImpl.
|
pure virtual |
Get the current sampler index. The value is used for rewinding the sampler.
Implemented in RewindableSamplerImpl.