|
The Vish Visualization Shell 0.3
Vish
|
A colormap can be used in two ways: as 1D texture, or as colortable. More...
#include <ocean/GLvish/VGLColormap.hpp>
Static Public Member Functions | |
| static void | Disable (const RefPtr< Colormap > &Cmap) |
| Disable this colormap, i.e. | |
| static bool | Enable (const RefPtr< Colormap > &Cmap, const RefPtr< GLTexture1D > &CmapTexture, const bool clampP, bool Discrete) |
| Enable this colormap, as 1D texture or as colortable. | |
| static RefPtr< GLTexture1D > | Enable (const RefPtr< Colormap > &Cmap, TextureCreator &CmapTC, int TextureUnit, const bool clampP=true, bool Discrete=false) |
| Activate a 1D texture from the virtual color values and put these into the specified texture creator. | |
| static bool | EnableColorTable (const RefPtr< Colormap > &Cmap) |
| Explicitly load the colormap as OpenGL ColorTable. | |
A colormap can be used in two ways: as 1D texture, or as colortable.
Which method to use depends on the usage scenario:
Loading as Colortable: When pixels are rendered via a luminance texture, the colortable may be used to map these scalar values to RGB or RGBA values. This mode does not require to set data per pixel, but works indirectly via specifying 2D texture coordinates for the luminance texture. Note that when changing the colormap, the 2D luminance texture needs to be reloaded, due to the way the OpenGL PixelTransfer() function works. Consequently, original data need to be accessed from RAM (or disc).
Activate this colormap in specified shader program under the given name and specified texture unit.
Typical usage scenario:
This example uses the GLCache of the VRenderContext to store the textures. A colormap requires an OpenGL texture to store its values. This texture needs to be stored somewhere. In theory, it could also be stored in the object's local State object. This would work well when the program is run, but the problem occurs during destruction: The texture object needs to be destroyed within an OpenGL context, but the VObject's local state doesn't have one. The GLCache however will be destructed in an OpenGL context and therefore must be used for proper clean up. Otherwise, the application will terminate with a segfault when closing.
|
static |
Enable this colormap, as 1D texture or as colortable.
| Cmap1D | If a valid pointer, set the colormap as 1D texture, otherwise as a colortable. |
| clampP | clamp values, not repeating |
| Discrete | A flag to tell if the colormap shall be interpolated or not. |
References Disable(), and Eagle::FixedArray< value, N >::ptr().
Referenced by Enable().
|
static |
Activate a 1D texture from the virtual color values and put these into the specified texture creator.
| CmapTC | The Texture creator, as retrieved from an OpenGL Cache |
| TextureUnit | The Texture unit (OpenGL ActiveTexture) which is to be used for this texture. |
| clampP | clamp values, not repeating |
References Enable(), Wizt::TextureCreator::get(), and MemCore::ReferenceBase< Object >::self().