Go to the documentation of this file.
26 #ifndef vtkTextureObject_h
27 #define vtkTextureObject_h
29 #include "vtkRenderingOpenGLModule.h"
55 NumberOfDepthTextureCompareFunctions
64 NumberOfDepthTextureModes
87 NumberOfMinificationModes
121 vtkGetMacro(Width,
unsigned int);
122 vtkGetMacro(Height,
unsigned int);
123 vtkGetMacro(Depth,
unsigned int);
124 vtkGetMacro(Components,
int);
126 {
return this->Width*this->Height*this->Depth; }
129 vtkGetMacro(NumberOfDimensions,
int);
135 vtkGetMacro(Target,
unsigned int);
142 vtkGetMacro(Handle,
unsigned int);
179 vtkGetMacro(AutoParameters,
int);
194 bool shaderSupportsTextureInt);
204 bool shaderSupportsTextureInt);
235 bool Allocate1D(
unsigned int width,
int numComps,
int vtkType);
249 unsigned int depth,
int numComps,
261 bool shaderSupportsTextureInt);
272 bool shaderSupportsTextureInt);
274 int numComps,
int vtktype,
275 bool shaderSupportsTextureInt);
292 bool shaderSupportsTextureInt);
294 bool shaderSupportsTextureInt);
304 vtkGetMacro(RequireDepthBufferFloat,
bool);
305 vtkGetMacro(SupportsDepthBufferFloat,
bool);
316 vtkGetMacro(RequireTextureFloat,
bool);
317 vtkGetMacro(SupportsTextureFloat,
bool);
328 vtkGetMacro(RequireTextureInteger,
bool);
329 vtkGetMacro(SupportsTextureInteger,
bool);
343 vtkGetMacro(WrapS,
int);
358 vtkGetMacro(WrapT,
int);
373 vtkGetMacro(WrapR,
int);
391 vtkGetMacro(MinificationFilter,
int);
403 vtkGetMacro(MagnificationFilter,
int);
412 { this->SetMagnificationFilter(val?Linear:Nearest); }
415 {
return this->MagnificationFilter==Linear; }
423 vtkSetVector4Macro(BorderColor,
float);
424 vtkGetVector4Macro(BorderColor,
float);
434 vtkGetMacro(Priority,
float);
443 vtkGetMacro(MinLOD,
float);
452 vtkGetMacro(MaxLOD,
float);
462 vtkGetMacro(BaseLevel,
int);
472 vtkGetMacro(MaxLevel,
int);
486 vtkGetMacro(DepthTextureCompare,
bool);
511 vtkGetMacro(DepthTextureCompareFunction,
int);
525 vtkGetMacro(DepthTextureMode,
int);
535 vtkGetMacro(GenerateMipmap,
bool);
546 bool requireTexFloat,
547 bool requireDepthFloat,
654 float BorderColor[4];
bool Allocate2D(unsigned int width, unsigned int height, int numComps, int vtkType)
Create a 2D color texture but does not initialize its values.
bool Create1D(int numComps, vtkPixelBufferObject *pbo, bool shaderSupportsTextureInt)
Create a 1D texture using the PBO.
bool Create3D(unsigned int width, unsigned int height, unsigned int depth, int numComps, int vtktype, bool shaderSupportsTextureInt)
static bool IsSupported(vtkRenderWindow *renWin)
Check for feature support, without any optional features.
vtkTimeStamp SendParametersTime
dynamic, self-adjusting array of float
record modification and/or execution time
vtkPixelBufferObject * Download()
This is used to download raw data from the texture into a pixel bufer.
abstract base class for most VTK objects
bool SupportsTextureInteger
bool SupportsDepthBufferFloat
unsigned int GetFormat(int vtktype, int numComps, bool shaderSupportsTextureInt)
bool AllocateDepth(unsigned int width, unsigned int height, int internalFormat)
Create a 2D depth texture but does not initialize its values.
void Activate(unsigned int texUnit)
Set the active tex unit and bind (using our bind).
bool GetLinearMagnification()
vtkWeakPointer< vtkRenderWindow > Context
bool CreateDepth(unsigned int width, unsigned int height, int internalFormat, vtkPixelBufferObject *pbo)
Create a 2D depth texture using a PBO.
unsigned int GetInternalFormat(int vtktype, int numComps, bool shaderSupportsTextureInt)
bool RequireDepthBufferFloat
Interface class for querying and using OpenGL extensions.
void CreateTexture()
Creates a texture handle if not already created.
void SetContext(vtkRenderWindow *)
Get/Set the context.
bool LoadRequiredExtensions(vtkRenderWindow *renWin)
Load all necessary extensions.
bool RequireTextureInteger
bool Create2D(unsigned int width, unsigned int height, int numComps, int vtktype, bool shaderSupportsTextureInt)
Create texture without uploading any data.
a simple class to control print indentation
abstracts an OpenGL texture object.
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 Create3D(unsigned int width, unsigned int height, unsigned int depth, int numComps, vtkPixelBufferObject *pbo, bool shaderSupportsTextureInt)
Create a 3D texture using the PBO.
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 Deactivate(unsigned int texUnit)
bool Allocate1D(unsigned int width, int numComps, int vtkType)
Create a 1D color texture but does not initialize its values.
void SendParameters()
Send all the texture object parameters to the hardware if not done yet.
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkRenderWindow * GetContext()
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.
int GetDataType()
Get the data type for the texture as a vtk type int i.e.
bool Create2D(unsigned int width, unsigned int height, int numComps, vtkPixelBufferObject *pbo, bool shaderSupportsTextureInt)
Create a 2D texture using the PBO.
bool SupportsTextureFloat
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
bool IsBound()
Tells if the texture object is bound to the active texture image unit.
bool CreateDepthFromRaw(unsigned int width, unsigned int height, int internalFormat, int rawType, void *raw)
Create a 2D depth texture using a raw pointer.
void Bind()
Activate the texture.
create a window for renderers to draw into
void SetLinearMagnification(bool val)
Tells if the magnification mode is linear (true) or nearest (false).
void DestroyTexture()
Destroy the texture.
int DepthTextureCompareFunction
abstracts an OpenGL pixel buffer object.
static bool IsSupported(vtkRenderWindow *renWin, bool requireTexFloat, bool requireDepthFloat, bool requireTexInt)
Returns if the context supports the required extensions.