MeVisLab Resolution Independence API
SoImageSampler Class Referenceabstract

The abstract Inventor class SoImageSampler. More...

#include <SoImageSampler.h>

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

Public Member Functions

void updateParameter (SoUniformParameterBase *uniformBase, SoState *state) override
 Assigns or updates the parameter's value.
 
- Public Member Functions inherited from SoSampler
void updateParameter (SoUniformParameterBase *uniformBase, SoState *state) override
 Assigns or updates the parameter's value.
 
- Public Member Functions inherited from SoUniformShaderParameter
void GLRender (SoGLRenderAction *action) override
 Add this node to element in state.
 
virtual void updatePreparation (SoState *)
 Hook for internal preparation steps.
 
- Public Member Functions inherited from SoShaderParameter
void callback (SoCallbackAction *) override
 Shut down handling of these actions for children.
 
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.
 
- Static Public Member Functions inherited from SoSampler
static void initClass ()
 Initialize class with runtime type system.
 
- Static Public Member Functions inherited from SoUniformShaderParameter
static void initClass ()
 Initialize class with runtime type system.
 
- Static Public Member Functions inherited from SoShaderParameter
static void initClass ()
 Initialize class with runtime type system.
 

Protected Member Functions

 SoImageSampler ()
 Constructor.
 
 ~SoImageSampler () override
 Destructor.
 
virtual void freeTextureBuffer ()
 Delete the texture buffer(s).
 
virtual void updateTextureHandle ()
 Creates texture handle and binds it.
 
virtual void updateTextureFilteringParameters ()
 Sets parameters for texture filtering.
 
virtual void updateTextureWrappingParameters ()
 Sets parameters for texture wrapping in OpenGL.
 
virtual void uploadTextureBuffer ()
 Uploads data stored in _textureBuffer using setGLTexImage.
 
virtual void uploadDummyTexture (GLenum target)
 Upload a dummy texture consisting of one black voxel using setGLTexImage.
 
virtual void generateMipmap ()
 Generates mipmap.
 
virtual void setGLTexImage (GLenum target, const XVImageSize &textureSize, GLint internalFormat, GLint format, GLenum textureDataType, const GLvoid *textureData)=0
 Set the OpenGL texture.
 
virtual void updateTextureBuffer ()
 Calls imageChanged() if _textureBuffer is empty.
 
virtual void updateSamplerInfo (SoUniformParameterBase *uniformBase, SoState *state)
 Set info about the purpose of the uniform parameter and add info about sampler to state.
 
virtual void imageChanged ()=0
 Called when the image has changed and is valid.
 
- Protected Member Functions inherited from SoSampler
 ~SoSampler () override
 
 SoSampler ()
 Constructor.
 
GLint getInternalFormat (GLenum glDataType)
 Return specialized texture format for GL data type.
 
const char * getTextureFormatName (GLenum internalFormat)
 Return texture format name.
 
SbSamplerInfo::TextureType getTextureTypeFromGLFormat (GLenum internalFormat)
 
void postTextureFormatInfo (GLenum target, GLint format)
 Prints channel depths for given target and format.
 
void postTextureSizeInfo (GLenum target)
 Prints the size of the bound texture.
 
virtual void nameChanged (SoField *field)
 Called when sampler name has changed.
 
virtual void texConfigChanged (SoField *)
 Called when texture configuration (e.g. filter mode) has changed.
 
- Protected Member Functions inherited from SoUniformShaderParameter
 SoUniformShaderParameter ()
 Constructor.
 
- Protected Member Functions inherited from SoShaderParameter
 SoShaderParameter ()
 Constructor.
 

Protected Attributes

ml::GLTexture _textureRes
 
MLuint8 * _textureBuffer
 Buffered texture that is uploaded.
 
SbBool _isTextureModified
 Indicates changes in the internal texture.
 
SbSamplerInfo::TextureType _internTexFormat
 Value points to internal texture format.
 
XVImageSize _textureSize
 size of the internal texture
 
GLenum _target
 Specifies the target to which the texture is bound.
 
SoUniformParameterBase::SamplerType _samplerType
 Specifies the sampler type. Must be either SAMPLER_1D, SAMPLER_2D, SAMPLER_3D or SAMPLER_CUBEMAP.
 
- Protected Attributes inherited from SoSampler
SbBool _hasTextureFloat
 TRUE if GL_xxx_texture_float extension is present.
 
SbString _sizeUniformName
 name of the uniform ?_size parameter
 
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...
 
- Public Attributes inherited from SoSampler
SoSFEnum wrapS
 Wrapping mode. Default is REPEAT.
 
SoSFBool enableBorder
 Enable border to be part of the texture. Default is FALSE.
 
SoSFVec4f borderColor
 Border color used to for border texture filtering. Only used if 'enableBorder' is FALSE. Default is (0, 0, 0, 0).
 
SoSFEnum minFilter
 Minification filter mode. Default is LINEAR.
 
SoSFEnum magFilter
 Magnification filter mode. Default is LINEAR.
 
SoSFBool use16BitFloat
 Use 16 Bit floating point for the texture format.
 
SoSFBool needsTextureCoordinates
 Enable this if the sampler needs the standard inventor texture coordinates.
 
- Public Attributes inherited from SoUniformShaderParameter
std::set< SbString > auxUniformParameters
 Auxiliary uniform shader parameters which are maintained by this node.
 
