MeVisLabToolboxReference
View2DShaderGLSL Class Reference

specialized shader that uses GLSL to implement a (up-to) 16 bit Hardware Lut More...

#include <View2DShaderGLSL.h>

Inheritance diagram for View2DShaderGLSL:
View2DTextureLUTShader View2DShader

List of all members.

Classes

struct  Shader
 Stores a full shader program for the given configuration. More...
struct  ShaderConfig
 Stores a shader configuration. More...

Public Member Functions

 View2DShaderGLSL ()
virtual ~View2DShaderGLSL ()
virtual void bind (View2DTexture *texture, int tw, int th)
 binds/activates the shader
const char * name ()
 get the shader's name
virtual void unbind ()
 deactivates the shader

Static Public Member Functions

static bool mayUseShaders ()
 returns if GLSL shaders may be used
static bool runsInHardware ()
 returns if the shader is supported and would run in hardware (calling this method requires a valid GL context!)

Detailed Description

specialized shader that uses GLSL to implement a (up-to) 16 bit Hardware Lut

The RGBA LookupTable is loaded into a 2D texture of 256 pixels width and dynamic height. The texture lookups and color interpolation is done with two "assembly" fragment programs, one for bilinear interpolation and one for nearest neigbor interpolation. The shader interacts with the View2DTexture and it's bind message is called by each subtexture that the View2DTexture renders. This is done because the size of the textures changes and this size is needed as local parameters in the fragment program.

Definition at line 31 of file View2DShaderGLSL.h.


Constructor & Destructor Documentation

View2DShaderGLSL::View2DShaderGLSL ( )
virtual View2DShaderGLSL::~View2DShaderGLSL ( ) [virtual]

Member Function Documentation

virtual void View2DShaderGLSL::bind ( View2DTexture texture,
int  tw,
int  th 
) [virtual]

binds/activates the shader

Implements View2DShader.

static bool View2DShaderGLSL::mayUseShaders ( ) [static]

returns if GLSL shaders may be used

const char* View2DShaderGLSL::name ( ) [inline, virtual]

get the shader's name

Implements View2DShader.

Definition at line 79 of file View2DShaderGLSL.h.

static bool View2DShaderGLSL::runsInHardware ( ) [static]

returns if the shader is supported and would run in hardware (calling this method requires a valid GL context!)

virtual void View2DShaderGLSL::unbind ( ) [virtual]

deactivates the shader

Implements View2DShader.


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