24 #ifndef vtkTextureObject_h
25 #define vtkTextureObject_h
28 #include "vtkRenderingOpenGL2Module.h"
54 NumberOfDepthTextureCompareFunctions
59 #ifndef GL_ES_VERSION_3_0
60 enum { ClampToEdge = 0,
Repeat, MirroredRepeat, ClampToBorder, NumberOfWrapModes };
80 NumberOfMinificationModes
119 vtkGetMacro(Width,
unsigned int);
120 vtkGetMacro(Height,
unsigned int);
121 vtkGetMacro(Depth,
unsigned int);
122 vtkGetMacro(Samples,
unsigned int);
123 vtkGetMacro(Components,
int);
124 unsigned int GetTuples() {
return this->Width * this->Height * this->Depth; }
127 vtkGetMacro(NumberOfDimensions,
int);
130 vtkSetMacro(Samples,
unsigned int);
136 vtkGetMacro(
Target,
unsigned int);
143 vtkGetMacro(Handle,
unsigned int);
149 int GetTextureUnit();
163 virtual void Activate();
173 virtual void ReleaseGraphicsResources(
vtkWindow* win);
187 void SendParameters();
194 vtkSetMacro(AutoParameters,
int);
195 vtkGetMacro(AutoParameters,
int);
196 vtkBooleanMacro(AutoParameters,
int);
203 bool Create2DFromRaw(
204 unsigned int width,
unsigned int height,
int numComps,
int dataType,
void*
data);
211 bool CreateDepthFromRaw(
212 unsigned int width,
unsigned int height,
int internalFormat,
int rawType,
void* raw);
218 bool CreateTextureBuffer(
226 bool CreateCubeFromRaw(
227 unsigned int width,
unsigned int height,
int numComps,
int dataType,
void*
data[6]);
244 bool Create1DFromRaw(
unsigned int width,
int numComps,
int dataType,
void*
data);
253 bool shaderSupportsTextureInt);
261 bool Create3D(
unsigned int width,
unsigned int height,
unsigned int depth,
int numComps,
268 bool Create3DFromRaw(
unsigned int width,
unsigned int height,
unsigned int depth,
int numComps,
269 int dataType,
void*
data);
277 bool AllocateProxyTexture3D(
unsigned int const width,
unsigned int const height,
278 unsigned int const depth,
int const numComps,
int const dataType);
299 bool AllocateDepth(
unsigned int width,
unsigned int height,
int internalFormat);
304 bool AllocateDepthStencil(
unsigned int width,
unsigned int height);
310 bool Allocate1D(
unsigned int width,
int numComps,
int vtkType);
317 unsigned int width,
unsigned int height,
int numComps,
int vtkType,
int level = 0);
324 unsigned int width,
unsigned int height,
unsigned int depth,
int numComps,
int vtkType);
330 bool Create2D(
unsigned int width,
unsigned int height,
int numComps,
int vtktype,
bool)
332 return this->Allocate2D(width,
height, numComps, vtktype);
335 unsigned int width,
unsigned int height,
unsigned int depth,
int numComps,
int vtktype,
bool)
337 return this->Allocate3D(width,
height, depth, numComps, vtktype);
344 int GetVTKDataType();
350 int GetDataType(
int vtk_scalar_type);
351 void SetDataType(
unsigned int glType);
352 int GetDefaultDataType(
int vtk_scalar_type);
361 unsigned int GetInternalFormat(
int vtktype,
int numComps,
bool shaderSupportsTextureInt);
362 void SetInternalFormat(
unsigned int glInternalFormat);
363 unsigned int GetDefaultInternalFormat(
int vtktype,
int numComps,
bool shaderSupportsTextureInt);
372 unsigned int GetFormat(
int vtktype,
int numComps,
bool shaderSupportsTextureInt);
373 void SetFormat(
unsigned int glFormat);
374 unsigned int GetDefaultFormat(
int vtktype,
int numComps,
bool shaderSupportsTextureInt);
385 void ResetFormatAndType();
387 unsigned int GetMinificationFilterMode(
int vtktype);
388 unsigned int GetMagnificationFilterMode(
int vtktype);
389 unsigned int GetWrapSMode(
int vtktype);
390 unsigned int GetWrapTMode(
int vtktype);
391 unsigned int GetWrapRMode(
int vtktype);
400 vtkSetMacro(RequireDepthBufferFloat,
bool);
401 vtkGetMacro(RequireDepthBufferFloat,
bool);
402 vtkGetMacro(SupportsDepthBufferFloat,
bool);
412 vtkSetMacro(RequireTextureFloat,
bool);
413 vtkGetMacro(RequireTextureFloat,
bool);
414 vtkGetMacro(SupportsTextureFloat,
bool);
424 vtkSetMacro(RequireTextureInteger,
bool);
425 vtkGetMacro(RequireTextureInteger,
bool);
426 vtkGetMacro(SupportsTextureInteger,
bool);
440 vtkGetMacro(WrapS,
int);
441 vtkSetMacro(WrapS,
int);
455 vtkGetMacro(WrapT,
int);
456 vtkSetMacro(WrapT,
int);
470 vtkGetMacro(WrapR,
int);
471 vtkSetMacro(WrapR,
int);
488 vtkGetMacro(MinificationFilter,
int);
489 vtkSetMacro(MinificationFilter,
int);
500 vtkGetMacro(MagnificationFilter,
int);
501 vtkSetMacro(MagnificationFilter,
int);
518 vtkSetVector4Macro(BorderColor,
float);
519 vtkGetVector4Macro(BorderColor,
float);
527 vtkSetMacro(MinLOD,
float);
528 vtkGetMacro(MinLOD,
float);
536 vtkSetMacro(MaxLOD,
float);
537 vtkGetMacro(MaxLOD,
float);
546 vtkSetMacro(BaseLevel,
int);
547 vtkGetMacro(BaseLevel,
int);
556 vtkSetMacro(MaxLevel,
int);
557 vtkGetMacro(MaxLevel,
int);
571 vtkGetMacro(DepthTextureCompare,
bool);
572 vtkSetMacro(DepthTextureCompare,
bool);
596 vtkGetMacro(DepthTextureCompareFunction,
int);
597 vtkSetMacro(DepthTextureCompareFunction,
int);
606 vtkGetMacro(GenerateMipmap,
bool);
607 vtkSetMacro(GenerateMipmap,
bool);
616 vtkSetMacro(MaximumAnisotropicFiltering,
float);
617 vtkGetMacro(MaximumAnisotropicFiltering,
float);
638 int GetMaximumTextureSize3D();
665 void CopyToFrameBuffer(
int srcXmin,
int srcYmin,
int srcXmax,
int srcYmax,
int dstXmin,
666 int dstYmin,
int dstXmax,
int dstYmax,
int dstSizeX,
int dstSizeY,
vtkShaderProgram* program,
669 void CopyToFrameBuffer(
int srcXmin,
int srcYmin,
int srcXmax,
int srcYmax,
int dstXmin,
673 void CopyToFrameBuffer(
688 void CopyFromFrameBuffer(
689 int srcXmin,
int srcYmin,
int dstXmin,
int dstYmin,
int width,
int height);
703 void GetShiftAndScale(
float& shift,
float&
scale);
707 void Resize(
unsigned int width,
unsigned int height);
716 vtkGetMacro(UseSRGBColorSpace,
bool);
717 vtkSetMacro(UseSRGBColorSpace,
bool);
718 vtkBooleanMacro(UseSRGBColorSpace,
bool);
729 void AssignToExistingTexture(
unsigned int handle,
unsigned int target);
740 void CreateTexture();
745 void DestroyTexture();
782 float BorderColor[4];