MeVisLab Toolbox Reference
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"
22#include <SoSFMLImage.h>
23
24
27{
29
30 SO_NODE_ABSTRACT_HEADER(SoMLSampler);
31
32 public:
33
36
39
42
43 SoEXTENDER public:
44
47
50
51 SoINTERNAL public:
52
54 static void initClass();
55
56 protected:
57
60
61
64
67
69 ~SoMLSampler() override;
70
73
77
80
82 void imageChanged() override;
84
87
89 virtual void getTextureDataFromImage(const XVImageSize &pos, const XVImageSize &size);
90
91};
92
93#endif // _SO_ML_SAMPLER_
Inventor element storing ML image properties in the OpenInventor state.
TextureType
Texture type.
The abstract Inventor class SoImageSampler.
Abstract base class for sampler nodes that handle ML images.
Definition SoMLSampler.h:27
void imageChangedCB(SoField *field)
SoSFMLImage image
ML image connector.
Definition SoMLSampler.h:35
static void initClass()
Initialize class with runtime type system.
SbSamplerInfo::TextureType _internTexFormat
Value points to internal texture format.
Definition SoMLSampler.h:59
SbMLImageProperties _imgProps
ML image properties.
Definition SoMLSampler.h:63
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)
Load ML image and reformat memory to be suitable for OpenGL texturing.
SoSFUInt32 startU
Origin of the image in U dimension. Default is 0.
Definition SoMLSampler.h:41
SoSFUInt32 startT
Origin of the image in T dimension. Default is 0.
Definition SoMLSampler.h:38
The SoSFMLImage field is the interface used by Inventor Nodes to access image data (in the current im...
Definition SoSFMLImage.h:70
Base class for uniform shader parameters.
SoSFMLImage - field interface to ML images and related classes.
Definition SoSFMLImage.h:32
MLint32 MLDataType
MLDataType.
Definition mlTypeDefs.h:596
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
unsigned char MLuint8
Definition mlTypeDefs.h:109