29#ifndef vtkTextureObject_h
30#define vtkTextureObject_h
32#include "vtkRenderingOpenGLModule.h"
58 NumberOfDepthTextureCompareFunctions
67 NumberOfDepthTextureModes
90 NumberOfMinificationModes
124 vtkGetMacro(Width,
unsigned int);
125 vtkGetMacro(Height,
unsigned int);
126 vtkGetMacro(Depth,
unsigned int);
127 vtkGetMacro(Components,
int);
129 {
return this->Width*this->Height*this->Depth; }
132 vtkGetMacro(NumberOfDimensions,
int);
138 vtkGetMacro(Target,
unsigned int);
145 vtkGetMacro(Handle,
unsigned int);
182 vtkGetMacro(AutoParameters,
int);
197 bool shaderSupportsTextureInt);
207 bool shaderSupportsTextureInt);
238 bool Allocate1D(
unsigned int width,
int numComps,
int vtkType);
252 unsigned int depth,
int numComps,
264 bool shaderSupportsTextureInt);
275 bool shaderSupportsTextureInt);
277 int numComps,
int vtktype,
278 bool shaderSupportsTextureInt);
295 bool shaderSupportsTextureInt);
297 bool shaderSupportsTextureInt);
307 vtkGetMacro(RequireDepthBufferFloat,
bool);
308 vtkGetMacro(SupportsDepthBufferFloat,
bool);
319 vtkGetMacro(RequireTextureFloat,
bool);
320 vtkGetMacro(SupportsTextureFloat,
bool);
331 vtkGetMacro(RequireTextureInteger,
bool);
332 vtkGetMacro(SupportsTextureInteger,
bool);
346 vtkGetMacro(WrapS,
int);
361 vtkGetMacro(WrapT,
int);
376 vtkGetMacro(WrapR,
int);
394 vtkGetMacro(MinificationFilter,
int);
406 vtkGetMacro(MagnificationFilter,
int);
415 { this->SetMagnificationFilter(val?Linear:Nearest); }
418 {
return this->MagnificationFilter==Linear; }
426 vtkSetVector4Macro(BorderColor,
float);
427 vtkGetVector4Macro(BorderColor,
float);
437 vtkGetMacro(Priority,
float);
446 vtkGetMacro(MinLOD,
float);
455 vtkGetMacro(MaxLOD,
float);
465 vtkGetMacro(BaseLevel,
int);
475 vtkGetMacro(MaxLevel,
int);
489 vtkGetMacro(DepthTextureCompare,
bool);
514 vtkGetMacro(DepthTextureCompareFunction,
int);
528 vtkGetMacro(DepthTextureMode,
int);
538 vtkGetMacro(GenerateMipmap,
bool);
549 bool requireTexFloat,
550 bool requireDepthFloat,
657 float BorderColor[4];
dynamic, self-adjusting array of float
a simple class to control print indentation
abstract base class for most VTK objects
Interface class for querying and using OpenGL extensions.
abstracts an OpenGL pixel buffer object.
create a window for renderers to draw into
abstracts an OpenGL texture object.
void Deactivate(unsigned int texUnit)
bool AllocateDepth(unsigned int width, unsigned int height, int internalFormat)
Create a 2D depth texture but does not initialize its values.
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
int GetDataType()
Get the data type for the texture as a vtk type int i.e.
bool IsBound()
Tells if the texture object is bound to the active texture image unit.
bool Allocate1D(unsigned int width, int numComps, int vtkType)
Create a 1D color texture but does not initialize its values.
bool Create1D(int numComps, vtkPixelBufferObject *pbo, bool shaderSupportsTextureInt)
Create a 1D texture using the PBO.
unsigned int GetFormat(int vtktype, int numComps, bool shaderSupportsTextureInt)
void DestroyTexture()
Destroy the texture.
void SetLinearMagnification(bool val)
Tells if the magnification mode is linear (true) or nearest (false).
bool SupportsTextureInteger
vtkTimeStamp SendParametersTime
void CopyToFrameBuffer(int srcXmin, int srcYmin, int srcXmax, int srcYmax, int dstXmin, int dstYmin, int width, int height)
Copy a sub-part of the texture (src) in the current framebuffer at location (dstXmin,...
void CreateTexture()
Creates a texture handle if not already created.
bool SupportsDepthBufferFloat
bool RequireTextureInteger
bool Create3D(unsigned int width, unsigned int height, unsigned int depth, int numComps, vtkPixelBufferObject *pbo, bool shaderSupportsTextureInt)
Create a 3D texture using the PBO.
bool CreateDepthFromRaw(unsigned int width, unsigned int height, int internalFormat, int rawType, void *raw)
Create a 2D depth texture using a raw pointer.
unsigned int GetInternalFormat(int vtktype, int numComps, bool shaderSupportsTextureInt)
bool LoadRequiredExtensions(vtkRenderWindow *renWin)
Load all necessary extensions.
bool SupportsTextureFloat
vtkRenderWindow * GetContext()
static bool IsSupported(vtkRenderWindow *renWin, bool requireTexFloat, bool requireDepthFloat, bool requireTexInt)
Returns if the context supports the required extensions.
vtkWeakPointer< vtkRenderWindow > Context
bool Create2D(unsigned int width, unsigned int height, int numComps, vtkPixelBufferObject *pbo, bool shaderSupportsTextureInt)
Create a 2D texture using the PBO.
bool Create3D(unsigned int width, unsigned int height, unsigned int depth, int numComps, int vtktype, bool shaderSupportsTextureInt)
int DepthTextureCompareFunction
bool Allocate3D(unsigned int width, unsigned int height, unsigned int depth, int numComps, int vtkType)
Create a 3D color texture but does not initialize its values.
bool Create2D(unsigned int width, unsigned int height, int numComps, int vtktype, bool shaderSupportsTextureInt)
Create texture without uploading any data.
void Activate(unsigned int texUnit)
Set the active tex unit and bind (using our bind).
static bool IsSupported(vtkRenderWindow *renWin)
Check for feature support, without any optional features.
bool CreateDepth(unsigned int width, unsigned int height, int internalFormat, vtkPixelBufferObject *pbo)
Create a 2D depth texture using a PBO.
static vtkTextureObject * New()
void CopyFromFrameBuffer(int srcXmin, int srcYmin, int dstXmin, int dstYmin, int width, int height)
Copy a sub-part of a logical buffer of the framebuffer (color or depth) to the texture object.
bool GetLinearMagnification()
void SendParameters()
Send all the texture object parameters to the hardware if not done yet.
void Bind()
Activate the texture.
void SetContext(vtkRenderWindow *)
Get/Set the context.
bool Allocate2D(unsigned int width, unsigned int height, int numComps, int vtkType)
Create a 2D color texture but does not initialize its values.
vtkPixelBufferObject * Download()
This is used to download raw data from the texture into a pixel bufer.
bool RequireDepthBufferFloat
record modification and/or execution time
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.