MeVisLab Toolbox Reference
SoMLSampler Class Referenceabstract

Abstract base class for sampler nodes that handle ML images. More...

#include <SoMLSampler.h>

Inheritance diagram for SoMLSampler:
SoImageSampler SoSampler SoUniformShaderParameter SoShaderParameter SoMLSampler1D SoMLSampler2D SoMLSampler3D SoMLSamplerCubeMap

Public Member Functions

void GLRender (SoGLRenderAction *action) override
 Set ML image properties in state. More...
 
void updateParameter (SoUniformParameterBase *uniformBase, SoState *state) override
 Assigns or updates the parameter's value. More...
 
- Public Member Functions inherited from SoSampler
void updateParameter (SoUniformParameterBase *uniformBase, SoState *state) override
 Assigns or updates the parameter's value. More...
 
- Public Member Functions inherited from SoUniformShaderParameter
void GLRender (SoGLRenderAction *action) override
 Add this node to element in state. More...
 
virtual void updatePreparation (SoState *)
 Hook for internal preparation steps. More...
 
- Public Member Functions inherited from SoShaderParameter
void callback (SoCallbackAction *) override
 Shut down handling of these actions for children. More...
 
void GLRender (SoGLRenderAction *) override
 
void getBoundingBox (SoGetBoundingBoxAction *) override
 
void getMatrix (SoGetMatrixAction *) override
 
void handleEvent (SoHandleEventAction *) override
 
void pick (SoPickAction *) override
 

Static Public Member Functions

static void initClass ()
 Initialize class with runtime type system. More...
 
- Static Public Member Functions inherited from SoImageSampler
static void initClass ()
 Initialize class with runtime type system. More...
 
- Static Public Member Functions inherited from SoSampler
static void initClass ()
 Initialize class with runtime type system. More...
 
- Static Public Member Functions inherited from SoUniformShaderParameter
static void initClass ()
 Initialize class with runtime type system. More...
 
- Static Public Member Functions inherited from SoShaderParameter
static void initClass ()
 Initialize class with runtime type system. More...
 

Public Attributes

SoSFMLImage image
 ML image connector. More...
 
SoSFUInt32 startT
 Origin of the image in T dimension. Default is 0. More...
 
SoSFUInt32 startU
 Origin of the image in U dimension. Default is 0. More...
 
- Public Attributes inherited from SoSampler
SoSFEnum wrapS
 Wrapping mode. Default is REPEAT. More...
 
SoSFBool enableBorder
 Enable border to be part of the texture. Default is FALSE. More...
 
SoSFVec4f borderColor
 Border color used to for border texture filtering. Only used if 'enableBorder' is FALSE. Default is (0, 0, 0, 0). More...
 
SoSFEnum minFilter
 Minification filter mode. Default is LINEAR. More...
 
SoSFEnum magFilter
 Magnification filter mode. Default is LINEAR. More...
 
SoSFBool use16BitFloat
 Use 16 Bit floating point for the texture format. More...
 
SoSFBool needsTextureCoordinates
 Enable this if the sampler needs the standard inventor texture coordinates. More...
 
- Public Attributes inherited from SoUniformShaderParameter
std::set< SbString > auxUniformParameters
 Auxiliary uniform shader parameters which are maintained by this node. More...
 
- Public Attributes inherited from SoShaderParameter
SoSFString name
 Name given to parameter in high level languages. More...
 

Protected Member Functions

 SoMLSampler ()
 Constructor. More...
 
 ~SoMLSampler () override
 Destructor. More...
 
GLenum MLToGLDataType (const MLDataType &dType)
 Return OpenGL data type for given ML data type. Returns GL_NONE for unknown ML data types. More...
 
MLuint8loadAndReformatSubImg (const XVImageSize &pos, const XVImageSize &size)
 Load ML image and reformat memory to be suitable for OpenGL texturing. More...
 
void texConfigChanged (SoField *field) override
 Called when texture configuration (e.g. filter mode) has changed. More...
 
void imageChanged () override
 Called when the ML images has changed. More...
 
void imageChangedCB (SoField *field)
 
virtual void calcSubImgProps (XVImageSize &subImgPosition, XVImageSize &subImgSize)=0
 Calculate position and size of used sub image by evaluation of fields. More...
 
