Main Page | Class List | File List | Class Members | Examples

Quasisampler Class Reference

This is a base class that implements the Quasi-Sampler importance sampling system, as presented in the paper : "Fast Hierarchical Importance Sampling with Blue Noise Properties", by Victor Ostromoukhov, Charles Donohue and Pierre-Marc Jodoin, to be presented at SIGGRAPH 2004. More...

List of all members.

Public Member Functions

virtual unsigned getImportanceAt (Point2D pt)=0
 This virtual function must be implemented in order to use the sampling system.

std::vector< Point2DgetSamplingPoints ()
 Builds and collects the point set generated be the sampling system, using the previously defined importance function.


Protected Member Functions

 Quasisampler (double width=0.0, double height=0.0)
 Protected constructor, which initializes the Region of Interest.

unsigned getImportanceAt_bounded (Point2D pt)
 This is a helper function which constrains the incoming points to the region of interest.

void subdivideAll (int times=1)
 Subdivides all tiles down a level, a given number of times.

void buildAdaptiveSubdivision (unsigned minSubdivisionLevel=6)
 Generates the hierarchical structure.

void collectPoints (std::vector< Point2D > &pointlist, bool filterBounds=true)
 Collect the resulting point set.


Static Protected Member Functions

unsigned fibonacci (unsigned i)
 Fibonacci number at a given position.

unsigned getReqSubdivisionLevel (unsigned importance)
 Returns the required level of subdivision for a given importance value.

unsigned calcFCodeValue (unsigned bitsequence, unsigned nbits)
 Returns the decimal value of an F-Code, over a given number of bits.

unsigned calcStructuralIndex (unsigned bitsequence)
 Returns the Structural Index (i_s) for a given F-Code.

unsigned calcImportanceIndex (unsigned importance)
 Returns the Importance Index (i_v) for a given importance value.

Point2D calcDisplacementVector (unsigned importance, unsigned f_code, int dir)
 Fetches the appropriate vector from the lookup table.


Protected Attributes

TileNoderoot
 Root node of the tile subdivision tree.

double width
 Extents of the region of interest.

double height
 Extents of the region of interest.


Static Protected Attributes

const unsigned fiboTable [32]
 Fibonacci sequence (first 32 numbers).

const Point2D vvect [20]
 Unit vectors rotated around origin, in $ \frac{\pi}{10} $ increments, counter-clockwise.

const double lut [LUT_SIZE][21][2]
 Pre-calculated correction vectors lookup table.


Detailed Description

This is a base class that implements the Quasi-Sampler importance sampling system, as presented in the paper : "Fast Hierarchical Importance Sampling with Blue Noise Properties", by Victor Ostromoukhov, Charles Donohue and Pierre-Marc Jodoin, to be presented at SIGGRAPH 2004.

This is a pure-virtual class, and you must implement the "getImportanceAt()" function in order to use the sampling system. The mechanics of the system can be observed in the given source code.

Examples:

example.cpp, example2.cpp, and example3.cpp.

Definition at line 75 of file quasisampler_prototype.h.


Member Function Documentation

unsigned calcFCodeValue unsigned  bitsequence,
unsigned  nbits
[inline, static, protected]
 

Returns the decimal value of an F-Code, over a given number of bits.

The value returned is $ \sum_{j=2}^{m} b_{j} F_{j} $.

Definition at line 126 of file quasisampler_prototype.h.

unsigned calcImportanceIndex unsigned  importance  )  [inline, static, protected]
 

Returns the Importance Index (i_v) for a given importance value.

The value returned is $ \lfloor n \cdot ({\log_{\phi^2} \sqrt{5} \cdot x}) ~ {\bf mod} ~ 1 \rfloor $.

Definition at line 145 of file quasisampler_prototype.h.

unsigned fibonacci unsigned  i  )  [inline, static, protected]
 

Fibonacci number at a given position.

The value returned is $ F_i = F_{i-1} + F_{i-2} $.

Definition at line 106 of file quasisampler_prototype.h.

virtual unsigned getImportanceAt Point2D  pt  )  [pure virtual]
 

This virtual function must be implemented in order to use the sampling system.

It should return the value of the importance function at the given point.

unsigned getReqSubdivisionLevel unsigned  importance  )  [inline, static, protected]
 

Returns the required level of subdivision for a given importance value.

The value returned is $ \lceil{\log_{\phi^2}(importance)}\rceil $, where $ \phi=\frac{1 + {\sqrt{5}}}{2}$ is the Golden Ratio.

Definition at line 116 of file quasisampler_prototype.h.


Member Data Documentation

const unsigned fiboTable [static, protected]
 

Initial value:

{ 1,1,2,3,5,8,13,21,34,55,89,144,233,377,610,987, 1597,2584,4181,6765,10946,17711,28657,46368,75025, 121393,196418,317811,514229,832040,1346269,2178309 }
Fibonacci sequence (first 32 numbers).

Definition at line 619 of file quasisampler_prototype.h.

const double lut [static, protected]
 

Pre-calculated correction vectors lookup table.

These are available in ASCII format on the web-site.

Definition at line 634 of file quasisampler_prototype.h.

const Point2D vvect [static, protected]
 

Initial value:

{ Point2D(0,1), Point2D(-0.309017,0.951057), Point2D(-0.587785,0.809017), Point2D(-0.809017,0.587785), Point2D(-0.951057,0.309017), Point2D(-1,0), Point2D(-0.951057,-0.309017), Point2D(-0.809017,-0.587785), Point2D(-0.587785,-0.809017), Point2D(-0.309017,-0.951057), Point2D(0,-1), Point2D(0.309017,-0.951057), Point2D(0.587785,-0.809017), Point2D(0.809017,-0.587785), Point2D(0.951057,-0.309017), Point2D(1,0), Point2D(0.951057,0.309017), Point2D(0.809017,0.587785), Point2D(0.587785,0.809017), Point2D(0.309017,0.951057) }
Unit vectors rotated around origin, in $ \frac{\pi}{10} $ increments, counter-clockwise.

0 = North. This table can be used to accelerate the trigonomic operations within the tile subdivision process, since all angles can only take these values.

Definition at line 624 of file quasisampler_prototype.h.


The documentation for this class was generated from the following file:
Generated on Wed Aug 18 12:37:51 2004 for Quasi-Sampler by doxygen 1.3.7