Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
ph::SGStratified Class Reference

#include <SGStratified.h>

Inheritance diagram for ph::SGStratified:
ph::SampleGenerator

Public Member Functions

 SGStratified (std::size_t numSamples)
 
std::unique_ptr< SampleGeneratormakeNewborn (std::size_t numSampleBatches) const override
 Make a new generator.
 
- Public Member Functions inherited from ph::SampleGenerator
 SampleGenerator (std::size_t numSampleBatches, std::size_t maxCachedBatches)
 
 SampleGenerator (std::size_t numSampleBatches)
 
virtual ~SampleGenerator ()=default
 
virtual void rebirth ()
 Reset this generator to its initial state, reviving it from dead state. Calling this method starts a new life cycle–all existing sample stages and values are lost, and references to them are invalidated. New declarations can be made after, and new sample values can be generated.
 
void genSplitted (std::size_t numSplits, std::vector< std::unique_ptr< SampleGenerator > > &out_sgs) const
 
bool prepareSampleBatch ()
 Generates sample values for current sample batch. Advances all sample values in all stages to the next batch. Will potentially generate sample values for more than one batch at once (cached).
 
SamplesNDHandle declareStageND (std::size_t numDims, std::size_t numSamples)
 Similar to declareStageND(), with default size hints.
 
SamplesNDHandle declareStageND (std::size_t numDims, std::size_t numSamples, std::vector< std::size_t > dimSizeHints)
 Declares a N-dimensional sample stage. A sample stage contains information for how the samples will be used, number of samples, etc. These information can help the sample generator to produce sample values of better quality. This method can only be called before sample batches are generated (before any call to prepareSampleBatch()).
 
SamplesNDStream getSamplesND (const SamplesNDHandle &handle) const
 Gets generated N-dimensional sample values in a stage. This method can only be called after sample batches are generated (after any call to prepareSampleBatch()).
 
std::size_t numSampleBatches () const
 
std::size_t maxCachedBatches () const
 
std::size_t numRemainingBatches () const
 
bool hasMoreBatches () const
 

Constructor & Destructor Documentation

◆ SGStratified()

ph::SGStratified::SGStratified ( std::size_t numSamples)
explicit

Member Function Documentation

◆ makeNewborn()

std::unique_ptr< SampleGenerator > ph::SGStratified::makeNewborn ( std::size_t numSampleBatches) const
overridevirtual

Make a new generator.

Returns
The new generator. Newborn generator may not have the same internal state as its ancestor.

Implements ph::SampleGenerator.


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