27 #ifndef vtkTextureObject_h 28 #define vtkTextureObject_h 30 #include "vtkRenderingOpenGL2Module.h" 59 NumberOfDepthTextureCompareFunctions
64 #if GL_ES_VERSION_3_0 != 1 92 NumberOfMinificationModes
131 vtkGetMacro(Width,
unsigned int);
132 vtkGetMacro(Height,
unsigned int);
133 vtkGetMacro(Depth,
unsigned int);
134 vtkGetMacro(Samples,
unsigned int);
135 vtkGetMacro(Components,
int);
137 {
return this->Width*this->Height*this->Depth; }
140 vtkGetMacro(NumberOfDimensions,
int);
149 vtkGetMacro(Target,
unsigned int);
156 vtkGetMacro(Handle,
unsigned int);
162 int GetTextureUnit();
186 void ReleaseGraphicsResources(
vtkWindow *win);
201 void SendParameters();
203 vtkGetMacro(AutoParameters,
int);
210 bool Create2DFromRaw(
unsigned int width,
unsigned int height,
211 int numComps,
int dataType,
void *
data);
217 bool CreateDepthFromRaw(
unsigned int width,
unsigned int height,
218 int internalFormat,
int rawType,
225 bool CreateTextureBuffer(
unsigned int numValues,
int numComps,
233 bool CreateCubeFromRaw(
unsigned int width,
unsigned int height,
234 int numComps,
int dataType,
void *
data[6]);
237 #if GL_ES_VERSION_3_0 != 1 249 bool Create1D(
int numComps,
251 bool shaderSupportsTextureInt);
256 bool Create1DFromRaw(
unsigned int width,
int numComps,
257 int dataType,
void *
data);
266 bool Create2D(
unsigned int width,
unsigned int height,
int numComps,
268 bool shaderSupportsTextureInt);
276 bool Create3D(
unsigned int width,
unsigned int height,
unsigned int depth,
278 bool shaderSupportsTextureInt);
284 bool Create3DFromRaw(
unsigned int width,
unsigned int height,
285 unsigned int depth,
int numComps,
286 int dataType,
void *
data);
294 bool AllocateProxyTexture3D(
unsigned int const width,
unsigned int const height,
295 unsigned int const depth,
int const numComps,
int const dataType);
309 bool CreateDepth(
unsigned int width,
317 bool AllocateDepth(
unsigned int width,
unsigned int height,
324 bool Allocate1D(
unsigned int width,
int numComps,
int vtkType);
330 bool Allocate2D(
unsigned int width,
unsigned int height,
int numComps,
337 bool Allocate3D(
unsigned int width,
unsigned int height,
338 unsigned int depth,
int numComps,
348 return this->Allocate2D(width,
height, numComps, vtktype); }
350 int numComps,
int vtktype,
bool ) {
351 return this->Allocate3D(width,
height, depth, numComps, vtktype); }
357 int GetVTKDataType();
363 int GetDataType(
int vtk_scalar_type);
364 void SetDataType(
unsigned int glType);
365 int GetDefaultDataType(
int vtk_scalar_type);
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);
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);
402 void ResetFormatAndType();
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);
418 vtkGetMacro(RequireDepthBufferFloat,
bool);
419 vtkGetMacro(SupportsDepthBufferFloat,
bool);
430 vtkGetMacro(RequireTextureFloat,
bool);
431 vtkGetMacro(SupportsTextureFloat,
bool);
442 vtkGetMacro(RequireTextureInteger,
bool);
443 vtkGetMacro(SupportsTextureInteger,
bool);
457 vtkGetMacro(WrapS,
int);
472 vtkGetMacro(WrapT,
int);
487 vtkGetMacro(WrapR,
int);
505 vtkGetMacro(MinificationFilter,
int);
517 vtkGetMacro(MagnificationFilter,
int);
526 { this->SetMagnificationFilter(val?Linear:Nearest); }
529 {
return this->MagnificationFilter==Linear; }
537 vtkSetVector4Macro(BorderColor,
float);
538 vtkGetVector4Macro(BorderColor,
float);
547 vtkGetMacro(MinLOD,
float);
556 vtkGetMacro(MaxLOD,
float);
566 vtkGetMacro(BaseLevel,
int);
576 vtkGetMacro(MaxLevel,
int);
590 vtkGetMacro(DepthTextureCompare,
bool);
615 vtkGetMacro(DepthTextureCompareFunction,
int);
625 vtkGetMacro(GenerateMipmap,
bool);
647 int GetMaximumTextureSize3D();
655 static bool IsSupported(
657 bool requireTexFloat,
658 bool requireDepthFloat,
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,
685 void CopyToFrameBuffer(
int srcXmin,
int srcYmin,
686 int srcXmax,
int srcYmax,
687 int dstXmin,
int dstYmin,
688 int dstSizeX,
int dstSizeY,
693 void CopyToFrameBuffer(
float *tcoords,
float *verts,
711 void CopyFromFrameBuffer(
int srcXmin,
730 void GetShiftAndScale(
float &shift,
float &
scale);
734 void Resize(
unsigned int width,
unsigned int height);
743 vtkGetMacro(UseSRGBColorSpace,
bool);
763 void CreateTexture();
768 void DestroyTexture();
770 int NumberOfDimensions;
785 bool RequireTextureInteger;
786 bool SupportsTextureInteger;
787 bool RequireTextureFloat;
788 bool SupportsTextureFloat;
789 bool RequireDepthBufferFloat;
790 bool SupportsDepthBufferFloat;
795 int MinificationFilter;
796 int MagnificationFilter;
802 float BorderColor[4];
804 bool DepthTextureCompare;
805 int DepthTextureCompareFunction;
static bool IsSupported(vtkOpenGLRenderWindow *renWin)
Check for feature support, without any optional features.
abstract base class for most VTK objects
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
static bool IsSupported(vtkRenderWindow *renWin, bool requireTexFloat, bool requireDepthFloat, bool requireTexInt)
Returns if the context supports the required extensions.
window superclass for vtkRenderWindow
a simple class to control print indentation
The VertexArrayObject class uses, or emulates, vertex array objects.
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
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
abstracts an OpenGL texture object.
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
vtkGenericOpenGLResourceFreeCallback * ResourceCallback
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.