- Public Attributes inherited from SoShaderParameter
SoSFString name
 Name given to parameter in high level languages.
 

Detailed Description

The abstract Inventor class SoImageSampler.

Abstract Open Inventor base class for sampler nodes that provide access to some kind of explicit input image (in contrast to frame buffer samplers) Abstract Open Inventor base class for sampler nodes.

Definition at line 29 of file SoImageSampler.h.

Constructor & Destructor Documentation

◆ SoImageSampler()

SoImageSampler::SoImageSampler ( )
protected

Constructor.

◆ ~SoImageSampler()

SoImageSampler::~SoImageSampler ( )
overrideprotected

Destructor.

Member Function Documentation

◆ freeTextureBuffer()

virtual void SoImageSampler::freeTextureBuffer ( )
protectedvirtual

Delete the texture buffer(s).

Reimplemented in SoMLSamplerCubeMap.

◆ generateMipmap()

virtual void SoImageSampler::generateMipmap ( )
protectedvirtual

Generates mipmap.

◆ imageChanged()

virtual void SoImageSampler::imageChanged ( )
protectedpure virtual

Called when the image has changed and is valid.

Implemented in SoMLSampler.

◆ initClass()

static void SoImageSampler::initClass ( )
static

Initialize class with runtime type system.

◆ setGLTexImage()

virtual void SoImageSampler::setGLTexImage ( GLenum target,
const XVImageSize & textureSize,
GLint internalFormat,
GLint format,
GLenum textureDataType,
const GLvoid * textureData )
protectedpure virtual

Set the OpenGL texture.

Implemented in SoMLSampler1D, SoMLSampler2D, SoMLSampler3D, and SoMLSamplerCubeMap.

◆ updateParameter()

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

Assigns or updates the parameter's value.

Implements SoUniformShaderParameter.

Reimplemented in SoMLSampler.

◆ updateSamplerInfo()

virtual void SoImageSampler::updateSamplerInfo ( SoUniformParameterBase * uniformBase,
SoState * state )
protectedvirtual

Set info about the purpose of the uniform parameter and add info about sampler to state.

◆ updateTextureBuffer()

virtual void SoImageSampler::updateTextureBuffer ( )
protectedvirtual

Calls imageChanged() if _textureBuffer is empty.

Reimplemented in SoMLSamplerCubeMap.

◆ updateTextureFilteringParameters()

virtual void SoImageSampler::updateTextureFilteringParameters ( )
protectedvirtual

Sets parameters for texture filtering.

◆ updateTextureHandle()

virtual void SoImageSampler::updateTextureHandle ( )
protectedvirtual

Creates texture handle and binds it.

◆ updateTextureWrappingParameters()

virtual void SoImageSampler::updateTextureWrappingParameters ( )
protectedvirtual

Sets parameters for texture wrapping in OpenGL.

Implemented for s dimension Derived classes should add wrapping for additional dimensions

Reimplemented in SoMLSampler2D, and SoMLSampler3D.

◆ uploadDummyTexture()

virtual void SoImageSampler::uploadDummyTexture ( GLenum target)
protectedvirtual

Upload a dummy texture consisting of one black voxel using setGLTexImage.

◆ uploadTextureBuffer()

virtual void SoImageSampler::uploadTextureBuffer ( )
protectedvirtual

Uploads data stored in _textureBuffer using setGLTexImage.

Reimplemented in SoMLSamplerCubeMap.

Member Data Documentation

◆ _internTexFormat

SbSamplerInfo::TextureType SoImageSampler::_internTexFormat
protected

Value points to internal texture format.

Definition at line 96 of file SoImageSampler.h.

◆ _isTextureModified

SbBool SoImageSampler::_isTextureModified
protected

Indicates changes in the internal texture.

Definition at line 93 of file SoImageSampler.h.

◆ _samplerType

SoUniformParameterBase::SamplerType SoImageSampler::_samplerType
protected

Specifies the sampler type. Must be either SAMPLER_1D, SAMPLER_2D, SAMPLER_3D or SAMPLER_CUBEMAP.

Definition at line 108 of file SoImageSampler.h.

◆ _target

GLenum SoImageSampler::_target
protected

Specifies the target to which the texture is bound.

Must be set by the derived class! Must be one of GL_TEXTURE_1D, GL_TEXTURE_2D, GL_TEXTURE_3D, GL_TEXTURE_1D_ARRAY, GL_TEXTURE_2D_ARRAY, GL_TEXTURE_RECTANGLE, GL_TEXTURE_CUBE_MAP, GL_TEXTURE_CUBE_MAP_ARRAY, GL_TEXTURE_BUFFER, GL_TEXTURE_2D_MULTISAMPLE or GL_TEXTURE_2D_MULTISAMPLE_ARRAY.

Definition at line 105 of file SoImageSampler.h.

◆ _textureBuffer

MLuint8* SoImageSampler::_textureBuffer
protected

Buffered texture that is uploaded.

Definition at line 90 of file SoImageSampler.h.

◆ _textureRes

ml::GLTexture SoImageSampler::_textureRes
protected

Definition at line 87 of file SoImageSampler.h.

◆ _textureSize

XVImageSize SoImageSampler::_textureSize
protected

size of the internal texture

Definition at line 99 of file SoImageSampler.h.


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