VTK
vtkTextureObject.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkTextureObject.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
27 #ifndef vtkTextureObject_h
28 #define vtkTextureObject_h
29 
30 #include "vtkRenderingOpenGL2Module.h" // For export macro
31 #include "vtkObject.h"
32 #include "vtkWeakPointer.h" // for render context
33 
35 class vtkOpenGLHelper;
39 class vtkShaderProgram;
40 class vtkWindow;
42 
43 
44 class VTKRENDERINGOPENGL2_EXPORT vtkTextureObject : public vtkObject
45 {
46 public:
47 
48  // DepthTextureCompareFunction values.
49  enum
50  {
51  Lequal=0, // r=R<=Dt ? 1.0 : 0.0
52  Gequal, // r=R>=Dt ? 1.0 : 0.0
53  Less, // r=R<D_t ? 1.0 : 0.0
54  Greater, // r=R>Dt ? 1.0 : 0.0
55  Equal, // r=R==Dt ? 1.0 : 0.0
56  NotEqual, // r=R!=Dt ? 1.0 : 0.0
57  AlwaysTrue, // r=1.0 // WARNING "Always" is macro defined in X11/X.h...
58  Never, // r=0.0
59  NumberOfDepthTextureCompareFunctions
60  };
61 
62 // ClampToBorder is not supported in ES 2.0
63 // Wrap values.
64 #if GL_ES_VERSION_3_0 != 1
65  enum
66  {
67  ClampToEdge=0,
71  NumberOfWrapModes
72  };
73 #else
74  enum
75  {
76  ClampToEdge=0,
77  Repeat,
78  MirroredRepeat,
79  NumberOfWrapModes
80  };
81 #endif
82 
83  // MinificationFilter values.
84  enum
85  {
86  Nearest=0,
92  NumberOfMinificationModes
93  };
94 
95  // depth/color format
96  enum
97  {
98  Native=0, // will try to match with the depth buffer format.
105  NumberOfDepthFormats
106  };
107 
109  vtkTypeMacro(vtkTextureObject, vtkObject);
110  void PrintSelf(ostream& os, vtkIndent indent) override;
111 
113 
125 
127 
131  vtkGetMacro(Width, unsigned int);
132  vtkGetMacro(Height, unsigned int);
133  vtkGetMacro(Depth, unsigned int);
134  vtkGetMacro(Samples, unsigned int);
135  vtkGetMacro(Components, int);
136  unsigned int GetTuples()
137  { return this->Width*this->Height*this->Depth; }
139 
140  vtkGetMacro(NumberOfDimensions, int);
141 
142  //for MSAA textures set the number of samples
143  vtkSetMacro(Samples, unsigned int);
144 
146 
149  vtkGetMacro(Target, unsigned int);
151 
153 
156  vtkGetMacro(Handle, unsigned int);
158 
163 
165 
170  void Bind();
172 
176  void Activate();
177 
181  void Deactivate();
182 
187 
192  bool IsBound();
193 
195 
202  vtkSetMacro(AutoParameters, int);
203  vtkGetMacro(AutoParameters, int);
205 
210  bool Create2DFromRaw(unsigned int width, unsigned int height,
211  int numComps, int dataType, void *data);
212 
217  bool CreateDepthFromRaw(unsigned int width, unsigned int height,
218  int internalFormat, int rawType,
219  void *raw);
220 
225  bool CreateTextureBuffer(unsigned int numValues, int numComps,
226  int dataType, vtkOpenGLBufferObject *bo);
227 
233  bool CreateCubeFromRaw(unsigned int width, unsigned int height,
234  int numComps, int dataType, void *data[6]);
235 
236 // 1D textures are not supported in ES 2.0 or 3.0
237 #if GL_ES_VERSION_3_0 != 1
238 
249  bool Create1D(int numComps,
251  bool shaderSupportsTextureInt);
252 
256  bool Create1DFromRaw(unsigned int width, int numComps,
257  int dataType, void *data);
258 #endif
259 
266  bool Create2D(unsigned int width, unsigned int height, int numComps,
268  bool shaderSupportsTextureInt);
269 
276  bool Create3D(unsigned int width, unsigned int height, unsigned int depth,
277  int numComps, vtkPixelBufferObject *pbo,
278  bool shaderSupportsTextureInt);
279 
284  bool Create3DFromRaw(unsigned int width, unsigned int height,
285  unsigned int depth, int numComps,
286  int dataType, void *data);
287 
294  bool AllocateProxyTexture3D(unsigned int const width, unsigned int const height,
295  unsigned int const depth, int const numComps, int const dataType);
296 
304 
309  bool CreateDepth(unsigned int width,
310  unsigned int height,
311  int internalFormat,
312  vtkPixelBufferObject *pbo);
313 
317  bool AllocateDepth(unsigned int width, unsigned int height,
318  int internalFormat);
319 
324  bool Allocate1D(unsigned int width, int numComps, int vtkType);
325 
330  bool Allocate2D(unsigned int width, unsigned int height, int numComps,
331  int vtkType, int level = 0);
332 
337  bool Allocate3D(unsigned int width, unsigned int height,
338  unsigned int depth, int numComps,
339  int vtkType);
340 
341 
343 
346  bool Create2D(unsigned int width, unsigned int height, int numComps,
347  int vtktype, bool ){
348  return this->Allocate2D(width, height, numComps, vtktype); }
349  bool Create3D(unsigned int width, unsigned int height, unsigned int depth,
350  int numComps, int vtktype, bool ) {
351  return this->Allocate3D(width, height, depth, numComps, vtktype); }
353 
358 
360 
363  int GetDataType(int vtk_scalar_type);
364  void SetDataType(unsigned int glType);
365  int GetDefaultDataType(int vtk_scalar_type);
367 
369 
374  unsigned int GetInternalFormat(int vtktype, int numComps,
375  bool shaderSupportsTextureInt);
376  void SetInternalFormat(unsigned int glInternalFormat);
377  unsigned int GetDefaultInternalFormat(int vtktype, int numComps,
378  bool shaderSupportsTextureInt);
380 
382 
387  unsigned int GetFormat(int vtktype, int numComps,
388  bool shaderSupportsTextureInt);
389  void SetFormat(unsigned int glFormat);
390  unsigned int GetDefaultFormat(int vtktype, int numComps,
391  bool shaderSupportsTextureInt);
393 
403 
404  unsigned int GetMinificationFilterMode(int vtktype);
405  unsigned int GetMagnificationFilterMode(int vtktype);
406  unsigned int GetWrapSMode(int vtktype);
407  unsigned int GetWrapTMode(int vtktype);
408  unsigned int GetWrapRMode(int vtktype);
409 
411 
417  vtkSetMacro(RequireDepthBufferFloat, bool);
418  vtkGetMacro(RequireDepthBufferFloat, bool);
419  vtkGetMacro(SupportsDepthBufferFloat, bool);
421 
423 
429  vtkSetMacro(RequireTextureFloat, bool);
430  vtkGetMacro(RequireTextureFloat, bool);
431  vtkGetMacro(SupportsTextureFloat, bool);
433 
435 
441  vtkSetMacro(RequireTextureInteger, bool);
442  vtkGetMacro(RequireTextureInteger, bool);
443  vtkGetMacro(SupportsTextureInteger, bool);
445 
447 
457  vtkGetMacro(WrapS, int);
458  vtkSetMacro(WrapS, int);
460 
462 
472  vtkGetMacro(WrapT, int);
473  vtkSetMacro(WrapT, int);
475 
477 
487  vtkGetMacro(WrapR, int);
488  vtkSetMacro(WrapR, int);
490 
492 
505  vtkGetMacro(MinificationFilter, int);
506  vtkSetMacro(MinificationFilter, int);
508 
510 
517  vtkGetMacro(MagnificationFilter, int);
518  vtkSetMacro(MagnificationFilter, int);
520 
525  void SetLinearMagnification(bool val)
526  { this->SetMagnificationFilter(val?Linear:Nearest); }
527 
529  { return this->MagnificationFilter==Linear; }
530 
532 
537  vtkSetVector4Macro(BorderColor, float);
538  vtkGetVector4Macro(BorderColor, float);
540 
542 
546  vtkSetMacro(MinLOD, float);
547  vtkGetMacro(MinLOD, float);
549 
551 
555  vtkSetMacro(MaxLOD, float);
556  vtkGetMacro(MaxLOD, float);
558 
560 
565  vtkSetMacro(BaseLevel, int);
566  vtkGetMacro(BaseLevel, int);
568 
570 
575  vtkSetMacro(MaxLevel, int);
576  vtkGetMacro(MaxLevel, int);
578 
580 
590  vtkGetMacro(DepthTextureCompare, bool);
591  vtkSetMacro(DepthTextureCompare, bool);
593 
595 
615  vtkGetMacro(DepthTextureCompareFunction, int);
616  vtkSetMacro(DepthTextureCompareFunction, int);
618 
620 
625  vtkGetMacro(GenerateMipmap, bool);
626  vtkSetMacro(GenerateMipmap, bool);
628 
630 
641 
649 
655  static bool IsSupported(
657  bool /* requireTexFloat */,
658  bool /* requireDepthFloat */,
659  bool /* requireTexInt */) { return true; }
660 
665  { return true; }
666 
668 
675  // part of a texture to part of a viewport, scaling as needed
676  void CopyToFrameBuffer(int srcXmin, int srcYmin,
677  int srcXmax, int srcYmax,
678  int dstXmin, int dstYmin,
679  int dstXmax, int dstYmax,
680  int dstSizeX, int dstSizeY,
681  vtkShaderProgram *program,
683  );
684  // copy part of a texure to part of a viewport, no scalaing
685  void CopyToFrameBuffer(int srcXmin, int srcYmin,
686  int srcXmax, int srcYmax,
687  int dstXmin, int dstYmin,
688  int dstSizeX, int dstSizeY,
689  vtkShaderProgram *program,
691  );
692  // copy a texture to a quad using the provided tcoords and verts
693  void CopyToFrameBuffer(float *tcoords, float *verts,
694  vtkShaderProgram *program,
696  );
698 
699 
711  void CopyFromFrameBuffer(int srcXmin,
712  int srcYmin,
713  int dstXmin,
714  int dstYmin,
715  int width,
716  int height);
717 
730  void GetShiftAndScale(float &shift, float &scale);
731 
732  // resizes an existing texture, any existing
733  // data values are lost
734  void Resize(unsigned int width, unsigned int height);
735 
737 
743  vtkGetMacro(UseSRGBColorSpace, bool);
744  vtkSetMacro(UseSRGBColorSpace, bool);
745  vtkBooleanMacro(UseSRGBColorSpace, bool);
747 
748 
749 protected:
751  ~vtkTextureObject() override;
752 
754 
759 
764 
766  unsigned int Width;
767  unsigned int Height;
768  unsigned int Depth;
769  unsigned int Samples;
771 
772  unsigned int Target; // GLenum
773  unsigned int Format; // GLenum
774  unsigned int InternalFormat; // GLenum
775  unsigned int Type; // GLenum
777 
779  unsigned int Handle;
786 
787  int WrapS;
788  int WrapT;
789  int WrapR;
792 
793  float MinLOD;
794  float MaxLOD;
796  int MaxLevel;
797  float BorderColor[4];
798 
801 
803 
806 
807  // used for copying to framebuffer
809 
810  // for texturebuffers we hold on to the Buffer
812 
813 private:
814  vtkTextureObject(const vtkTextureObject&) = delete;
815  void operator=(const vtkTextureObject&) = delete;
816 };
817 
818 #endif
vtkTextureObject::LinearMipmapLinear
@ LinearMipmapLinear
Definition: vtkTextureObject.h:91
vtkTextureObject::DepthTextureCompare
bool DepthTextureCompare
Definition: vtkTextureObject.h:799
vtkTextureObject::ReleaseGraphicsResources
void ReleaseGraphicsResources(vtkWindow *win)
Deactivate and UnBind the texture.
vtkTextureObject::CopyToFrameBuffer
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)
vtkTextureObject::NotEqual
@ NotEqual
Definition: vtkTextureObject.h:56
vtkTextureObject::UseSRGBColorSpace
bool UseSRGBColorSpace
Definition: vtkTextureObject.h:770
vtkTextureObject::GetDefaultInternalFormat
unsigned int GetDefaultInternalFormat(int vtktype, int numComps, bool shaderSupportsTextureInt)
vtkTextureObject::ResourceCallback
vtkGenericOpenGLResourceFreeCallback * ResourceCallback
Definition: vtkTextureObject.h:753
vtkTextureObject::Create3DFromRaw
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].
vtkTextureObject::Create1D
bool Create1D(int numComps, vtkPixelBufferObject *pbo, bool shaderSupportsTextureInt)
Create a 1D texture using the PBO.
vtkTextureObject::BufferObject
vtkOpenGLBufferObject * BufferObject
Definition: vtkTextureObject.h:811
vtkTextureObject::Samples
unsigned int Samples
Definition: vtkTextureObject.h:769
vtkTextureObject::CreateCubeFromRaw
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.
vtkTextureObject::Depth
unsigned int Depth
Definition: vtkTextureObject.h:768
vtkTextureObject::CopyToFrameBuffer
void CopyToFrameBuffer(int srcXmin, int srcYmin, int srcXmax, int srcYmax, int dstXmin, int dstYmin, int dstSizeX, int dstSizeY, vtkShaderProgram *program, vtkOpenGLVertexArrayObject *vao)
vtkTextureObject::CopyToFrameBuffer
void CopyToFrameBuffer(float *tcoords, float *verts, vtkShaderProgram *program, vtkOpenGLVertexArrayObject *vao)
vtkOpenGLBufferObject
OpenGL buffer object.
Definition: vtkOpenGLBufferObject.h:34
vtkTextureObject::AllocateProxyTexture3D
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.
vtkTextureObject::AlwaysTrue
@ AlwaysTrue
Definition: vtkTextureObject.h:57
vtkX3D::scale
@ scale
Definition: vtkX3D.h:229
vtkTextureObject::CreateTextureBuffer
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...
vtkTextureObject::NumberOfDimensions
int NumberOfDimensions
Definition: vtkTextureObject.h:765
vtkTextureObject::Create3D
bool Create3D(unsigned int width, unsigned int height, unsigned int depth, int numComps, int vtktype, bool)
Definition: vtkTextureObject.h:349
vtkTextureObject::SendParametersTime
vtkTimeStamp SendParametersTime
Definition: vtkTextureObject.h:805
vtkX3D::data
@ data
Definition: vtkX3D.h:315
vtkTimeStamp
record modification and/or execution time
Definition: vtkTimeStamp.h:36
vtkTextureObject::Download
vtkPixelBufferObject * Download()
This is used to download raw data from the texture into a pixel buffer.
vtkTextureObject::RequireTextureFloat
bool RequireTextureFloat
Definition: vtkTextureObject.h:782
vtkTextureObject::~vtkTextureObject
~vtkTextureObject() override
vtkTextureObject::Target
unsigned int Target
Definition: vtkTextureObject.h:772
vtkTextureObject::WrapR
int WrapR
Definition: vtkTextureObject.h:789
vtkTextureObject::MagnificationFilter
int MagnificationFilter
Definition: vtkTextureObject.h:791
vtkTextureObject::SetFormat
void SetFormat(unsigned int glFormat)
vtkTextureObject::SetContext
void SetContext(vtkOpenGLRenderWindow *)
Get/Set the context.
vtkTextureObject::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:60
vtkTextureObject::GenerateMipmap
bool GenerateMipmap
Definition: vtkTextureObject.h:802
vtkTextureObject::SupportsTextureInteger
bool SupportsTextureInteger
Definition: vtkTextureObject.h:781
vtkTextureObject::GetMaximumTextureSize
static int GetMaximumTextureSize(vtkOpenGLRenderWindow *context)
Query and return maximum texture size (dimension) supported by the OpenGL driver for a particular con...
vtkTextureObject::SupportsDepthBufferFloat
bool SupportsDepthBufferFloat
Definition: vtkTextureObject.h:785
vtkTextureObject::SetInternalFormat
void SetInternalFormat(unsigned int glInternalFormat)
vtkTextureObject::GetFormat
unsigned int GetFormat(int vtktype, int numComps, bool shaderSupportsTextureInt)
Get/Set format (OpenGL internal format) that should be used.
vtkTextureObject::MirroredRepeat
@ MirroredRepeat
Definition: vtkTextureObject.h:69
vtkTextureObject::AllocateDepth
bool AllocateDepth(unsigned int width, unsigned int height, int internalFormat)
Create a 2D depth texture but does not initialize its values.
vtkTextureObject::GetVTKDataType
int GetVTKDataType()
Get the data type for the texture as a vtk type int i.e.
vtkTextureObject::Fixed8
@ Fixed8
Definition: vtkTextureObject.h:99
vtkTextureObject::GetLinearMagnification
bool GetLinearMagnification()
Definition: vtkTextureObject.h:528
vtkTextureObject::vtkTextureObject
vtkTextureObject()
vtkTextureObject::Allocate2D
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.
vtkTextureObject::GetTextureUnit
int GetTextureUnit()
Return the texture unit used for this texture.
vtkTextureObject::MaxLevel
int MaxLevel
Definition: vtkTextureObject.h:796
vtkTextureObject::GetShiftAndScale
void GetShiftAndScale(float &shift, float &scale)
Get the shift and scale required in the shader to return the texture values to their original range.
vtkTextureObject::CreateDepth
bool CreateDepth(unsigned int width, unsigned int height, int internalFormat, vtkPixelBufferObject *pbo)
Create a 2D depth texture using a PBO.
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:38
vtkTextureObject::Context
vtkWeakPointer< vtkOpenGLRenderWindow > Context
Definition: vtkTextureObject.h:778
vtkTextureObject::GetInternalFormat
unsigned int GetInternalFormat(int vtktype, int numComps, bool shaderSupportsTextureInt)
Get/Set internal format (OpenGL internal format) that should be used.
vtkTextureObject::GetMinificationFilterMode
unsigned int GetMinificationFilterMode(int vtktype)
vtkTextureObject::GetMagnificationFilterMode
unsigned int GetMagnificationFilterMode(int vtktype)
vtkTextureObject::MinificationFilter
int MinificationFilter
Definition: vtkTextureObject.h:790
vtkX3D::level
@ level
Definition: vtkX3D.h:395
vtkTextureObject::GetTuples
unsigned int GetTuples()
Definition: vtkTextureObject.h:136
vtkTextureObject::RequireDepthBufferFloat
bool RequireDepthBufferFloat
Definition: vtkTextureObject.h:784
vtkTextureObject::Never
@ Never
Definition: vtkTextureObject.h:58
vtkTextureObject::Float32
@ Float32
Definition: vtkTextureObject.h:104
vtkTextureObject::GetDefaultFormat
unsigned int GetDefaultFormat(int vtktype, int numComps, bool shaderSupportsTextureInt)
vtkTextureObject::CreateTexture
void CreateTexture()
Creates a texture handle if not already created.
vtkTextureObject::ShaderProgram
vtkOpenGLHelper * ShaderProgram
Definition: vtkTextureObject.h:808
vtkTextureObject::GetWrapRMode
unsigned int GetWrapRMode(int vtktype)
vtkX3D::height
@ height
Definition: vtkX3D.h:254
vtkTextureObject::NearestMipmapLinear
@ NearestMipmapLinear
Definition: vtkTextureObject.h:89
vtkTextureObject::Greater
@ Greater
Definition: vtkTextureObject.h:54
vtkTextureObject::LinearMipmapNearest
@ LinearMipmapNearest
Definition: vtkTextureObject.h:90
vtkTextureObject::Resize
void Resize(unsigned int width, unsigned int height)
vtkShaderProgram
The ShaderProgram uses one or more Shader objects.
Definition: vtkShaderProgram.h:48
vtkTextureObject::IsSupported
static bool IsSupported(vtkOpenGLRenderWindow *)
Check for feature support, without any optional features.
Definition: vtkTextureObject.h:664
vtkGenericOpenGLResourceFreeCallback
Definition: vtkOpenGLResourceFreeCallback.h:26
vtkTextureObject::Components
int Components
Definition: vtkTextureObject.h:776
vtkOpenGLHelper
Definition: vtkOpenGLHelper.h:31
vtkTextureObject::Fixed32
@ Fixed32
Definition: vtkTextureObject.h:102
vtkTextureObject::RequireTextureInteger
bool RequireTextureInteger
Definition: vtkTextureObject.h:780
vtkTextureObject::Deactivate
void Deactivate()
Deactivate and UnBind the texture.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkTextureObject
abstracts an OpenGL texture object.
Definition: vtkTextureObject.h:45
vtkTextureObject::New
static vtkTextureObject * New()
vtkTextureObject::Width
unsigned int Width
Definition: vtkTextureObject.h:766
vtkTextureObject::CopyFromFrameBuffer
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.
vtkTextureObject::Create3D
bool Create3D(unsigned int width, unsigned int height, unsigned int depth, int numComps, vtkPixelBufferObject *pbo, bool shaderSupportsTextureInt)
Create a 3D texture using the PBO.
vtkTextureObject::Fixed16
@ Fixed16
Definition: vtkTextureObject.h:100
vtkTextureObject::Repeat
@ Repeat
Definition: vtkTextureObject.h:68
vtkWeakPointer.h
vtkTextureObject::ResetFormatAndType
void ResetFormatAndType()
Reset format, internal format, and type of the texture.
vtkTextureObject::Equal
@ Equal
Definition: vtkTextureObject.h:55
vtkTextureObject::GetContext
vtkOpenGLRenderWindow * GetContext()
vtkTextureObject::Allocate1D
bool Allocate1D(unsigned int width, int numComps, int vtkType)
Create a 1D color texture but does not initialize its values.
vtkTextureObject::Less
@ Less
Definition: vtkTextureObject.h:53
vtkTextureObject::SetDataType
void SetDataType(unsigned int glType)
vtkObject.h
vtkTextureObject::MaxLOD
float MaxLOD
Definition: vtkTextureObject.h:794
vtkTextureObject::SendParameters
void SendParameters()
Send all the texture object parameters to the hardware if not done yet.
vtkTextureObject::Linear
@ Linear
Definition: vtkTextureObject.h:87
vtkTextureObject::Allocate3D
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.
vtkTextureObject::Create2D
bool Create2D(unsigned int width, unsigned int height, int numComps, vtkPixelBufferObject *pbo, bool shaderSupportsTextureInt)
Create a 2D texture using the PBO.
vtkTextureObject::Gequal
@ Gequal
Definition: vtkTextureObject.h:52
vtkTextureObject::Create1DFromRaw
bool Create1DFromRaw(unsigned int width, int numComps, int dataType, void *data)
Create 1D texture from client memory.
vtkTextureObject::SupportsTextureFloat
bool SupportsTextureFloat
Definition: vtkTextureObject.h:783
vtkTextureObject::ClampToBorder
@ ClampToBorder
Definition: vtkTextureObject.h:70
vtkTextureObject::WrapS
int WrapS
Definition: vtkTextureObject.h:787
vtkTextureObject::Handle
unsigned int Handle
Definition: vtkTextureObject.h:779
vtkTextureObject::IsBound
bool IsBound()
Tells if the texture object is bound to the active texture image unit.
vtkTextureObject::GetDataType
int GetDataType(int vtk_scalar_type)
Get the data type for the texture as GLenum type.
vtkTextureObject::AutoParameters
int AutoParameters
Definition: vtkTextureObject.h:804
vtkTextureObject::GetMaximumTextureSize3D
int GetMaximumTextureSize3D()
Overload which uses the internal context to query the maximum 3D texture size.
vtkTextureObject::GetDefaultDataType
int GetDefaultDataType(int vtk_scalar_type)
vtkTextureObject::Height
unsigned int Height
Definition: vtkTextureObject.h:767
vtkTextureObject::CopyToFrameBuffer
void CopyToFrameBuffer(vtkShaderProgram *program, vtkOpenGLVertexArrayObject *vao)
Copy the texture (src) in the current framebuffer.
vtkTextureObject::GetWrapSMode
unsigned int GetWrapSMode(int vtktype)
vtkTextureObject::CreateDepthFromRaw
bool CreateDepthFromRaw(unsigned int width, unsigned int height, int internalFormat, int rawType, void *raw)
Create a 2D depth texture using a raw pointer.
vtkTextureObject::Format
unsigned int Format
Definition: vtkTextureObject.h:773
vtkOpenGLRenderWindow
OpenGL rendering window.
Definition: vtkOpenGLRenderWindow.h:54
vtkTextureObject::Bind
void Bind()
Bind the texture, must have been created using Create().
vtkTextureObject::Create2D
bool Create2D(unsigned int width, unsigned int height, int numComps, int vtktype, bool)
Create texture without uploading any data.
Definition: vtkTextureObject.h:346
vtkTextureObject::GetWrapTMode
unsigned int GetWrapTMode(int vtktype)
vtkTextureObject::WrapT
int WrapT
Definition: vtkTextureObject.h:788
vtkTextureObject::GetMaximumTextureSize3D
static int GetMaximumTextureSize3D(vtkOpenGLRenderWindow *context)
vtkTextureObject::Create2DFromRaw
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].
vtkTextureObject::SetLinearMagnification
void SetLinearMagnification(bool val)
Tells if the magnification mode is linear (true) or nearest (false).
Definition: vtkTextureObject.h:525
vtkTextureObject::Fixed24
@ Fixed24
Definition: vtkTextureObject.h:101
vtkTextureObject::DestroyTexture
void DestroyTexture()
Destroy the texture.
vtkTextureObject::DepthTextureCompareFunction
int DepthTextureCompareFunction
Definition: vtkTextureObject.h:800
vtkTextureObject::Float16
@ Float16
Definition: vtkTextureObject.h:103
vtkOpenGLVertexArrayObject
The VertexArrayObject class uses, or emulates, vertex array objects.
Definition: vtkOpenGLVertexArrayObject.h:37
vtkTextureObject::IsSupported
static bool IsSupported(vtkOpenGLRenderWindow *, bool, bool, bool)
Returns if the context supports the required extensions.
Definition: vtkTextureObject.h:655
vtkTextureObject::BaseLevel
int BaseLevel
Definition: vtkTextureObject.h:795
vtkTextureObject::Type
unsigned int Type
Definition: vtkTextureObject.h:775
vtkPixelBufferObject
abstracts an OpenGL pixel buffer object.
Definition: vtkPixelBufferObject.h:44
vtkTextureObject::Activate
void Activate()
Activate and Bind the texture.
vtkWeakPointer< vtkOpenGLRenderWindow >
vtkTextureObject::InternalFormat
unsigned int InternalFormat
Definition: vtkTextureObject.h:774
vtkTextureObject::NearestMipmapNearest
@ NearestMipmapNearest
Definition: vtkTextureObject.h:88
vtkTextureObject::MinLOD
float MinLOD
Definition: vtkTextureObject.h:793