virtual void getTextureDataFromImage (const XVImageSize &pos, const XVImageSize &size)
 Extract the texture data from the input ML image and store it in the textureData buffer. More...
 
- Protected Member Functions inherited from SoImageSampler
 SoImageSampler ()
 Constructor. More...
 
 ~SoImageSampler () override
 Destructor. More...
 
virtual void freeTextureBuffer ()
 Delete the texture buffer(s). More...
 
virtual void updateTextureHandle ()
 Creates texture handle and binds it. More...
 
virtual void updateTextureFilteringParameters ()
 Sets parameters for texture filtering. More...
 
virtual void updateTextureWrappingParameters ()
 Sets parameters for texture wrapping in OpenGL. More...
 
virtual void uploadTextureBuffer ()
 Uploads data stored in _textureBuffer using setGLTexImage. More...
 
virtual void uploadDummyTexture (GLenum target)
 Upload a dummy texture consisting of one black voxel using setGLTexImage. More...
 
virtual void generateMipmap ()
 Generates mipmap. More...
 
virtual void setGLTexImage (GLenum target, const XVImageSize &textureSize, GLint internalFormat, GLint format, GLenum textureDataType, const GLvoid *textureData)=0
 Set the OpenGL texture. More...
 
virtual void updateTextureBuffer ()
 Calls imageChanged() if _textureBuffer is empty. More...
 
virtual void updateSamplerInfo (SoUniformParameterBase *uniformBase, SoState *state)
 Set info about the purpose of the uniform parameter and add info about sampler to state. More...
 
- Protected Member Functions inherited from SoSampler
 ~SoSampler () override
 
 SoSampler ()
 Constructor. More...
 
GLint getInternalFormat (GLenum glDataType)
 Return specialized texture format for GL data type. More...
 
const char * getTextureFormatName (GLenum internalFormat)
 Return texture format name. More...
 
SbSamplerInfo::TextureType getTextureTypeFromGLFormat (GLenum internalFormat)
 
void postTextureFormatInfo (GLenum target, GLint format)
 Prints channel depths for given target and format. More...
 
void postTextureSizeInfo (GLenum target)
 Prints the size of the bound texture. More...
 
virtual void nameChanged (SoField *field)
 Called when sampler name has changed. More...
 
- Protected Member Functions inherited from SoUniformShaderParameter
 SoUniformShaderParameter ()
 Constructor. More...
 
- Protected Member Functions inherited from SoShaderParameter
 SoShaderParameter ()
 Constructor. More...
 

Protected Attributes

SbSamplerInfo::TextureType _internTexFormat
 Value points to internal texture format. More...
 
SbMLImageProperties _imgProps
 ML image properties. More...
 
- Protected Attributes inherited from SoImageSampler
ml::GLTexture _textureRes
 
MLuint8_textureBuffer
 Buffered texture that is uploaded. More...
 
SbBool _isTextureModified
 Indicates changes in the internal texture. More...
 
SbSamplerInfo::TextureType _internTexFormat
 Value points to internal texture format. More...
 
XVImageSize _textureSize
 size of the internal texture More...
 
GLenum _target
 Specifies the target to which the texture is bound. More...
 
SoUniformParameterBase::SamplerType _samplerType
 Specifies the sampler type. Must be either SAMPLER_1D, SAMPLER_2D, SAMPLER_3D or SAMPLER_CUBEMAP. More...
 
- Protected Attributes inherited from SoSampler
SbBool _hasTextureFloat
 TRUE if GL_xxx_texture_float extension is present. More...
 
SbString _sizeUniformName
 name of the uniform ?_size parameter More...
 
unsigned int _textureComponents
 
GLenum _textureDataType
 

Additional Inherited Members

- Public Types inherited from SoSampler
enum  TexGenMode { NORMAL_MAP = GL_NORMAL_MAP_EXT , REFLECTION_MAP = GL_REFLECTION_MAP_EXT }
 Texture gen mode. More...
 
