Main Page | Class Hierarchy | Class List | File List | Class Members | File Members | Related Pages

Sampler Class Reference

Interface for 2D and 1D Sampler plugins. More...

#include <core/Sampler.h>

Inheritance diagram for Sampler:

Inheritance graph
[legend]
List of all members.

Public Member Functions

virtual void nextSample (Vector2 &sample)
virtual void nextSample (float &sample)
virtual void reset ()
Traditional set sampling functions.
virtual void createSamples (Vector2 *samples, int num_samples, MTRand *rand, bool shuffle=false) const =0
virtual void createSamples (float *samples, int num_samples, MTRand *rand, bool shuffle=false) const =0

Static Public Member Functions

Static Helper functions
static void shuffle (Vector2 *samples, int num_samples, MTRand *rand)
static void shuffle (float *samples, int num_samples, MTRand *rand)

Detailed Description

Interface for 2D and 1D Sampler plugins.

The Sampler interface is designed to allow both incremental samplers such as Halton sequences as well as traditional set samplers. To support incremental sampling within the renderer we will need to make samplers a part of the per thread context.


Member Function Documentation

virtual void Sampler::createSamples Vector2 samples,
int  num_samples,
MTRand rand,
bool  shuffle = false
const [pure virtual]
 

Create a set of 2D samples with known size. Some samplers may require that num_samples be a perfect square.

Parameters:
[out] samples Preallocated sample array of length num_samples.
[in] num_samples Number of samples to create.
[in] rand Thread specific random number generator.
[in] shuffle True if you want the samples shuffled.
Returns:
The samples array will be filled with num_samples.

Implemented in Jittered, MultiJittered, NRooks, and Random.

virtual void Sampler::createSamples float *  samples,
int  num_samples,
MTRand rand,
bool  shuffle = false
const [pure virtual]
 

Create a set of 1D samples with known size. Some samplers may requires that num_samples be a perfect square.

Parameters:
[out] samples Preallocated sample array of length num_samples.
[in] num_samples Number of samples to create.
[in] rand Thread specific random number generator.
[in] shuffle True if you want the samples shuffled.
Returns:
The samples array will be filled with num_samples.

Implemented in Jittered, MultiJittered, NRooks, and Random.

virtual void Sampler::nextSample Vector2 sample  )  [inline, virtual]
 

Create the next 2D sample in the series.

Parameters:
[out] sample The next 2D sample in the series.

virtual void Sampler::nextSample float &  sample  )  [inline, virtual]
 

Create the next 1D sample in the series.

Parameters:
[out] sample The next 1D sample in the series.

virtual void Sampler::reset  )  [inline, virtual]
 

Let the sampler know that you are finished with the current series and it should reset in preparation for the next.

static void Sampler::shuffle Vector2 samples,
int  num_samples,
MTRand rand
[inline, static]
 

Shuffle a set of 2D samples.

Parameters:
[in,out] samples The 2D samples to be shuffled in place.
[in] num_samples The number of samples to be shuffled.
[in] rand The thread specific random number generator.

static void Sampler::shuffle float *  samples,
int  num_samples,
MTRand rand
[inline, static]
 

Shuffle a set of 1D samples.

Parameters:
[in,out] samples The 1D samples to be shuffled in place.
[in] num_samples The number of samples to be shuffled.
[in] rand The thread specific random number generator.


The documentation for this class was generated from the following file:
Generated on Wed Jul 20 16:15:26 2005 for galileo by  doxygen 1.4.3