 |
VTK
9.0.20210304
|
Go to the documentation of this file.
24 #ifndef vtkTextureObject_h
25 #define vtkTextureObject_h
28 #include "vtkRenderingOpenGL2Module.h"
54 NumberOfDepthTextureCompareFunctions
59 #ifndef GL_ES_VERSION_3_0
60 enum { ClampToEdge = 0,
Repeat, MirroredRepeat, ClampToBorder, NumberOfWrapModes };
80 NumberOfMinificationModes
119 vtkGetMacro(Width,
unsigned int);
120 vtkGetMacro(Height,
unsigned int);
121 vtkGetMacro(Depth,
unsigned int);
122 vtkGetMacro(Samples,
unsigned int);
123 vtkGetMacro(Components,
int);
124 unsigned int GetTuples() {
return this->Width * this->Height * this->Depth; }
127 vtkGetMacro(NumberOfDimensions,
int);
130 vtkSetMacro(Samples,
unsigned int);
143 vtkGetMacro(Handle,
unsigned int);
194 vtkSetMacro(AutoParameters,
int);
195 vtkGetMacro(AutoParameters,
int);
196 vtkBooleanMacro(AutoParameters,
int);
204 unsigned int width,
unsigned int height,
int numComps,
int dataType,
void*
data);
212 unsigned int width,
unsigned int height,
int internalFormat,
int rawType,
void* raw);
227 unsigned int width,
unsigned int height,
int numComps,
int dataType,
void*
data[6]);
253 bool shaderSupportsTextureInt);
261 bool Create3D(
unsigned int width,
unsigned int height,
unsigned int depth,
int numComps,
269 int dataType,
void*
data);
278 unsigned int const depth,
int const numComps,
int const dataType);
310 bool Allocate1D(
unsigned int width,
int numComps,
int vtkType);
317 unsigned int width,
unsigned int height,
int numComps,
int vtkType,
int level = 0);
324 unsigned int width,
unsigned int height,
unsigned int depth,
int numComps,
int vtkType);
330 bool Create2D(
unsigned int width,
unsigned int height,
int numComps,
int vtktype,
bool)
332 return this->Allocate2D(width,
height, numComps, vtktype);
335 unsigned int width,
unsigned int height,
unsigned int depth,
int numComps,
int vtktype,
bool)
337 return this->Allocate3D(width,
height, depth, numComps, vtktype);
372 unsigned int GetFormat(
int vtktype,
int numComps,
bool shaderSupportsTextureInt);
400 vtkSetMacro(RequireDepthBufferFloat,
bool);
401 vtkGetMacro(RequireDepthBufferFloat,
bool);
402 vtkGetMacro(SupportsDepthBufferFloat,
bool);
412 vtkSetMacro(RequireTextureFloat,
bool);
413 vtkGetMacro(RequireTextureFloat,
bool);
414 vtkGetMacro(SupportsTextureFloat,
bool);
424 vtkSetMacro(RequireTextureInteger,
bool);
425 vtkGetMacro(RequireTextureInteger,
bool);
426 vtkGetMacro(SupportsTextureInteger,
bool);
440 vtkGetMacro(WrapS,
int);
441 vtkSetMacro(WrapS,
int);
455 vtkGetMacro(WrapT,
int);
456 vtkSetMacro(WrapT,
int);
470 vtkGetMacro(WrapR,
int);
471 vtkSetMacro(WrapR,
int);
488 vtkGetMacro(MinificationFilter,
int);
489 vtkSetMacro(MinificationFilter,
int);
500 vtkGetMacro(MagnificationFilter,
int);
501 vtkSetMacro(MagnificationFilter,
int);
518 vtkSetVector4Macro(BorderColor,
float);
519 vtkGetVector4Macro(BorderColor,
float);
527 vtkSetMacro(MinLOD,
float);
528 vtkGetMacro(MinLOD,
float);
536 vtkSetMacro(MaxLOD,
float);
537 vtkGetMacro(MaxLOD,
float);
546 vtkSetMacro(BaseLevel,
int);
547 vtkGetMacro(BaseLevel,
int);
556 vtkSetMacro(MaxLevel,
int);
557 vtkGetMacro(MaxLevel,
int);
571 vtkGetMacro(DepthTextureCompare,
bool);
572 vtkSetMacro(DepthTextureCompare,
bool);
596 vtkGetMacro(DepthTextureCompareFunction,
int);
597 vtkSetMacro(DepthTextureCompareFunction,
int);
606 vtkGetMacro(GenerateMipmap,
bool);
607 vtkSetMacro(GenerateMipmap,
bool);
616 vtkSetMacro(MaximumAnisotropicFiltering,
float);
617 vtkGetMacro(MaximumAnisotropicFiltering,
float);
666 int dstYmin,
int dstXmax,
int dstYmax,
int dstSizeX,
int dstSizeY,
vtkShaderProgram* program,
689 int srcXmin,
int srcYmin,
int dstXmin,
int dstYmin,
int width,
int height);
716 vtkGetMacro(UseSRGBColorSpace,
bool);
717 vtkSetMacro(UseSRGBColorSpace,
bool);
718 vtkBooleanMacro(UseSRGBColorSpace,
bool);
782 float BorderColor[4];
void CopyToFrameBuffer(int srcXmin, int srcYmin, int srcXmax, int srcYmax, int dstXmin, int dstYmin, int dstXmax, int dstYmax, int dstSizeX, int dstSizeY, vtkShaderProgram *program, vtkOpenGLVertexArrayObject *vao)
unsigned int GetDefaultInternalFormat(int vtktype, int numComps, bool shaderSupportsTextureInt)
vtkGenericOpenGLResourceFreeCallback * ResourceCallback
bool Create3DFromRaw(unsigned int width, unsigned int height, unsigned int depth, int numComps, int dataType, void *data)
Create a 3D texture from client memory numComps must be in [1-4].
bool Create1D(int numComps, vtkPixelBufferObject *pbo, bool shaderSupportsTextureInt)
Create a 1D texture using the PBO.
vtkOpenGLBufferObject * BufferObject
bool CreateCubeFromRaw(unsigned int width, unsigned int height, int numComps, int dataType, void *data[6])
Create a cube texture from 6 buffers from client memory.
void CopyToFrameBuffer(int srcXmin, int srcYmin, int srcXmax, int srcYmax, int dstXmin, int dstYmin, int dstSizeX, int dstSizeY, vtkShaderProgram *program, vtkOpenGLVertexArrayObject *vao)
void CopyToFrameBuffer(float *tcoords, float *verts, vtkShaderProgram *program, vtkOpenGLVertexArrayObject *vao)
bool AllocateProxyTexture3D(unsigned int const width, unsigned int const height, unsigned int const depth, int const numComps, int const dataType)
Create a 3D texture using the GL_PROXY_TEXTURE_3D target.
bool CreateTextureBuffer(unsigned int numValues, int numComps, int dataType, vtkOpenGLBufferObject *bo)
Create a texture buffer basically a 1D texture that can be very large for passing data into the fragm...
bool Create3D(unsigned int width, unsigned int height, unsigned int depth, int numComps, int vtktype, bool)
vtkTimeStamp SendParametersTime
record modification and/or execution time
vtkPixelBufferObject * Download()
This is used to download raw data from the texture into a pixel buffer.
~vtkTextureObject() override
void SetFormat(unsigned int glFormat)
void SetContext(vtkOpenGLRenderWindow *)
Get/Set the context.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
abstract base class for most VTK objects
bool SupportsTextureInteger
static int GetMaximumTextureSize(vtkOpenGLRenderWindow *context)
Query and return maximum texture size (dimension) supported by the OpenGL driver for a particular con...
bool SupportsDepthBufferFloat
void SetInternalFormat(unsigned int glInternalFormat)
unsigned int GetFormat(int vtktype, int numComps, bool shaderSupportsTextureInt)
Get/Set format (OpenGL internal format) that should be used.
bool AllocateDepth(unsigned int width, unsigned int height, int internalFormat)
Create a 2D depth texture but does not initialize its values.
int GetVTKDataType()
Get the data type for the texture as a vtk type int i.e.
void AssignToExistingTexture(unsigned int handle, unsigned int target)
Assign the TextureObject to a externally provided Handle and Target.
bool GetLinearMagnification()
bool Allocate2D(unsigned int width, unsigned int height, int numComps, int vtkType, int level=0)
Create a 2D color texture but does not initialize its values.
int GetTextureUnit()
Return the texture unit used for this texture.
virtual void Activate()
Activate and Bind the texture.
void GetShiftAndScale(float &shift, float &scale)
Get the shift and scale required in the shader to return the texture values to their original range.
bool CreateDepth(unsigned int width, unsigned int height, int internalFormat, vtkPixelBufferObject *pbo)
Create a 2D depth texture using a PBO.
window superclass for vtkRenderWindow
vtkWeakPointer< vtkOpenGLRenderWindow > Context
unsigned int GetInternalFormat(int vtktype, int numComps, bool shaderSupportsTextureInt)
Get/Set internal format (OpenGL internal format) that should be used.
bool AllocateDepthStencil(unsigned int width, unsigned int height)
Create a 2D septh stencil texture but does not initialize its values.
unsigned int GetMinificationFilterMode(int vtktype)
unsigned int GetMagnificationFilterMode(int vtktype)
boost::graph_traits< vtkGraph * >::vertex_descriptor target(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
bool RequireDepthBufferFloat
unsigned int GetDefaultFormat(int vtktype, int numComps, bool shaderSupportsTextureInt)
void CreateTexture()
Creates a texture handle if not already created.
vtkOpenGLHelper * ShaderProgram
unsigned int GetWrapRMode(int vtktype)
void Resize(unsigned int width, unsigned int height)
The ShaderProgram uses one or more Shader objects.
static bool IsSupported(vtkOpenGLRenderWindow *)
Check for feature support, without any optional features.
bool RequireTextureInteger
void Deactivate()
Deactivate and UnBind the texture.
a simple class to control print indentation
abstracts an OpenGL texture object.
vtkPixelBufferObject * Download(unsigned int target, unsigned int level)
static vtkTextureObject * New()
void CopyFromFrameBuffer(int srcXmin, int srcYmin, int dstXmin, int dstYmin, int width, int height)
Copy a sub-part of a logical buffer of the framebuffer (color or depth) to the texture object.
virtual void ReleaseGraphicsResources(vtkWindow *win)
Deactivate and UnBind the texture.
bool Create3D(unsigned int width, unsigned int height, unsigned int depth, int numComps, vtkPixelBufferObject *pbo, bool shaderSupportsTextureInt)
Create a 3D texture using the PBO.
void ResetFormatAndType()
Reset format, internal format, and type of the texture.
vtkOpenGLRenderWindow * GetContext()
bool Allocate1D(unsigned int width, int numComps, int vtkType)
Create a 1D color texture but does not initialize its values.
void SetDataType(unsigned int glType)
void SendParameters()
Send all the texture object parameters to the hardware if not done yet.
bool Allocate3D(unsigned int width, unsigned int height, unsigned int depth, int numComps, int vtkType)
Create a 3D color texture but does not initialize its values.
bool Create2D(unsigned int width, unsigned int height, int numComps, vtkPixelBufferObject *pbo, bool shaderSupportsTextureInt)
Create a 2D texture using the PBO.
bool Create1DFromRaw(unsigned int width, int numComps, int dataType, void *data)
Create 1D texture from client memory.
bool SupportsTextureFloat
bool IsBound()
Tells if the texture object is bound to the active texture image unit.
int GetDataType(int vtk_scalar_type)
Get the data type for the texture as GLenum type.
int GetMaximumTextureSize3D()
Overload which uses the internal context to query the maximum 3D texture size.
int GetDefaultDataType(int vtk_scalar_type)
void CopyToFrameBuffer(vtkShaderProgram *program, vtkOpenGLVertexArrayObject *vao)
Copy the texture (src) in the current framebuffer.
unsigned int GetWrapSMode(int vtktype)
bool CreateDepthFromRaw(unsigned int width, unsigned int height, int internalFormat, int rawType, void *raw)
Create a 2D depth texture using a raw pointer.
void Bind()
Bind the texture, must have been created using Create().
bool Create2D(unsigned int width, unsigned int height, int numComps, int vtktype, bool)
Create texture without uploading any data.
unsigned int GetWrapTMode(int vtktype)
static int GetMaximumTextureSize3D(vtkOpenGLRenderWindow *context)
bool Create2DFromRaw(unsigned int width, unsigned int height, int numComps, int dataType, void *data)
Create a 2D texture from client memory numComps must be in [1-4].
void SetLinearMagnification(bool val)
Tells if the magnification mode is linear (true) or nearest (false).
void DestroyTexture()
Destroy the texture.
int DepthTextureCompareFunction
The VertexArrayObject class uses, or emulates, vertex array objects.
static bool IsSupported(vtkOpenGLRenderWindow *, bool, bool, bool)
Returns if the context supports the required extensions.
abstracts an OpenGL pixel buffer object.
unsigned int InternalFormat
float MaximumAnisotropicFiltering