27 #ifndef vtkTextureObject_h
28 #define vtkTextureObject_h
31 #include "vtkRenderingOpenGL2Module.h"
57 NumberOfDepthTextureCompareFunctions
62 #ifndef GL_ES_VERSION_3_0
63 enum { ClampToEdge = 0,
Repeat, MirroredRepeat, ClampToBorder, NumberOfWrapModes };
83 NumberOfMinificationModes
122 vtkGetMacro(Width,
unsigned int);
123 vtkGetMacro(Height,
unsigned int);
124 vtkGetMacro(Depth,
unsigned int);
125 vtkGetMacro(Samples,
unsigned int);
126 vtkGetMacro(Components,
int);
127 unsigned int GetTuples() {
return this->Width * this->Height * this->Depth; }
130 vtkGetMacro(NumberOfDimensions,
int);
133 vtkSetMacro(Samples,
unsigned int);
139 vtkGetMacro(
Target,
unsigned int);
146 vtkGetMacro(Handle,
unsigned int);
152 int GetTextureUnit();
166 virtual void Activate();
176 virtual void ReleaseGraphicsResources(
vtkWindow* win);
190 void SendParameters();
197 vtkSetMacro(AutoParameters,
int);
198 vtkGetMacro(AutoParameters,
int);
199 vtkBooleanMacro(AutoParameters,
int);
206 bool Create2DFromRaw(
207 unsigned int width,
unsigned int height,
int numComps,
int dataType,
void*
data);
214 bool CreateDepthFromRaw(
215 unsigned int width,
unsigned int height,
int internalFormat,
int rawType,
void* raw);
221 bool CreateTextureBuffer(
229 bool CreateCubeFromRaw(
230 unsigned int width,
unsigned int height,
int numComps,
int dataType,
void*
data[6]);
247 bool Create1DFromRaw(
unsigned int width,
int numComps,
int dataType,
void*
data);
256 bool shaderSupportsTextureInt);
264 bool Create3D(
unsigned int width,
unsigned int height,
unsigned int depth,
int numComps,
271 bool Create3DFromRaw(
unsigned int width,
unsigned int height,
unsigned int depth,
int numComps,
272 int dataType,
void*
data);
280 bool AllocateProxyTexture3D(
unsigned int const width,
unsigned int const height,
281 unsigned int const depth,
int const numComps,
int const dataType);
302 bool AllocateDepth(
unsigned int width,
unsigned int height,
int internalFormat);
307 bool AllocateDepthStencil(
unsigned int width,
unsigned int height);
313 bool Allocate1D(
unsigned int width,
int numComps,
int vtkType);
320 unsigned int width,
unsigned int height,
int numComps,
int vtkType,
int level = 0);
327 unsigned int width,
unsigned int height,
unsigned int depth,
int numComps,
int vtkType);
333 bool Create2D(
unsigned int width,
unsigned int height,
int numComps,
int vtktype,
bool)
335 return this->Allocate2D(width, height, numComps, vtktype);
338 unsigned int width,
unsigned int height,
unsigned int depth,
int numComps,
int vtktype,
bool)
340 return this->Allocate3D(width, height, depth, numComps, vtktype);
347 int GetVTKDataType();
353 int GetDataType(
int vtk_scalar_type);
354 void SetDataType(
unsigned int glType);
355 int GetDefaultDataType(
int vtk_scalar_type);
364 unsigned int GetInternalFormat(
int vtktype,
int numComps,
bool shaderSupportsTextureInt);
365 void SetInternalFormat(
unsigned int glInternalFormat);
366 unsigned int GetDefaultInternalFormat(
int vtktype,
int numComps,
bool shaderSupportsTextureInt);
375 unsigned int GetFormat(
int vtktype,
int numComps,
bool shaderSupportsTextureInt);
376 void SetFormat(
unsigned int glFormat);
377 unsigned int GetDefaultFormat(
int vtktype,
int numComps,
bool shaderSupportsTextureInt);
388 void ResetFormatAndType();
390 unsigned int GetMinificationFilterMode(
int vtktype);
391 unsigned int GetMagnificationFilterMode(
int vtktype);
392 unsigned int GetWrapSMode(
int vtktype);
393 unsigned int GetWrapTMode(
int vtktype);
394 unsigned int GetWrapRMode(
int vtktype);
403 vtkSetMacro(RequireDepthBufferFloat,
bool);
404 vtkGetMacro(RequireDepthBufferFloat,
bool);
405 vtkGetMacro(SupportsDepthBufferFloat,
bool);
415 vtkSetMacro(RequireTextureFloat,
bool);
416 vtkGetMacro(RequireTextureFloat,
bool);
417 vtkGetMacro(SupportsTextureFloat,
bool);
427 vtkSetMacro(RequireTextureInteger,
bool);
428 vtkGetMacro(RequireTextureInteger,
bool);
429 vtkGetMacro(SupportsTextureInteger,
bool);
443 vtkGetMacro(WrapS,
int);
444 vtkSetMacro(WrapS,
int);
458 vtkGetMacro(WrapT,
int);
459 vtkSetMacro(WrapT,
int);
473 vtkGetMacro(WrapR,
int);
474 vtkSetMacro(WrapR,
int);
491 vtkGetMacro(MinificationFilter,
int);
492 vtkSetMacro(MinificationFilter,
int);
503 vtkGetMacro(MagnificationFilter,
int);
504 vtkSetMacro(MagnificationFilter,
int);
521 vtkSetVector4Macro(BorderColor,
float);
522 vtkGetVector4Macro(BorderColor,
float);
530 vtkSetMacro(MinLOD,
float);
531 vtkGetMacro(MinLOD,
float);
539 vtkSetMacro(MaxLOD,
float);
540 vtkGetMacro(MaxLOD,
float);
549 vtkSetMacro(BaseLevel,
int);
550 vtkGetMacro(BaseLevel,
int);
559 vtkSetMacro(MaxLevel,
int);
560 vtkGetMacro(MaxLevel,
int);
574 vtkGetMacro(DepthTextureCompare,
bool);
575 vtkSetMacro(DepthTextureCompare,
bool);
599 vtkGetMacro(DepthTextureCompareFunction,
int);
600 vtkSetMacro(DepthTextureCompareFunction,
int);
609 vtkGetMacro(GenerateMipmap,
bool);
610 vtkSetMacro(GenerateMipmap,
bool);
619 vtkSetMacro(MaximumAnisotropicFiltering,
float);
620 vtkGetMacro(MaximumAnisotropicFiltering,
float);
641 int GetMaximumTextureSize3D();
668 void CopyToFrameBuffer(
int srcXmin,
int srcYmin,
int srcXmax,
int srcYmax,
int dstXmin,
669 int dstYmin,
int dstXmax,
int dstYmax,
int dstSizeX,
int dstSizeY,
vtkShaderProgram* program,
672 void CopyToFrameBuffer(
int srcXmin,
int srcYmin,
int srcXmax,
int srcYmax,
int dstXmin,
676 void CopyToFrameBuffer(
691 void CopyFromFrameBuffer(
692 int srcXmin,
int srcYmin,
int dstXmin,
int dstYmin,
int width,
int height);
706 void GetShiftAndScale(
float& shift,
float&
scale);
710 void Resize(
unsigned int width,
unsigned int height);
719 vtkGetMacro(UseSRGBColorSpace,
bool);
720 vtkSetMacro(UseSRGBColorSpace,
bool);
721 vtkBooleanMacro(UseSRGBColorSpace,
bool);
732 void AssignToExistingTexture(
unsigned int handle,
unsigned int target);
743 void CreateTexture();
748 void DestroyTexture();
785 float BorderColor[4];
bool SupportsTextureFloat
abstract base class for most VTK objects
int DepthTextureCompareFunction
vtkOpenGLHelper * ShaderProgram
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
unsigned int GetTuples()
Get the texture dimensions.
bool GetLinearMagnification()
record modification and/or execution time
unsigned int InternalFormat
vtkTimeStamp SendParametersTime
DatabaseFormatType GetFormat(const Ioss::GroupingEntity *entity)
Given any GroupingEntity pointer, returns the format that the associated database is in...
window superclass for vtkRenderWindow
a simple class to control print indentation
The VertexArrayObject class uses, or emulates, vertex array objects.
bool SupportsDepthBufferFloat
boost::graph_traits< vtkGraph * >::vertex_descriptor target(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
vtkWeakPointer< vtkOpenGLRenderWindow > Context
void SetLinearMagnification(bool val)
Tells if the magnification mode is linear (true) or nearest (false).
abstracts an OpenGL pixel buffer object.
bool Create2D(unsigned int width, unsigned int height, int numComps, int vtktype, bool)
Create texture without uploading any data.
vtkOpenGLBufferObject * BufferObject
static bool IsSupported(vtkOpenGLRenderWindow *, bool, bool, bool)
Returns if the context supports the required extensions.
bool RequireTextureInteger
abstracts an OpenGL texture object.
float MaximumAnisotropicFiltering
static bool IsSupported(vtkOpenGLRenderWindow *)
Check for feature support, without any optional features.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
vtkGenericOpenGLResourceFreeCallback * ResourceCallback
bool SupportsTextureInteger
bool RequireDepthBufferFloat
bool Create3D(unsigned int width, unsigned int height, unsigned int depth, int numComps, int vtktype, bool)
Create texture without uploading any data.
The ShaderProgram uses one or more Shader objects.