24 #ifndef vtkTextureObject_h 25 #define vtkTextureObject_h 27 #include "vtkRenderingOpenGL2Module.h" 56 NumberOfDepthTextureCompareFunctions
61 #if GL_ES_VERSION_3_0 != 1 89 NumberOfMinificationModes
120 NumberOfDepthModeFormats
146 vtkGetMacro(Width,
unsigned int);
147 vtkGetMacro(Height,
unsigned int);
148 vtkGetMacro(Depth,
unsigned int);
149 vtkGetMacro(Samples,
unsigned int);
150 vtkGetMacro(Components,
int);
152 {
return this->Width*this->Height*this->Depth; }
155 vtkGetMacro(NumberOfDimensions,
int);
164 vtkGetMacro(Target,
unsigned int);
171 vtkGetMacro(Handle,
unsigned int);
177 int GetTextureUnit();
202 void ReleaseGraphicsResources(
vtkWindow *win);
217 void SendParameters();
219 vtkGetMacro(AutoParameters,
int);
226 bool Create2DFromRaw(
unsigned int width,
unsigned int height,
227 int numComps,
int dataType,
void *
data);
233 bool CreateDepthFromRaw(
unsigned int width,
unsigned int height,
234 int internalFormat,
int rawType,
241 bool CreateTextureBuffer(
unsigned int numValues,
int numComps,
249 bool CreateCubeFromRaw(
unsigned int width,
unsigned int height,
250 int numComps,
int dataType,
void *data[6]);
253 #if GL_ES_VERSION_3_0 != 1 265 bool Create1D(
int numComps,
267 bool shaderSupportsTextureInt);
272 bool Create1DFromRaw(
unsigned int width,
int numComps,
273 int dataType,
void *data);
278 bool CreateAlphaFromRaw(
unsigned int width,
290 bool Create2D(
unsigned int width,
unsigned int height,
int numComps,
292 bool shaderSupportsTextureInt);
300 bool Create3D(
unsigned int width,
unsigned int height,
unsigned int depth,
302 bool shaderSupportsTextureInt);
308 bool Create3DFromRaw(
unsigned int width,
unsigned int height,
309 unsigned int depth,
int numComps,
310 int dataType,
void *data);
318 bool AllocateProxyTexture3D(
unsigned int const width,
unsigned int const height,
319 unsigned int const depth,
int const numComps,
int const dataType);
333 bool CreateDepth(
unsigned int width,
341 bool AllocateDepth(
unsigned int width,
unsigned int height,
348 bool Allocate1D(
unsigned int width,
int numComps,
int vtkType);
354 bool Allocate2D(
unsigned int width,
unsigned int height,
int numComps,
361 bool Allocate3D(
unsigned int width,
unsigned int height,
362 unsigned int depth,
int numComps,
370 bool Create2D(
unsigned int width,
unsigned int height,
int numComps,
372 return this->Allocate2D(width, height, numComps, vtktype); }
373 bool Create3D(
unsigned int width,
unsigned int height,
unsigned int depth,
374 int numComps,
int vtktype,
bool ) {
375 return this->Allocate3D(width, height, depth, numComps, vtktype); }
381 int GetVTKDataType();
387 int GetDataType(
int vtk_scalar_type);
388 void SetDataType(
unsigned int glType);
389 int GetDefaultDataType(
int vtk_scalar_type);
398 unsigned int GetInternalFormat(
int vtktype,
int numComps,
399 bool shaderSupportsTextureInt);
400 void SetInternalFormat(
unsigned int glInternalFormat);
401 unsigned int GetDefaultInternalFormat(
int vtktype,
int numComps,
402 bool shaderSupportsTextureInt);
411 unsigned int GetFormat(
int vtktype,
int numComps,
412 bool shaderSupportsTextureInt);
413 void SetFormat(
unsigned int glFormat);
414 unsigned int GetDefaultFormat(
int vtktype,
int numComps,
415 bool shaderSupportsTextureInt);
426 void ResetFormatAndType();
428 unsigned int GetMinificationFilterMode(
int vtktype);
429 unsigned int GetMagnificationFilterMode(
int vtktype);
430 unsigned int GetWrapSMode(
int vtktype);
431 unsigned int GetWrapTMode(
int vtktype);
432 unsigned int GetWrapRMode(
int vtktype);
442 vtkGetMacro(RequireDepthBufferFloat,
bool);
443 vtkGetMacro(SupportsDepthBufferFloat,
bool);
454 vtkGetMacro(RequireTextureFloat,
bool);
455 vtkGetMacro(SupportsTextureFloat,
bool);
466 vtkGetMacro(RequireTextureInteger,
bool);
467 vtkGetMacro(SupportsTextureInteger,
bool);
481 vtkGetMacro(WrapS,
int);
496 vtkGetMacro(WrapT,
int);
511 vtkGetMacro(WrapR,
int);
529 vtkGetMacro(MinificationFilter,
int);
541 vtkGetMacro(MagnificationFilter,
int);
550 { this->SetMagnificationFilter(val?Linear:Nearest); }
553 {
return this->MagnificationFilter==Linear; }
561 vtkSetVector4Macro(BorderColor,
float);
562 vtkGetVector4Macro(BorderColor,
float);
571 vtkGetMacro(MinLOD,
float);
580 vtkGetMacro(MaxLOD,
float);
590 vtkGetMacro(BaseLevel,
int);
600 vtkGetMacro(MaxLevel,
int);
614 vtkGetMacro(DepthTextureCompare,
bool);
639 vtkGetMacro(DepthTextureCompareFunction,
int);
649 vtkGetMacro(GenerateMipmap,
bool);
671 int GetMaximumTextureSize3D();
679 static bool IsSupported(
681 bool requireTexFloat,
682 bool requireDepthFloat,
700 void CopyToFrameBuffer(
int srcXmin,
int srcYmin,
701 int srcXmax,
int srcYmax,
702 int dstXmin,
int dstYmin,
703 int dstXmax,
int dstYmax,
704 int dstSizeX,
int dstSizeY,
709 void CopyToFrameBuffer(
int srcXmin,
int srcYmin,
710 int srcXmax,
int srcYmax,
711 int dstXmin,
int dstYmin,
712 int dstSizeX,
int dstSizeY,
717 void CopyToFrameBuffer(
float *tcoords,
float *verts,
735 void CopyFromFrameBuffer(
int srcXmin,
754 void GetShiftAndScale(
float &shift,
float &
scale);
758 void Resize(
unsigned int width,
unsigned int height);
774 void CreateTexture();
779 void DestroyTexture();
781 int NumberOfDimensions;
795 bool RequireTextureInteger;
796 bool SupportsTextureInteger;
797 bool RequireTextureFloat;
798 bool SupportsTextureFloat;
799 bool RequireDepthBufferFloat;
800 bool SupportsDepthBufferFloat;
805 int MinificationFilter;
806 int MagnificationFilter;
812 float BorderColor[4];
814 bool DepthTextureCompare;
815 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.
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.