15 #ifndef vtkTextureObject_h
16 #define vtkTextureObject_h
19 #include "vtkRenderingOpenGL2Module.h"
22 VTK_ABI_NAMESPACE_BEGIN
46 NumberOfDepthTextureCompareFunctions
51 #ifndef GL_ES_VERSION_3_0
52 enum { ClampToEdge = 0,
Repeat, MirroredRepeat, ClampToBorder, NumberOfWrapModes };
72 NumberOfMinificationModes
111 vtkGetMacro(Width,
unsigned int);
112 vtkGetMacro(Height,
unsigned int);
113 vtkGetMacro(Depth,
unsigned int);
114 vtkGetMacro(Samples,
unsigned int);
115 vtkGetMacro(Components,
int);
116 unsigned int GetTuples() {
return this->Width * this->Height * this->Depth; }
119 vtkGetMacro(NumberOfDimensions,
int);
122 vtkSetMacro(Samples,
unsigned int);
128 vtkGetMacro(
Target,
unsigned int);
135 vtkGetMacro(Handle,
unsigned int);
141 int GetTextureUnit();
155 virtual void Activate();
165 virtual void ReleaseGraphicsResources(
vtkWindow* win);
179 void SendParameters();
186 vtkSetMacro(AutoParameters,
int);
187 vtkGetMacro(AutoParameters,
int);
188 vtkBooleanMacro(AutoParameters,
int);
195 bool Create2DFromRaw(
196 unsigned int width,
unsigned int height,
int numComps,
int dataType,
void*
data);
203 bool CreateDepthFromRaw(
204 unsigned int width,
unsigned int height,
int internalFormat,
int rawType,
void* raw);
210 bool CreateTextureBuffer(
219 bool EmulateTextureBufferWith2DTextures(
227 bool CreateCubeFromRaw(
228 unsigned int width,
unsigned int height,
int numComps,
int dataType,
void*
data[6]);
245 bool Create1DFromRaw(
unsigned int width,
int numComps,
int dataType,
void*
data);
254 bool shaderSupportsTextureInt);
262 bool Create3D(
unsigned int width,
unsigned int height,
unsigned int depth,
int numComps,
269 bool Create3DFromRaw(
unsigned int width,
unsigned int height,
unsigned int depth,
int numComps,
270 int dataType,
void*
data);
278 bool AllocateProxyTexture3D(
279 unsigned int width,
unsigned int height,
unsigned int depth,
int numComps,
int dataType);
300 bool AllocateDepth(
unsigned int width,
unsigned int height,
int internalFormat);
305 bool AllocateDepthStencil(
unsigned int width,
unsigned int height);
311 bool Allocate1D(
unsigned int width,
int numComps,
int vtkType);
318 unsigned int width,
unsigned int height,
int numComps,
int vtkType,
int level = 0);
325 unsigned int width,
unsigned int height,
unsigned int depth,
int numComps,
int vtkType);
331 bool Create2D(
unsigned int width,
unsigned int height,
int numComps,
int vtktype,
bool)
333 return this->Allocate2D(width, height, numComps, vtktype);
336 unsigned int width,
unsigned int height,
unsigned int depth,
int numComps,
int vtktype,
bool)
338 return this->Allocate3D(width, height, depth, numComps, vtktype);
345 int GetVTKDataType();
351 int GetDataType(
int vtk_scalar_type);
352 void SetDataType(
unsigned int glType);
353 int GetDefaultDataType(
int vtk_scalar_type);
362 unsigned int GetInternalFormat(
int vtktype,
int numComps,
bool shaderSupportsTextureInt);
363 void SetInternalFormat(
unsigned int glInternalFormat);
364 unsigned int GetDefaultInternalFormat(
int vtktype,
int numComps,
bool shaderSupportsTextureInt);
373 unsigned int GetFormat(
int vtktype,
int numComps,
bool shaderSupportsTextureInt);
374 void SetFormat(
unsigned int glFormat);
375 unsigned int GetDefaultFormat(
int vtktype,
int numComps,
bool shaderSupportsTextureInt);
386 void ResetFormatAndType();
388 unsigned int GetMinificationFilterMode(
int vtktype);
389 unsigned int GetMagnificationFilterMode(
int vtktype);
390 unsigned int GetWrapSMode(
int vtktype);
391 unsigned int GetWrapTMode(
int vtktype);
392 unsigned int GetWrapRMode(
int vtktype);
401 vtkSetMacro(RequireDepthBufferFloat,
bool);
402 vtkGetMacro(RequireDepthBufferFloat,
bool);
403 vtkGetMacro(SupportsDepthBufferFloat,
bool);
413 vtkSetMacro(RequireTextureFloat,
bool);
414 vtkGetMacro(RequireTextureFloat,
bool);
415 vtkGetMacro(SupportsTextureFloat,
bool);
425 vtkSetMacro(RequireTextureInteger,
bool);
426 vtkGetMacro(RequireTextureInteger,
bool);
427 vtkGetMacro(SupportsTextureInteger,
bool);
441 vtkGetMacro(WrapS,
int);
442 vtkSetMacro(WrapS,
int);
456 vtkGetMacro(WrapT,
int);
457 vtkSetMacro(WrapT,
int);
471 vtkGetMacro(WrapR,
int);
472 vtkSetMacro(WrapR,
int);
489 vtkGetMacro(MinificationFilter,
int);
490 vtkSetMacro(MinificationFilter,
int);
501 vtkGetMacro(MagnificationFilter,
int);
502 vtkSetMacro(MagnificationFilter,
int);
519 vtkSetVector4Macro(BorderColor,
float);
520 vtkGetVector4Macro(BorderColor,
float);
528 vtkSetMacro(MinLOD,
float);
529 vtkGetMacro(MinLOD,
float);
537 vtkSetMacro(MaxLOD,
float);
538 vtkGetMacro(MaxLOD,
float);
547 vtkSetMacro(BaseLevel,
int);
548 vtkGetMacro(BaseLevel,
int);
557 vtkSetMacro(MaxLevel,
int);
558 vtkGetMacro(MaxLevel,
int);
572 vtkGetMacro(DepthTextureCompare,
bool);
573 vtkSetMacro(DepthTextureCompare,
bool);
597 vtkGetMacro(DepthTextureCompareFunction,
int);
598 vtkSetMacro(DepthTextureCompareFunction,
int);
607 vtkGetMacro(GenerateMipmap,
bool);
608 vtkSetMacro(GenerateMipmap,
bool);
617 vtkSetMacro(MaximumAnisotropicFiltering,
float);
618 vtkGetMacro(MaximumAnisotropicFiltering,
float);
639 int GetMaximumTextureSize3D();
666 void CopyToFrameBuffer(
int srcXmin,
int srcYmin,
int srcXmax,
int srcYmax,
int dstXmin,
667 int dstYmin,
int dstXmax,
int dstYmax,
int dstSizeX,
int dstSizeY,
vtkShaderProgram* program,
670 void CopyToFrameBuffer(
int srcXmin,
int srcYmin,
int srcXmax,
int srcYmax,
int dstXmin,
674 void CopyToFrameBuffer(
689 void CopyFromFrameBuffer(
690 int srcXmin,
int srcYmin,
int dstXmin,
int dstYmin,
int width,
int height);
704 void GetShiftAndScale(
float& shift,
float&
scale);
708 void Resize(
unsigned int width,
unsigned int height);
717 vtkGetMacro(UseSRGBColorSpace,
bool);
718 vtkSetMacro(UseSRGBColorSpace,
bool);
719 vtkBooleanMacro(UseSRGBColorSpace,
bool);
730 void AssignToExistingTexture(
unsigned int handle,
unsigned int target);
741 void CreateTexture();
746 void DestroyTexture();
783 float BorderColor[4];
804 VTK_ABI_NAMESPACE_END
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.