MeVisLab Resolution Independence API
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"
21#include <Inventor/elements/SoMLImageElement.h>
22#include <SoSFMLImage.h>
23
24
27{
28 typedef SoImageSampler inherited;
29
30 SO_NODE_ABSTRACT_HEADER(SoMLSampler);
31
32public:
35
37 SoSFUInt32 startT;
38
40 SoSFUInt32 startU;
41
42SoEXTENDER public :
43
45 void GLRender(SoGLRenderAction* action) override;
46
48 void updateParameter(SoUniformParameterBase* uniformBase, SoState* state) override;
49
50SoINTERNAL public :
51
53 static void initClass();
54
55protected:
58
59
61 SbMLImageProperties _imgProps;
62
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_
#define INVENTOR_SHADER_API
Define class export specifier.
TextureType
Texture type.
SoImageSampler()
Constructor.
void imageChangedCB(SoField *field)
SoSFMLImage image
ML image connector.
Definition SoMLSampler.h:34
static void initClass()
Initialize class with runtime type system.
SbSamplerInfo::TextureType _internTexFormat
Value points to internal texture format.
Definition SoMLSampler.h:57
SbMLImageProperties _imgProps
ML image properties.
Definition SoMLSampler.h:61
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.
void updateParameter(SoUniformParameterBase *uniformBase, SoState *state) override
Assigns or updates the parameter's value.
~SoMLSampler() override
Destructor.
GLenum MLToGLDataType(const MLDataType &dType)
Return OpenGL data type for given ML data type. Returns GL_NONE for unknown ML data types.
void imageChanged() override
Called when the ML images has changed.
virtual void calcSubImgProps(XVImageSize &subImgPosition, XVImageSize &subImgSize)=0
Calculate position and size of used sub image by evaluation of fields.
void texConfigChanged(SoField *field) override
Called when texture configuration (e.g. filter mode) has changed.
void GLRender(SoGLRenderAction *action) override
Set ML image properties in state.
SoMLSampler()
Constructor.
MLuint8 * loadAndReformatSubImg(const XVImageSize &pos, const XVImageSize &size)
SoSFUInt32 startU
Origin of the image in U dimension. Default is 0.
Definition SoMLSampler.h:40
SoSFUInt32 startT
Origin of the image in T dimension. Default is 0.
Definition SoMLSampler.h:37
Base class for uniform shader parameters.
SoSFMLImage - field interface to ML images and related classes.
Definition SoSFMLImage.h:32