Lightmetrica  0.0.1.50dbee3 (yosakoi)
 All Classes Functions Variables Typedefs Enumerations Enumerator
Public Member Functions | List of all members
RewindableSampler Class Referenceabstract

#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 SamplerClone () 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 RandomRng ()=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)
 

Detailed Description

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.

Inheritance diagram for RewindableSampler:
Sampler Component SIMDAlignedType RewindableSamplerImpl

Member Function Documentation

virtual void RewindableSampler::Configure ( Random rng)
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.

Parameters
rngRandom number generator.

Implemented in RewindableSamplerImpl.

virtual void RewindableSampler::Rewind ( int  index)
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.

Parameters
indexSample index.
See also
SampleIndex

Implemented in RewindableSamplerImpl.

virtual int RewindableSampler::SampleIndex ( ) const
pure virtual

Get the current sampler index. The value is used for rewinding the sampler.

Returns
Current sample index.
See also
Rewind

Implemented in RewindableSamplerImpl.


The documentation for this class was generated from the following file: