Cutout Vis2012
TUWienVisualisierung2(SS2012)-AdaptiveCutaways
 All Classes Namespaces Functions Pages
Static Public Member Functions | List of all members
JumpFlooding Class Reference

#include <JumpFlooding.h>

Static Public Member Functions

static void init ()
 
static void createDistanceTransformBuffers (Framebuffer &fbo1, Framebuffer &fbo2, int width, int height)
 
static FramebufferapplyDistanceTransform (Framebuffer *src, Framebuffer *dst)
 
static void beginMeshWriting (Framebuffer *src, Framebuffer *dst)
 
static void endMeshWriting ()
 
static ShadergetMeshShader ()
 

Detailed Description

Implements a generalized distance transform on greyscale images on the GPU, as detailed in this thesis.

Member Function Documentation

Framebuffer * JumpFlooding::applyDistanceTransform ( Framebuffer src,
Framebuffer dst 
)
static

Takes two Framebuffers that have been initialized by createDistanceTransformBuffers together. src contains the input texture. The Framebuffer that contains the end result is returned. Depending on the number of iterations, this can be either src or dst. GL_DEPTH_TEST is disabled by the method. Viewport is set to the size of src.

The src Framebuffer should only have been drawn to with the Shader returned by getMeshShader.

void JumpFlooding::beginMeshWriting ( Framebuffer src,
Framebuffer dst 
)
static

Call before drawing models into the source buffer. The shader and framebuffer will be bound by this function. Between the begin and end call, render meshes and set the modelView, perspective, maxTheta, directional and edgeCompression uniform in the mesh shader.

void JumpFlooding::createDistanceTransformBuffers ( Framebuffer fbo1,
Framebuffer fbo2,
int  width,
int  height 
)
static

Takes two uninitialized framebuffer objects and initializes them to be used for distance transforms

void JumpFlooding::endMeshWriting ( )
static

Call to finish writing data into the src Framebuffer

Shader * JumpFlooding::getMeshShader ( )
static

Returns the shader bound by beginMeshWriting(), use it to set modelView and perspective matrices

void JumpFlooding::init ( )
static

Call this before any other methods from this class


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