MeVisLab Resolution Independence API
Toggle main menu visibility
Loading...
Searching...
No Matches
SoMLSampler.h
Go to the documentation of this file.
1
/*************************************************************************************
2
**
3
** Copyright 2007, MeVis Medical Solutions AG
4
**
5
** The user may use this file in accordance with the license agreement provided with
6
** the Software or, alternatively, in accordance with the terms contained in a
7
** written agreement between the user and MeVis Medical Solutions AG.
8
**
9
** For further information use the contact form at https://www.mevislab.de/contact
10
**
11
**************************************************************************************/
12
13
#ifndef SO_MLSAMPLER_H
14
#define SO_MLSAMPLER_H
15
16
18
19
#include "
SoShaderSystem.h
"
20
#include "
Inventor/nodes/SoImageSampler.h
"
21
#include <Inventor/elements/SoMLImageElement.h>
22
#include <
SoSFMLImage.h
>
23
24
26
SoEXTENDER
class
INVENTOR_SHADER_API
SoMLSampler
:
public
SoImageSampler
27
{
28
typedef
SoImageSampler
inherited;
29
30
SO_NODE_ABSTRACT_HEADER(
SoMLSampler
);
31
32
public
:
34
SoSFMLImage
image
;
35
37
SoSFUInt32
startT
;
38
40
SoSFUInt32
startU
;
41
42
SoEXTENDER public :
43
45
void
GLRender
(SoGLRenderAction* action)
override
;
46
48
void
updateParameter
(
SoUniformParameterBase
* uniformBase, SoState* state)
override
;
49
50
SoINTERNAL public :
51
53
static
void
initClass
();
54
55
protected
:
57
SbSamplerInfo::TextureType
_internTexFormat
;
58
59
61
SbMLImageProperties
_imgProps
;
62
64
SoMLSampler
();
65
67
~SoMLSampler
()
override
;
68
70
GLenum
MLToGLDataType
(
const
MLDataType& dType);
71
74
MLuint8*
loadAndReformatSubImg
(
const
XVImageSize
& pos,
const
XVImageSize
& size);
75
77
void
texConfigChanged
(SoField* field)
override
;
78
80
void
imageChanged
()
override
;
81
void
imageChangedCB
(SoField* field);
82
84
virtual
void
calcSubImgProps
(
XVImageSize
& subImgPosition,
XVImageSize
& subImgSize) = 0;
85
87
virtual
void
getTextureDataFromImage
(
const
XVImageSize
& pos,
const
XVImageSize
& size);
88
};
89
90
#endif
// _SO_ML_SAMPLER_
SoImageSampler.h
SoSFMLImage.h
SoShaderSystem.h
INVENTOR_SHADER_API
#define INVENTOR_SHADER_API
Define class export specifier.
Definition
SoShaderSystem.h:20
SbSamplerInfo::TextureType
TextureType
Texture type.
Definition
SoSamplerInfoElement.h:29
SoImageSampler::SoImageSampler
SoImageSampler()
Constructor.
SoMLSampler::imageChangedCB
void imageChangedCB(SoField *field)
SoMLSampler::image
SoSFMLImage image
ML image connector.
Definition
SoMLSampler.h:34
SoMLSampler::initClass
static void initClass()
Initialize class with runtime type system.
SoMLSampler::_internTexFormat
SbSamplerInfo::TextureType _internTexFormat
Value points to internal texture format.
Definition
SoMLSampler.h:57
SoMLSampler::_imgProps
SbMLImageProperties _imgProps
ML image properties.
Definition
SoMLSampler.h:61
SoMLSampler::getTextureDataFromImage
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.
SoMLSampler::updateParameter
void updateParameter(SoUniformParameterBase *uniformBase, SoState *state) override
Assigns or updates the parameter's value.
SoMLSampler::~SoMLSampler
~SoMLSampler() override
Destructor.
SoMLSampler::MLToGLDataType
GLenum MLToGLDataType(const MLDataType &dType)
Return OpenGL data type for given ML data type. Returns GL_NONE for unknown ML data types.
SoMLSampler::imageChanged
void imageChanged() override
Called when the ML images has changed.
SoMLSampler::calcSubImgProps
virtual void calcSubImgProps(XVImageSize &subImgPosition, XVImageSize &subImgSize)=0
Calculate position and size of used sub image by evaluation of fields.
SoMLSampler::texConfigChanged
void texConfigChanged(SoField *field) override
Called when texture configuration (e.g. filter mode) has changed.
SoMLSampler::GLRender
void GLRender(SoGLRenderAction *action) override
Set ML image properties in state.
SoMLSampler::SoMLSampler
SoMLSampler()
Constructor.
SoMLSampler::loadAndReformatSubImg
MLuint8 * loadAndReformatSubImg(const XVImageSize &pos, const XVImageSize &size)
SoMLSampler::startU
SoSFUInt32 startU
Origin of the image in U dimension. Default is 0.
Definition
SoMLSampler.h:40
SoMLSampler::startT
SoSFUInt32 startT
Origin of the image in T dimension. Default is 0.
Definition
SoMLSampler.h:37
SoSFMLImage
Definition
SoSFMLImage.h:84
SoUniformParameterBase
Base class for uniform shader parameters.
Definition
SoUniformParameterBase.h:30
XVImageSize
SoSFMLImage - field interface to ML images and related classes.
Definition
SoSFMLImage.h:32
MeVisLab
Standard
Sources
Inventor
SoShader
Inventor
nodes
SoMLSampler.h
Generated by
1.18.0