15 #ifndef vtkTextureObject_h
16 #define vtkTextureObject_h
19 #include "vtkRenderingOpenGL2Module.h"
23 VTK_ABI_NAMESPACE_BEGIN
47 NumberOfDepthTextureCompareFunctions
69 NumberOfMinificationModes
108 vtkGetMacro(Width,
unsigned int);
109 vtkGetMacro(Height,
unsigned int);
110 vtkGetMacro(Depth,
unsigned int);
111 vtkGetMacro(Samples,
unsigned int);
112 vtkGetMacro(Components,
int);
113 unsigned int GetTuples() {
return this->Width * this->Height * this->Depth; }
116 vtkGetMacro(NumberOfDimensions,
int);
119 vtkSetMacro(Samples,
unsigned int);
125 vtkGetMacro(
Target,
unsigned int);
132 vtkGetMacro(Handle,
unsigned int);
138 int GetTextureUnit();
152 virtual void Activate();
162 virtual void ReleaseGraphicsResources(
vtkWindow* win);
176 void SendParameters();
183 vtkSetMacro(AutoParameters,
int);
184 vtkGetMacro(AutoParameters,
int);
185 vtkBooleanMacro(AutoParameters,
int);
192 bool Create2DFromRaw(
193 unsigned int width,
unsigned int height,
int numComps,
int dataType,
void*
data);
201 bool Create2DArrayFromRaw(
202 unsigned int width,
unsigned int height,
int numComps,
int dataType,
int nbLayers,
void*
data);
209 bool CreateDepthFromRaw(
210 unsigned int width,
unsigned int height,
int internalFormat,
int rawType,
void* raw);
216 bool CreateTextureBuffer(
225 bool EmulateTextureBufferWith2DTextures(
236 bool EmulateTextureBufferWith2DTexturesFromRaw(
237 unsigned int numValues,
int numComps,
int dataType,
void*
data);
253 bool UpdateTextureBuffer2DRegion(
254 unsigned int texelOffset,
unsigned int numTexels,
int numComps,
int dataType,
void*
data);
261 bool CreateCubeFromRaw(
262 unsigned int width,
unsigned int height,
int numComps,
int dataType,
void*
data[6]);
279 bool Create1DFromRaw(
unsigned int width,
int numComps,
int dataType,
void*
data);
288 bool shaderSupportsTextureInt);
296 bool Create3D(
unsigned int width,
unsigned int height,
unsigned int depth,
int numComps,
303 bool Create3DFromRaw(
unsigned int width,
unsigned int height,
unsigned int depth,
int numComps,
304 int dataType,
void*
data);
312 bool AllocateProxyTexture3D(
313 unsigned int width,
unsigned int height,
unsigned int depth,
int numComps,
int dataType);
334 bool AllocateDepth(
unsigned int width,
unsigned int height,
int internalFormat);
339 bool AllocateDepthStencil(
unsigned int width,
unsigned int height);
345 bool Allocate1D(
unsigned int width,
int numComps,
int vtkType);
352 unsigned int width,
unsigned int height,
int numComps,
int vtkType,
int level = 0);
359 unsigned int width,
unsigned int height,
unsigned int depth,
int numComps,
int vtkType);
365 bool Create2D(
unsigned int width,
unsigned int height,
int numComps,
int vtktype,
bool)
367 return this->Allocate2D(width, height, numComps, vtktype);
370 unsigned int width,
unsigned int height,
unsigned int depth,
int numComps,
int vtktype,
bool)
372 return this->Allocate3D(width, height, depth, numComps, vtktype);
379 int GetVTKDataType();
385 int GetDataType(
int vtk_scalar_type);
386 void SetDataType(
unsigned int glType);
387 int GetDefaultDataType(
int vtk_scalar_type);
396 unsigned int GetInternalFormat(
int vtktype,
int numComps,
bool shaderSupportsTextureInt);
397 void SetInternalFormat(
unsigned int glInternalFormat);
398 unsigned int GetDefaultInternalFormat(
int vtktype,
int numComps,
bool shaderSupportsTextureInt);
407 unsigned int GetFormat(
int vtktype,
int numComps,
bool shaderSupportsTextureInt);
408 void SetFormat(
unsigned int glFormat);
409 unsigned int GetDefaultFormat(
int vtktype,
int numComps,
bool shaderSupportsTextureInt);
420 void ResetFormatAndType();
422 unsigned int GetMinificationFilterMode(
int vtktype);
423 unsigned int GetMagnificationFilterMode(
int vtktype);
424 unsigned int GetWrapSMode(
int vtktype);
425 unsigned int GetWrapTMode(
int vtktype);
426 unsigned int GetWrapRMode(
int vtktype);
435 vtkSetMacro(RequireDepthBufferFloat,
bool);
436 vtkGetMacro(RequireDepthBufferFloat,
bool);
437 vtkGetMacro(SupportsDepthBufferFloat,
bool);
447 vtkSetMacro(RequireTextureFloat,
bool);
448 vtkGetMacro(RequireTextureFloat,
bool);
449 vtkGetMacro(SupportsTextureFloat,
bool);
459 vtkSetMacro(RequireTextureInteger,
bool);
460 vtkGetMacro(RequireTextureInteger,
bool);
461 vtkGetMacro(SupportsTextureInteger,
bool);
475 vtkGetMacro(WrapS,
int);
476 vtkSetMacro(WrapS,
int);
490 vtkGetMacro(WrapT,
int);
491 vtkSetMacro(WrapT,
int);
505 vtkGetMacro(WrapR,
int);
506 vtkSetMacro(WrapR,
int);
523 vtkGetMacro(MinificationFilter,
int);
524 vtkSetMacro(MinificationFilter,
int);
535 vtkGetMacro(MagnificationFilter,
int);
536 vtkSetMacro(MagnificationFilter,
int);
553 vtkSetVector4Macro(BorderColor,
float);
554 vtkGetVector4Macro(BorderColor,
float);
562 vtkSetMacro(MinLOD,
float);
563 vtkGetMacro(MinLOD,
float);
571 vtkSetMacro(MaxLOD,
float);
572 vtkGetMacro(MaxLOD,
float);
581 vtkSetMacro(BaseLevel,
int);
582 vtkGetMacro(BaseLevel,
int);
591 vtkSetMacro(MaxLevel,
int);
592 vtkGetMacro(MaxLevel,
int);
606 vtkGetMacro(DepthTextureCompare,
bool);
607 vtkSetMacro(DepthTextureCompare,
bool);
631 vtkGetMacro(DepthTextureCompareFunction,
int);
632 vtkSetMacro(DepthTextureCompareFunction,
int);
641 vtkGetMacro(GenerateMipmap,
bool);
642 vtkSetMacro(GenerateMipmap,
bool);
651 vtkSetMacro(MaximumAnisotropicFiltering,
float);
652 vtkGetMacro(MaximumAnisotropicFiltering,
float);
673 int GetMaximumTextureSize3D();
682 bool requireDepthFloat,
bool requireTexInt);
700 void CopyToFrameBuffer(
int srcXmin,
int srcYmin,
int srcXmax,
int srcYmax,
int dstXmin,
701 int dstYmin,
int dstXmax,
int dstYmax,
int dstSizeX,
int dstSizeY,
vtkShaderProgram* program,
704 void CopyToFrameBuffer(
int srcXmin,
int srcYmin,
int srcXmax,
int srcYmax,
int dstXmin,
708 void CopyToFrameBuffer(
723 void CopyFromFrameBuffer(
724 int srcXmin,
int srcYmin,
int dstXmin,
int dstYmin,
int width,
int height);
738 void GetShiftAndScale(
float& shift,
float&
scale);
742 void Resize(
unsigned int width,
unsigned int height);
751 vtkGetMacro(UseSRGBColorSpace,
bool);
752 vtkSetMacro(UseSRGBColorSpace,
bool);
753 vtkBooleanMacro(UseSRGBColorSpace,
bool);
764 void AssignToExistingTexture(
unsigned int handle,
unsigned int target);
780 void CreateTexture();
785 void DestroyTexture();
822 float BorderColor[4];
843 VTK_ABI_NAMESPACE_END
bool SupportsTextureFloat
static bool IsSupported(vtkOpenGLRenderWindow *renWin)
Check for feature support, without any optional features.
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).
unsigned int GetFormat()
Get the format (GLenum) and internal format (GLenum) in use.
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.
unsigned int GetInternalFormat()
Get the format (GLenum) and internal format (GLenum) in use.
vtkOpenGLBufferObject * BufferObject
bool RequireTextureInteger
abstracts an OpenGL texture object.
float MaximumAnisotropicFiltering
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
vtkGenericOpenGLResourceFreeCallback * ResourceCallback
bool SupportsTextureInteger
static bool IsSupported(vtkOpenGLRenderWindow *renWin, bool requireTexFloat, bool requireDepthFloat, bool requireTexInt)
Returns if the context supports the required extensions.
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.