de.grogra.ray2.antialiasing
Class StochasticSupersampling

java.lang.Object
  extended by de.grogra.ray2.tracing.ProcessorBase
      extended by de.grogra.ray2.antialiasing.NoAntialiasing
          extended by de.grogra.ray2.antialiasing.StochasticSupersampling
All Implemented Interfaces:
Antialiasing, java.lang.Cloneable

public class StochasticSupersampling
extends NoAntialiasing

This class implements a stratified stochastic supersampling strategy. Each pixel rectangle is divided into a square grid of strata, for each stratum a random ray is generated and its color determined.

Author:
Michael Tauer, Ole Kniemeyer

Field Summary
static int CURRENT_I
           
static int CURRENT_J
           
static int DEBUG_I
           
static int DEBUG_J
           
static java.lang.String GRID_SIZE
           
 
Fields inherited from class de.grogra.ray2.antialiasing.NoAntialiasing
processor
 
Constructor Summary
StochasticSupersampling()
           
 
Method Summary
protected  void appendStatisticsImpl(java.lang.StringBuffer stats)
           
 void getColorOfRectangle(double x, double y, double width, double height, Color4f color, java.util.Random random)
          This method has to return a color value determined for a given rectangular region on the image plane.
 void initialize(PixelwiseRenderer tracer, Scene scene)
          Initializes the antialiasing method using the data available through the renderer.
protected  void initLocals()
           
 void setGridSize(int size)
          Sets the grid size for supersampling.
 
Methods inherited from class de.grogra.ray2.antialiasing.NoAntialiasing
dup, setPixelXY
 
Methods inherited from class de.grogra.ray2.tracing.ProcessorBase
appendStatistics, clone, mergeStatistics
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.grogra.ray2.antialiasing.Antialiasing
appendStatistics
 

Field Detail

CURRENT_I

public static int CURRENT_I

CURRENT_J

public static int CURRENT_J

DEBUG_I

public static int DEBUG_I

DEBUG_J

public static int DEBUG_J

GRID_SIZE

public static final java.lang.String GRID_SIZE
See Also:
Constant Field Values
Constructor Detail

StochasticSupersampling

public StochasticSupersampling()
Method Detail

appendStatisticsImpl

protected void appendStatisticsImpl(java.lang.StringBuffer stats)
Overrides:
appendStatisticsImpl in class NoAntialiasing

getColorOfRectangle

public void getColorOfRectangle(double x,
                                double y,
                                double width,
                                double height,
                                Color4f color,
                                java.util.Random random)
Description copied from interface: Antialiasing
This method has to return a color value determined for a given rectangular region on the image plane. The coordinates are understood as uv coordinates for the Sensor which represents the camera.

Specified by:
getColorOfRectangle in interface Antialiasing
Overrides:
getColorOfRectangle in class NoAntialiasing
Parameters:
x - Describes the x position of the lower left corner of the rectangle.
y - Describes the y position of the lower left corner of the rectangle.
width - width of the rectangle
height - height of the of the rectangle
color - The determined color of the rectangle will be stored in this parameter.
random - pseudorandom generator

initialize

public void initialize(PixelwiseRenderer tracer,
                       Scene scene)
Description copied from interface: Antialiasing
Initializes the antialiasing method using the data available through the renderer.

Specified by:
initialize in interface Antialiasing
Overrides:
initialize in class NoAntialiasing
Parameters:
tracer - the renderer which provides the needed information
scene - the scene which is rendered

initLocals

protected void initLocals()
Overrides:
initLocals in class NoAntialiasing

setGridSize

public void setGridSize(int size)
Sets the grid size for supersampling. A square grid of size by size strata will be used to generate the random rays.

Parameters:
size - size of the grid edges