enum  Wrap {
  REPEAT = GL_REPEAT , CLAMP = GL_CLAMP , CLAMP_TO_EDGE = GL_CLAMP_TO_EDGE , CLAMP_TO_BORDER = GL_CLAMP_TO_BORDER ,
  MIRRORED_REPEAT = GL_MIRRORED_REPEAT
}
 Texture wrap type. More...
 
enum  Filter {
  NEAREST = GL_NEAREST , LINEAR = GL_LINEAR , NEAREST_MIPMAP_NEAREST = GL_NEAREST_MIPMAP_NEAREST , NEAREST_MIPMAP_LINEAR = GL_NEAREST_MIPMAP_LINEAR ,
  LINEAR_MIPMAP_NEAREST = GL_LINEAR_MIPMAP_NEAREST , LINEAR_MIPMAP_LINEAR = GL_LINEAR_MIPMAP_LINEAR
}
 Filter methods for minification and magnification. More...
 

Detailed Description

Abstract base class for sampler nodes that handle ML images.

Abstract base class for sampler nodes that handle ML images.

Definition at line 26 of file SoMLSampler.h.

Constructor & Destructor Documentation

◆ SoMLSampler()

SoMLSampler::SoMLSampler ( )
protected

Constructor.

◆ ~SoMLSampler()

SoMLSampler::~SoMLSampler ( )
overrideprotected

Destructor.

Member Function Documentation

◆ calcSubImgProps()

virtual void SoMLSampler::calcSubImgProps ( XVImageSize subImgPosition,
XVImageSize subImgSize 
)
protectedpure virtual

Calculate position and size of used sub image by evaluation of fields.

Implemented in SoMLSamplerCubeMap, SoMLSampler3D, SoMLSampler2D, and SoMLSampler1D.

◆ getTextureDataFromImage()

virtual void SoMLSampler::getTextureDataFromImage ( const XVImageSize pos,
const XVImageSize size 
)
protectedvirtual

Extract the texture data from the input ML image and store it in the textureData buffer.

Reimplemented in SoMLSamplerCubeMap.

◆ GLRender()

void SoMLSampler::GLRender ( SoGLRenderAction *  action)
override

Set ML image properties in state.

◆ imageChanged()

void SoMLSampler::imageChanged ( )
overrideprotectedvirtual

Called when the ML images has changed.

Implements SoImageSampler.

◆ imageChangedCB()

void SoMLSampler::imageChangedCB ( SoField *  field)
protected

◆ initClass()

static void SoMLSampler::initClass ( )
static

Initialize class with runtime type system.

◆ loadAndReformatSubImg()

MLuint8* SoMLSampler::loadAndReformatSubImg ( const XVImageSize pos,
const XVImageSize size 
)
protected

Load ML image and reformat memory to be suitable for OpenGL texturing.

Returns NULL on error, otherwise a pointer to the allocated memory is given.

◆ MLToGLDataType()

GLenum SoMLSampler::MLToGLDataType ( const MLDataType dType)
protected

Return OpenGL data type for given ML data type. Returns GL_NONE for unknown ML data types.

◆ texConfigChanged()

void SoMLSampler::texConfigChanged ( SoField *  field)
overrideprotectedvirtual

Called when texture configuration (e.g. filter mode) has changed.

Reimplemented from SoSampler.

◆ updateParameter()

void SoMLSampler::updateParameter ( SoUniformParameterBase uniformBase,
SoState *  state 
)
overridevirtual

Assigns or updates the parameter's value.

Reimplemented from SoImageSampler.

Member Data Documentation

◆ _imgProps

SbMLImageProperties SoMLSampler::_imgProps
protected

ML image properties.

Definition at line 63 of file SoMLSampler.h.

◆ _internTexFormat

SbSamplerInfo::TextureType SoMLSampler::_internTexFormat
protected

Value points to internal texture format.

Definition at line 59 of file SoMLSampler.h.

◆ image

SoSFMLImage SoMLSampler::image

ML image connector.

Definition at line 35 of file SoMLSampler.h.

◆ startT

SoSFUInt32 SoMLSampler::startT

Origin of the image in T dimension. Default is 0.

Definition at line 38 of file SoMLSampler.h.

◆ startU

SoSFUInt32 SoMLSampler::startU

Origin of the image in U dimension. Default is 0.

Definition at line 41 of file SoMLSampler.h.


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