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();
656 bool ) {
return true; }
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);
755 void CreateTexture();
760 void DestroyTexture();
794 float BorderColor[4];