24 #ifndef vtkTextureObject_h 25 #define vtkTextureObject_h 27 #include "vtkRenderingOpenGL2Module.h" 56 NumberOfDepthTextureCompareFunctions
61 #if GL_ES_VERSION_3_0 != 1 89 NumberOfMinificationModes
128 vtkGetMacro(Width,
unsigned int);
129 vtkGetMacro(Height,
unsigned int);
130 vtkGetMacro(Depth,
unsigned int);
131 vtkGetMacro(Samples,
unsigned int);
132 vtkGetMacro(Components,
int);
134 {
return this->Width*this->Height*this->Depth; }
137 vtkGetMacro(NumberOfDimensions,
int);
140 vtkSetMacro(Samples,
unsigned int);
146 vtkGetMacro(Target,
unsigned int);
153 vtkGetMacro(Handle,
unsigned int);
159 int GetTextureUnit();
183 void ReleaseGraphicsResources(
vtkWindow *win);
198 void SendParameters();
199 vtkSetMacro(AutoParameters,
int);
200 vtkGetMacro(AutoParameters,
int);
207 bool Create2DFromRaw(
unsigned int width,
unsigned int height,
208 int numComps,
int dataType,
void *
data);
214 bool CreateDepthFromRaw(
unsigned int width,
unsigned int height,
215 int internalFormat,
int rawType,
222 bool CreateTextureBuffer(
unsigned int numValues,
int numComps,
230 bool CreateCubeFromRaw(
unsigned int width,
unsigned int height,
231 int numComps,
int dataType,
void *
data[6]);
234 #if GL_ES_VERSION_3_0 != 1 246 bool Create1D(
int numComps,
248 bool shaderSupportsTextureInt);
253 bool Create1DFromRaw(
unsigned int width,
int numComps,
254 int dataType,
void *
data);
263 bool Create2D(
unsigned int width,
unsigned int height,
int numComps,
265 bool shaderSupportsTextureInt);
273 bool Create3D(
unsigned int width,
unsigned int height,
unsigned int depth,
275 bool shaderSupportsTextureInt);
281 bool Create3DFromRaw(
unsigned int width,
unsigned int height,
282 unsigned int depth,
int numComps,
283 int dataType,
void *
data);
291 bool AllocateProxyTexture3D(
unsigned int const width,
unsigned int const height,
292 unsigned int const depth,
int const numComps,
int const dataType);
306 bool CreateDepth(
unsigned int width,
314 bool AllocateDepth(
unsigned int width,
unsigned int height,
321 bool Allocate1D(
unsigned int width,
int numComps,
int vtkType);
327 bool Allocate2D(
unsigned int width,
unsigned int height,
int numComps,
334 bool Allocate3D(
unsigned int width,
unsigned int height,
335 unsigned int depth,
int numComps,
345 return this->Allocate2D(width,
height, numComps, vtktype); }
347 int numComps,
int vtktype,
bool ) {
348 return this->Allocate3D(width,
height, depth, numComps, vtktype); }
354 int GetVTKDataType();
360 int GetDataType(
int vtk_scalar_type);
361 void SetDataType(
unsigned int glType);
362 int GetDefaultDataType(
int vtk_scalar_type);
371 unsigned int GetInternalFormat(
int vtktype,
int numComps,
372 bool shaderSupportsTextureInt);
373 void SetInternalFormat(
unsigned int glInternalFormat);
374 unsigned int GetDefaultInternalFormat(
int vtktype,
int numComps,
375 bool shaderSupportsTextureInt);
384 unsigned int GetFormat(
int vtktype,
int numComps,
385 bool shaderSupportsTextureInt);
386 void SetFormat(
unsigned int glFormat);
387 unsigned int GetDefaultFormat(
int vtktype,
int numComps,
388 bool shaderSupportsTextureInt);
399 void ResetFormatAndType();
401 unsigned int GetMinificationFilterMode(
int vtktype);
402 unsigned int GetMagnificationFilterMode(
int vtktype);
403 unsigned int GetWrapSMode(
int vtktype);
404 unsigned int GetWrapTMode(
int vtktype);
405 unsigned int GetWrapRMode(
int vtktype);
414 vtkSetMacro(RequireDepthBufferFloat,
bool);
415 vtkGetMacro(RequireDepthBufferFloat,
bool);
416 vtkGetMacro(SupportsDepthBufferFloat,
bool);
426 vtkSetMacro(RequireTextureFloat,
bool);
427 vtkGetMacro(RequireTextureFloat,
bool);
428 vtkGetMacro(SupportsTextureFloat,
bool);
438 vtkSetMacro(RequireTextureInteger,
bool);
439 vtkGetMacro(RequireTextureInteger,
bool);
440 vtkGetMacro(SupportsTextureInteger,
bool);
454 vtkGetMacro(WrapS,
int);
455 vtkSetMacro(WrapS,
int);
469 vtkGetMacro(WrapT,
int);
470 vtkSetMacro(WrapT,
int);
484 vtkGetMacro(WrapR,
int);
485 vtkSetMacro(WrapR,
int);
502 vtkGetMacro(MinificationFilter,
int);
503 vtkSetMacro(MinificationFilter,
int);
514 vtkGetMacro(MagnificationFilter,
int);
515 vtkSetMacro(MagnificationFilter,
int);
523 { this->SetMagnificationFilter(val?Linear:Nearest); }
526 {
return this->MagnificationFilter==Linear; }
534 vtkSetVector4Macro(BorderColor,
float);
535 vtkGetVector4Macro(BorderColor,
float);
543 vtkSetMacro(MinLOD,
float);
544 vtkGetMacro(MinLOD,
float);
552 vtkSetMacro(MaxLOD,
float);
553 vtkGetMacro(MaxLOD,
float);
562 vtkSetMacro(BaseLevel,
int);
563 vtkGetMacro(BaseLevel,
int);
572 vtkSetMacro(MaxLevel,
int);
573 vtkGetMacro(MaxLevel,
int);
587 vtkGetMacro(DepthTextureCompare,
bool);
588 vtkSetMacro(DepthTextureCompare,
bool);
612 vtkGetMacro(DepthTextureCompareFunction,
int);
613 vtkSetMacro(DepthTextureCompareFunction,
int);
622 vtkGetMacro(GenerateMipmap,
bool);
623 vtkSetMacro(GenerateMipmap,
bool);
644 int GetMaximumTextureSize3D();
652 static bool IsSupported(
654 bool requireTexFloat,
655 bool requireDepthFloat,
673 void CopyToFrameBuffer(
int srcXmin,
int srcYmin,
674 int srcXmax,
int srcYmax,
675 int dstXmin,
int dstYmin,
676 int dstXmax,
int dstYmax,
677 int dstSizeX,
int dstSizeY,
682 void CopyToFrameBuffer(
int srcXmin,
int srcYmin,
683 int srcXmax,
int srcYmax,
684 int dstXmin,
int dstYmin,
685 int dstSizeX,
int dstSizeY,
690 void CopyToFrameBuffer(
float *tcoords,
float *verts,
708 void CopyFromFrameBuffer(
int srcXmin,
727 void GetShiftAndScale(
float &shift,
float &
scale);
731 void Resize(
unsigned int width,
unsigned int height);
740 vtkGetMacro(UseSRGBColorSpace,
bool);
741 vtkSetMacro(UseSRGBColorSpace,
bool);
742 vtkBooleanMacro(UseSRGBColorSpace,
bool);
760 void CreateTexture();
765 void DestroyTexture();
799 float BorderColor[4];
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
window superclass for vtkRenderWindow
a simple class to control print indentation
The VertexArrayObject class uses, or emulates, vertex array objects.
bool SupportsDepthBufferFloat
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
bool RequireTextureInteger
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 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.