View2DShaderARB Class Reference

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

#include <View2DShaderARB.h>

Inheritance diagram for View2DShaderARB:

View2DTextureLUTShader View2DShader

List of all members.

Public Member Functions

 View2DShaderARB ()
virtual ~View2DShaderARB ()
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
virtual void destroy ()
 destroy the previous shader

Static Public Member Functions

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

Protected Member Functions

virtual bool create (View2DTexture *texture)
 creates the desired shader
bool create (const char *shader, ml::GLFragmentProgramARB &program)
 creates the shader and sets program to the id of the shader, returns true if the shaders are supported in hardware
void createCubicShader (std::stringstream &str, bool use16BitLut)
void createNearestShader (std::stringstream &str, bool use16BitLut)
void createLinearShader (std::stringstream &str, bool use16BitLut)

Protected Attributes

ml::GLFragmentProgramARB _currentShader
 the vertex program id
View2DTextureFilter _lastFilter
size_t _lastDataSize


Detailed Description

specialized shader that uses ARB_fragment_program 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 29 of file View2DShaderARB.h.


Constructor & Destructor Documentation

View2DShaderARB::View2DShaderARB (  ) 

virtual View2DShaderARB::~View2DShaderARB (  )  [virtual]


Member Function Documentation

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

binds/activates the shader

Implements View2DShader.

bool View2DShaderARB::create ( const char *  shader,
ml::GLFragmentProgramARB &  program 
) [protected]

creates the shader and sets program to the id of the shader, returns true if the shaders are supported in hardware

virtual bool View2DShaderARB::create ( View2DTexture texture  )  [protected, virtual]

creates the desired shader

void View2DShaderARB::createCubicShader ( std::stringstream &  str,
bool  use16BitLut 
) [protected]

void View2DShaderARB::createLinearShader ( std::stringstream &  str,
bool  use16BitLut 
) [protected]

void View2DShaderARB::createNearestShader ( std::stringstream &  str,
bool  use16BitLut 
) [protected]

virtual void View2DShaderARB::destroy (  )  [virtual]

destroy the previous shader

Implements View2DShader.

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

get the shader's name

Implements View2DShader.

Definition at line 39 of file View2DShaderARB.h.

static bool View2DShaderARB::runsInHardware (  )  [static]

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

virtual void View2DShaderARB::unbind (  )  [virtual]

deactivates the shader

Implements View2DShader.


Member Data Documentation

ml::GLFragmentProgramARB View2DShaderARB::_currentShader [protected]

the vertex program id

Definition at line 62 of file View2DShaderARB.h.

size_t View2DShaderARB::_lastDataSize [protected]

Definition at line 64 of file View2DShaderARB.h.

Definition at line 63 of file View2DShaderARB.h.


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

Generated on Sat Sep 3 18:39:33 2011 for MeVisLab Toolbox Reference by  doxygen 1.5.8