87 bool hasData() {
return _data!=
nullptr; };
199 void createTextureIds();
219 ml::GLTextures _textures;
256 bool _forceShaderUsage;
270 size_t _checkerInterval;
273 bool _areCheckersInverted;
View2DTextureFilter
Filter mode.
#define SOVIEW2D_API
File to resolve system dependencies in View2D library.
The SoSFMLImage field is the interface used by Inventor Nodes to access image data (in the current im...
A small wrapper class for the LUT data.
base class for hardware shaders that can be used on a View2DTexture
A class to render images as OpenGL Textures.
void freeData()
frees the stored data
void loadSliceToTexture(SoSFMLImage *image, MLssize_t slice, MLssize_t timepoint, MLssize_t userIndex, bool useNPOT=false)
loads image slice to texture (depending on lut it uses a different data type) (LUT MUST be set before...
void bindTexture()
binds the texture, needs to be done before drawTexture (NEEDS VALID CURRENT GL CONTEXT!...
void getSize(MLssize_t &x, MLssize_t &y)
gets the current size of image
void setCheckerTilesInverted(bool inverted)
Invert the checkerboard, if inverted = TRUE.
void setCheckerInterval(size_t interval)
Set the checkerInterval variable to value interval.
void setLut(View2DLut *newLut)
sets the lut currently used (NEEDS VALID CURRENT GL CONTEXT!)
void restoreState()
restores the GL state (NEEDS VALID CURRENT GL CONTEXT!)
void allocateData(MLssize_t sizeX, MLssize_t sizeY, MLDataType dtype=MLuint8Type, MLssize_t channels=1)
allocates a new data area, frees the old data
void loadSliceToTexture(ml::PagedImage *image, MLssize_t slice, MLssize_t timepoint, MLssize_t userIndex, bool useNPOT=false)
View2DTextureFilter getFilter()
get the used filter mode
GLint internalGetFirstTexture()
void loadSliceToTexture(SoSFMLImage *image, const ml::SubImageBox §ion, bool useNPOT=false)
loads part of a slice to texture, z, t, and u should have size 1
void setData(void *data, MLssize_t sizeX, MLssize_t sizeY, MLDataType dtype=MLuint8Type, MLssize_t channels=1, bool ownsData=true)
void internalBindFirstTexture()
Just binds the first texture. Only for internal use!
void loadSliceToTexture(ml::PagedImage *image, const ml::SubImageBox §ion, bool useNPOT=false)
void setDataChanged()
sets a flag that the current data needs to be reload as a texture because it was changed
size_t getCheckerInterval() const
Get the checkerInterval variable value.
void setFilter(View2DTextureFilter filter)
sets the filters that are currently used
bool areCheckerTilesInverted() const
Get the _areCheckersInverted variable value.
View2DLut * getLut()
gets the lut
MLssize_t getChannels() const
Get the number of color channels.
void drawTexture(float dx1, float dy1, float dx2, float dy2)
draws the texture in the given 2d rectangle (NEEDS VALID CURRENT GL CONTEXT!)
bool hasData()
returns TRUE if there is data stored, else it returns false
static MLssize_t getPowerOfTwo(MLssize_t size, bool &subflag)
returns next power of two and if size is only subpart
static MLssize_t getPowerOfTwo(MLssize_t size)
returns next power of two
void setShader(View2DShader *shader)
sets the shader that should be used for rendering
bool needsImageData()
check if texture needs image data (NEEDS VALID CURRENT GL CONTEXT!)
bool isNPOT()
Get if the texture is a non-power of two texture.
View2DTexture()
create empty texture
void setUserID(void *user, MLssize_t id)
sets current user and id
void createRenderToTextureTarget(int width, int height, int channels, GLenum format, GLenum internalFormat)
View2DShader * getShader()
get the shader (might be NULL);
void freeTexture()
frees the allocated texture id
bool isValidUserID(void *user, MLssize_t id)
returns true if user and id are correct
void setForceShaderUsage(bool flag)
forces the usage of the shader, regardless of the format, this also clears the internal image data re...
void * getData()
returns the data pointer (or NULL if empty), free write access is granted
void drawTextureAsBorderImage(float dx1, float dy1, float dx2, float dy2, float borderWidth, float borderHeight)
draws the image texture from dx1,dy1 to dx2,dy2 using 3x3 quads (the corners/border regions defined b...
MLDataType getImageDataType()
get the data type of the stored image
void forgetData()
forget the data, without freeing it.
void drawTexture(float vp1[3], float vp2[3], float vp3[3])
draws the texture in the given 3d slice (vp1, vp2, vp3 (4. point is calculated)) (NEEDS VALID CURRENT...
bool isValidUser(void *user)
returns true if user is correct
void drawTextureRegion(float vp1[3], float vp2[3], float vp3[3], int startX, int startY, int endX, int endY)
draws the texture region in the given 3d slice (vp1, vp2, vp3 (4.
MLuint64 getSizeInBytesOnGPU() const
Returns the number of bytes used on the GPU.
Class which represents an image, which manages properties of an image and image data which is located...
MLint32 MLDataType
MLDataType.
@ MLuint8Type
Enumerator for the unsigned 8 bit ML integer type.
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
UINT64 MLuint64
Introduce platform independent 64 bit unsigned integer type.
SSIZE_T MLssize_t
The signed ML size type which is a signed 32 bit size_t on 32 bit platforms and 64 bit one on 64 bit ...
Main documentation file for ML users and developers.