27 #ifndef vtkTextureObject_h
28 #define vtkTextureObject_h
30 #include "vtkRenderingOpenGL2Module.h"
42 #if GL_ES_VERSION_2_0 != 1 || GL_ES_VERSION_3_0 == 1
61 NumberOfDepthTextureCompareFunctions
66 #if GL_ES_VERSION_2_0 != 1
94 NumberOfMinificationModes
125 NumberOfDepthModeFormats
151 vtkGetMacro(Width,
unsigned int);
152 vtkGetMacro(Height,
unsigned int);
153 vtkGetMacro(Depth,
unsigned int);
154 vtkGetMacro(Components,
int);
156 {
return this->Width*this->Height*this->Depth; }
159 vtkGetMacro(NumberOfDimensions,
int);
165 vtkGetMacro(Target,
unsigned int);
172 vtkGetMacro(Handle,
unsigned int);
178 int GetTextureUnit();
203 void ReleaseGraphicsResources(
vtkWindow *win);
218 void SendParameters();
220 vtkGetMacro(AutoParameters,
int);
227 bool Create2DFromRaw(
unsigned int width,
unsigned int height,
228 int numComps,
int dataType,
void *
data);
234 bool CreateDepthFromRaw(
unsigned int width,
unsigned int height,
235 int internalFormat,
int rawType,
242 bool CreateTextureBuffer(
unsigned int numValues,
int numComps,
250 bool CreateCubeFromRaw(
unsigned int width,
unsigned int height,
251 int numComps,
int dataType,
void *
data[6]);
254 #if GL_ES_VERSION_2_0 != 1
266 bool Create1D(
int numComps,
268 bool shaderSupportsTextureInt);
273 bool Create1DFromRaw(
unsigned int width,
int numComps,
274 int dataType,
void *
data);
279 bool CreateAlphaFromRaw(
unsigned int width,
286 #if GL_ES_VERSION_2_0 != 1 || GL_ES_VERSION_3_0 == 1
294 bool Create2D(
unsigned int width,
unsigned int height,
int numComps,
296 bool shaderSupportsTextureInt);
304 bool Create3D(
unsigned int width,
unsigned int height,
unsigned int depth,
306 bool shaderSupportsTextureInt);
312 bool Create3DFromRaw(
unsigned int width,
unsigned int height,
313 unsigned int depth,
int numComps,
314 int dataType,
void *
data);
328 bool CreateDepth(
unsigned int width,
338 bool AllocateDepth(
unsigned int width,
unsigned int height,
345 bool Allocate1D(
unsigned int width,
int numComps,
int vtkType);
351 bool Allocate2D(
unsigned int width,
unsigned int height,
int numComps,
358 bool Allocate3D(
unsigned int width,
unsigned int height,
359 unsigned int depth,
int numComps,
367 bool Create2D(
unsigned int width,
unsigned int height,
int numComps,
368 int vtktype,
bool shaderSupportsTextureInt);
369 bool Create3D(
unsigned int width,
unsigned int height,
unsigned int depth,
370 int numComps,
int vtktype,
bool shaderSupportsTextureInt);
376 int GetVTKDataType();
382 int GetDataType(
int vtk_scalar_type);
383 void SetDataType(
unsigned int glType);
384 int GetDefaultDataType(
int vtk_scalar_type);
393 unsigned int GetInternalFormat(
int vtktype,
int numComps,
394 bool shaderSupportsTextureInt);
395 void SetInternalFormat(
unsigned int glInternalFormat);
396 unsigned int GetDefaultInternalFormat(
int vtktype,
int numComps,
397 bool shaderSupportsTextureInt);
406 unsigned int GetFormat(
int vtktype,
int numComps,
407 bool shaderSupportsTextureInt);
408 void SetFormat(
unsigned int glFormat);
409 unsigned int GetDefaultFormat(
int vtktype,
int numComps,
410 bool shaderSupportsTextureInt);
421 void ResetFormatAndType();
423 unsigned int GetMinificationFilterMode(
int vtktype);
424 unsigned int GetMagnificationFilterMode(
int vtktype);
425 unsigned int GetWrapSMode(
int vtktype);
426 unsigned int GetWrapTMode(
int vtktype);
427 unsigned int GetWrapRMode(
int vtktype);
437 vtkGetMacro(RequireDepthBufferFloat,
bool);
438 vtkGetMacro(SupportsDepthBufferFloat,
bool);
449 vtkGetMacro(RequireTextureFloat,
bool);
450 vtkGetMacro(SupportsTextureFloat,
bool);
461 vtkGetMacro(RequireTextureInteger,
bool);
462 vtkGetMacro(SupportsTextureInteger,
bool);
476 vtkGetMacro(WrapS,
int);
491 vtkGetMacro(WrapT,
int);
506 vtkGetMacro(WrapR,
int);
524 vtkGetMacro(MinificationFilter,
int);
536 vtkGetMacro(MagnificationFilter,
int);
545 { this->SetMagnificationFilter(val?Linear:Nearest); }
548 {
return this->MagnificationFilter==Linear; }
556 vtkSetVector4Macro(BorderColor,
float);
557 vtkGetVector4Macro(BorderColor,
float);
566 vtkGetMacro(MinLOD,
float);
575 vtkGetMacro(MaxLOD,
float);
585 vtkGetMacro(BaseLevel,
int);
595 vtkGetMacro(MaxLevel,
int);
609 vtkGetMacro(DepthTextureCompare,
bool);
634 vtkGetMacro(DepthTextureCompareFunction,
int);
644 vtkGetMacro(GenerateMipmap,
bool);
664 static bool IsSupported(
666 bool requireTexFloat,
667 bool requireDepthFloat,
685 void CopyToFrameBuffer(
int srcXmin,
int srcYmin,
686 int srcXmax,
int srcYmax,
687 int dstXmin,
int dstYmin,
688 int dstXmax,
int dstYmax,
689 int dstSizeX,
int dstSizeY,
694 void CopyToFrameBuffer(
int srcXmin,
int srcYmin,
695 int srcXmax,
int srcYmax,
696 int dstXmin,
int dstYmin,
697 int dstSizeX,
int dstSizeY,
702 void CopyToFrameBuffer(
float *tcoords,
float *verts,
720 void CopyFromFrameBuffer(
int srcXmin,
739 void GetShiftAndScale(
float &shift,
float &
scale);
755 void CreateTexture();
760 void DestroyTexture();
762 int NumberOfDimensions;
775 bool RequireTextureInteger;
776 bool SupportsTextureInteger;
777 bool RequireTextureFloat;
778 bool SupportsTextureFloat;
779 bool RequireDepthBufferFloat;
780 bool SupportsDepthBufferFloat;
785 int MinificationFilter;
786 int MagnificationFilter;
792 float BorderColor[4];
794 bool DepthTextureCompare;
795 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.
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
The ShaderProgram uses one or more Shader objects.