MeVisLab Toolbox Reference
|
specialized shader that uses GLSL to implement a (up-to) 16 bit Hardware Lut More...
#include <View2DShaderGLSL.h>
Classes | |
struct | Shader |
Stores a full shader program for the given configuration. More... | |
struct | ShaderConfig |
Stores a shader configuration. More... | |
Public Member Functions | |
View2DShaderGLSL () | |
~View2DShaderGLSL () override | |
void | bind (View2DTexture *texture, int tw, int th) override |
binds/activates the shader More... | |
const char * | name () override |
get the shader's name More... | |
void | unbind () override |
deactivates the shader More... | |
![]() | |
View2DTextureLUTShader () | |
~View2DTextureLUTShader () override | |
void | bindFilterKernelTexture () override |
bind the filter kernel texture More... | |
void | bindLutTexture () override |
bind the lut texture to the current texture unit More... | |
float | getLutHeightScaleFactor () override |
SbVec2s | getLutTextureSize () override |
![]() | |
View2DShader () | |
virtual | ~View2DShader () |
virtual void | getRequiredTextureLayout (View2DTexture *texture, GLuint &format, GLuint &internalFormat, GLuint &transferDataType) |
returns the required texture layout that a GL texture must use, as GL_format enums and datatypes More... | |
virtual void | setLut (View2DLut *newLut) |
sets the lut currently used More... | |
View2DLut * | getLut () |
gets the lut More... | |
void | invalidateLut () |
invalidate the lut More... | |
Static Public Member Functions | |
static bool | mayUseShaders () |
returns if GLSL shaders may be used More... | |
static bool | runsInHardware () |
returns if the shader is supported and would run in hardware (calling this method requires a valid GL context!) More... | |
![]() | |
static void | applyTextureFilter (View2DTextureFilter filter) |
set the correct texture filtering on the currently bound texture More... | |
Additional Inherited Members | |
![]() | |
void | createLutTexture () |
creates a 2D texture from the shader's LUT More... | |
void | updateLutTexture () |
upload the lut to the texture (texture must be already created) More... | |
void | destroyLutTexture () |
frees the lut texture More... | |
void | createFilterKernelTexture () |
create 1d filter kernel texture (using the approach described in section 20.2 of GPU Gems 2) More... | |
void | destroyFilterKernelTexture () |
destroy the filter kernel More... | |
![]() | |
static GLint | desiredLutTextureFormat () |
![]() | |
ml::GLTexture | _lutTexture |
texture that stores the LUT data More... | |
GLint | _lutTextureFormat |
ml::GLTexture | _kernelTexture |
int | _lutTextureWidth |
power-of-two width of lut texture More... | |
int | _lutTextureHeight |
power-of-two height of lut texture More... | |
int | _lutHeight |
number of COMPLETE texture rows used by the LUT (an additional row may be used partly) More... | |
![]() | |
View2DLut * | _lut |
pointer to the LUT data More... | |
ml::LUTDataId | _lastLutChangeID |
id of last lut More... | |
int | _lastLutSize |
last size of lut More... | |
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 32 of file View2DShaderGLSL.h.
View2DShaderGLSL::View2DShaderGLSL | ( | ) |
|
override |
|
overridevirtual |
binds/activates the shader
Implements View2DShader.
|
static |
returns if GLSL shaders may be used
|
overridevirtual |
get the shader's name
Implements View2DShader.
|
static |
returns if the shader is supported and would run in hardware (calling this method requires a valid GL context!)
|
overridevirtual |
deactivates the shader
Implements View2DShader.