VTK
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
vtkTextureObject Class Reference

abstracts an OpenGL texture object. More...

#include <vtkTextureObject.h>

Inheritance diagram for vtkTextureObject:
[legend]
Collaboration diagram for vtkTextureObject:
[legend]

Public Types

enum  {
  Lequal =0, Gequal, Less, Greater,
  Equal, NotEqual, AlwaysTrue, Never,
  NumberOfDepthTextureCompareFunctions
}
 
enum  { Luminance =0, Intensity, Alpha, NumberOfDepthTextureModes }
 
enum  {
  Clamp =0, ClampToEdge =0, Repeat, ClampToBorder,
  MirroredRepeat, NumberOfWrapModes
}
 
enum  {
  Nearest =0, Linear, NearestMipmapNearest, NearestMipmapLinear,
  LinearMipmapNearest, LinearMipmapLinear, NumberOfMinificationModes
}
 
enum  {
  Native =0, Fixed16, Fixed24, Fixed32,
  Float32, NumberOfDepthFormats
}
 
enum  {
  Lequal =0, Gequal, Less, Greater,
  Equal, NotEqual, AlwaysTrue, Never,
  NumberOfDepthTextureCompareFunctions
}
 
enum  {
  ClampToEdge =0, Repeat, MirroredRepeat, ClampToBorder,
  NumberOfWrapModes
}
 
enum  {
  Nearest =0, Linear, NearestMipmapNearest, NearestMipmapLinear,
  LinearMipmapNearest, LinearMipmapLinear, NumberOfMinificationModes
}
 
enum  {
  Native =0, Fixed16, Fixed24, Fixed32,
  Float32, NumberOfDepthFormats
}
 
enum  {
  alpha =0, alpha8, alpha16, alpha16f,
  alpha32f, NumberOfAlphaFormats
}
 
enum  { DepthAlpha =0, DepthLuminance, DepthIntensity, NumberOfDepthModeFormats }
 
typedef vtkObject Superclass
 
typedef vtkObject Superclass
 

Public Member Functions

virtual int IsA (const char *type)
 Return 1 if this class is the same type of (or a subclass of) the named class. More...
 
vtkTextureObjectNewInstance () const
 
void PrintSelf (ostream &os, vtkIndent indent)
 Methods invoked by print to print information about the object including superclasses. More...
 
virtual int GetNumberOfDimensions ()
 
bool IsBound ()
 Tells if the texture object is bound to the active texture image unit. More...
 
bool Create1D (int numComps, vtkPixelBufferObject *pbo, bool shaderSupportsTextureInt)
 Create a 1D texture using the PBO. More...
 
bool Create2D (unsigned int width, unsigned int height, int numComps, vtkPixelBufferObject *pbo, bool shaderSupportsTextureInt)
 Create a 2D texture using the PBO. More...
 
bool CreateDepth (unsigned int width, unsigned int height, int internalFormat, vtkPixelBufferObject *pbo)
 Create a 2D depth texture using a PBO. More...
 
bool CreateDepthFromRaw (unsigned int width, unsigned int height, int internalFormat, int rawType, void *raw)
 Create a 2D depth texture using a raw pointer. More...
 
bool AllocateDepth (unsigned int width, unsigned int height, int internalFormat)
 Create a 2D depth texture but does not initialize its values. More...
 
bool Allocate1D (unsigned int width, int numComps, int vtkType)
 Create a 1D color texture but does not initialize its values. More...
 
bool Allocate2D (unsigned int width, unsigned int height, int numComps, int vtkType)
 Create a 2D color texture but does not initialize its values. More...
 
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. More...
 
bool Create3D (unsigned int width, unsigned int height, unsigned int depth, int numComps, vtkPixelBufferObject *pbo, bool shaderSupportsTextureInt)
 Create a 3D texture using the PBO. More...
 
vtkPixelBufferObjectDownload ()
 This is used to download raw data from the texture into a pixel bufer. More...
 
int GetDataType ()
 Get the data type for the texture as a vtk type int i.e. More...
 
unsigned int GetInternalFormat (int vtktype, int numComps, bool shaderSupportsTextureInt)
 
unsigned int GetFormat (int vtktype, int numComps, bool shaderSupportsTextureInt)
 
void SetLinearMagnification (bool val)
 Tells if the magnification mode is linear (true) or nearest (false). More...
 
bool GetLinearMagnification ()
 
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,dstYmin). More...
 
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. More...
 
virtual int IsA (const char *type)
 Return 1 if this class is the same type of (or a subclass of) the named class. More...
 
vtkTextureObjectNewInstance () const
 
void PrintSelf (ostream &os, vtkIndent indent)
 Methods invoked by print to print information about the object including superclasses. More...
 
virtual int GetNumberOfDimensions ()
 
int GetTextureUnit ()
 Return the texture unit used for this texture. More...
 
void Activate ()
 Activate and Bind the texture. More...
 
void Deactivate ()
 Deactivate and UnBind the texture. More...
 
void ReleaseGraphicsResources (vtkWindow *win)
 Deactivate and UnBind the texture. More...
 
bool IsBound ()
 Tells if the texture object is bound to the active texture image unit. More...
 
bool Create2DFromRaw (unsigned int width, unsigned int height, int numComps, int dataType, void *data)
 Create a 2D texture from client memory numComps must be in [1-4]. More...
 
bool CreateDepthFromRaw (unsigned int width, unsigned int height, int internalFormat, int rawType, void *raw)
 Create a 2D depth texture using a raw pointer. More...
 
bool CreateTextureBuffer (unsigned int numValues, int numComps, int dataType, vtkOpenGLBufferObject *bo)
 Create a texture buffer basically a 1D texture that can be very large for passing data into the fragment shader. More...
 
bool CreateCubeFromRaw (unsigned int width, unsigned int height, int numComps, int dataType, void *data[6])
 Create a cube texture from 6 buffers from client memory. More...
 
bool Create1D (int numComps, vtkPixelBufferObject *pbo, bool shaderSupportsTextureInt)
 Create a 1D texture using the PBO. More...
 
bool Create1DFromRaw (unsigned int width, int numComps, int dataType, void *data)
 Create 1D texture from client memory. More...
 
bool CreateAlphaFromRaw (unsigned int width, int internalFormat, int rawType, void *raw)
 Create a 1D alpha texture using a raw pointer. More...
 
bool Create2D (unsigned int width, unsigned int height, int numComps, vtkPixelBufferObject *pbo, bool shaderSupportsTextureInt)
 Create a 2D texture using the PBO. More...
 
bool Create3D (unsigned int width, unsigned int height, unsigned int depth, int numComps, vtkPixelBufferObject *pbo, bool shaderSupportsTextureInt)
 Create a 3D texture using the PBO. More...
 
bool Create3DFromRaw (unsigned int width, unsigned int height, unsigned int depth, int numComps, int dataType, void *data)
 Create a 3D texture from client memory numComps must be in [1-4]. More...
 
vtkPixelBufferObjectDownload ()
 This is used to download raw data from the texture into a pixel bufer. More...
 
bool CreateDepth (unsigned int width, unsigned int height, int internalFormat, vtkPixelBufferObject *pbo)
 Create a 2D depth texture using a PBO. More...
 
bool AllocateDepth (unsigned int width, unsigned int height, int internalFormat)
 Create a 2D depth texture but does not initialize its values. More...
 
bool Allocate1D (unsigned int width, int numComps, int vtkType)
 Create a 1D color texture but does not initialize its values. More...
 
bool Allocate2D (unsigned int width, unsigned int height, int numComps, int vtkType)
 Create a 2D color texture but does not initialize its values. More...
 
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. More...
 
int GetVTKDataType ()
 Get the data type for the texture as a vtk type int i.e. More...
 
void ResetFormatAndType ()
 Reset format, internal format, and type of the texture. More...
 
unsigned int GetMinificationFilterMode (int vtktype)
 
unsigned int GetMagnificationFilterMode (int vtktype)
 
unsigned int GetWrapSMode (int vtktype)
 
unsigned int GetWrapTMode (int vtktype)
 
unsigned int GetWrapRMode (int vtktype)
 
void SetLinearMagnification (bool val)
 Tells if the magnification mode is linear (true) or nearest (false). More...
 
bool GetLinearMagnification ()
 
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. More...
 
void GetShiftAndScale (float &shift, float &scale)
 Get the shift and scale required in the shader to return the texture values to their original range. More...
 
void SetContext (vtkRenderWindow *)
 Get/Set the context. More...
 
vtkRenderWindowGetContext ()
 Get/Set the context. More...
 
virtual unsigned int GetWidth ()
 Get the texture dimensions. More...
 
virtual unsigned int GetHeight ()
 Get the texture dimensions. More...
 
virtual unsigned int GetDepth ()
 Get the texture dimensions. More...
 
virtual int GetComponents ()
 Get the texture dimensions. More...
 
unsigned int GetTuples ()
 Get the texture dimensions. More...
 
virtual unsigned int GetTarget ()
 Returns OpenGL texture target to which the texture is/can be bound. More...
 
virtual unsigned int GetHandle ()
 Returns the OpenGL handle. More...
 
void Bind ()
 Activate the texture. More...
 
void UnBind ()
 Activate the texture. More...
 
void Activate (unsigned int texUnit)
 Set the active tex unit and bind (using our bind). More...
 
void Deactivate (unsigned int texUnit)
 Set the active tex unit and bind (using our bind). More...
 
void SendParameters ()
 Send all the texture object parameters to the hardware if not done yet. More...
 
virtual void SetAutoParameters (int)
 Send all the texture object parameters to the hardware if not done yet. More...
 
virtual int GetAutoParameters ()
 Send all the texture object parameters to the hardware if not done yet. More...
 
bool Create2D (unsigned int width, unsigned int height, int numComps, int vtktype, bool shaderSupportsTextureInt)
 Create texture without uploading any data. More...
 
bool Create3D (unsigned int width, unsigned int height, unsigned int depth, int numComps, int vtktype, bool shaderSupportsTextureInt)
 Create texture without uploading any data. More...
 
virtual void SetRequireDepthBufferFloat (bool)
 Optional, require support for floating point depth buffer formats. More...
 
virtual bool GetRequireDepthBufferFloat ()
 Optional, require support for floating point depth buffer formats. More...
 
virtual bool GetSupportsDepthBufferFloat ()
 Optional, require support for floating point depth buffer formats. More...
 
virtual void SetRequireTextureFloat (bool)
 Optional, require support for floating point texture formats. More...
 
virtual bool GetRequireTextureFloat ()
 Optional, require support for floating point texture formats. More...
 
virtual bool GetSupportsTextureFloat ()
 Optional, require support for floating point texture formats. More...
 
virtual void SetRequireTextureInteger (bool)
 Optional, require support for integer texture formats. More...
 
virtual bool GetRequireTextureInteger ()
 Optional, require support for integer texture formats. More...
 
virtual bool GetSupportsTextureInteger ()
 Optional, require support for integer texture formats. More...
 
virtual int GetWrapS ()
 Wrap mode for the first texture coordinate "s" Valid values are: More...
 
virtual void SetWrapS (int)
 Wrap mode for the first texture coordinate "s" Valid values are: More...
 
virtual int GetWrapT ()
 Wrap mode for the first texture coordinate "t" Valid values are: More...
 
virtual void SetWrapT (int)
 Wrap mode for the first texture coordinate "t" Valid values are: More...
 
virtual int GetWrapR ()
 Wrap mode for the first texture coordinate "r" Valid values are: More...
 
virtual void SetWrapR (int)
 Wrap mode for the first texture coordinate "r" Valid values are: More...
 
virtual int GetMinificationFilter ()
 Minification filter mode. More...
 
virtual void SetMinificationFilter (int)
 Minification filter mode. More...
 
virtual int GetMagnificationFilter ()
 Magnification filter mode. More...
 
virtual void SetMagnificationFilter (int)
 Magnification filter mode. More...
 
virtual void SetBorderColor (float, float, float, float)
 Border Color (RGBA). More...
 
virtual void SetBorderColor (float[4])
 Border Color (RGBA). More...
 
virtual floatGetBorderColor ()
 Border Color (RGBA). More...
 
virtual void GetBorderColor (float &, float &, float &, float &)
 Border Color (RGBA). More...
 
virtual void GetBorderColor (float[4])
 Border Color (RGBA). More...
 
virtual void SetPriority (float)
 Priority of the texture object to be resident on the card for higher performance in the range [0.0f, 1.0f]. More...
 
virtual float GetPriority ()
 Priority of the texture object to be resident on the card for higher performance in the range [0.0f, 1.0f]. More...
 
virtual void SetMinLOD (float)
 Lower-clamp the computed LOD against this value. More...
 
virtual float GetMinLOD ()
 Lower-clamp the computed LOD against this value. More...
 
virtual void SetMaxLOD (float)
 Upper-clamp the computed LOD against this value. More...
 
virtual float GetMaxLOD ()
 Upper-clamp the computed LOD against this value. More...
 
virtual void SetBaseLevel (int)
 Level of detail of the first texture image. More...
 
virtual int GetBaseLevel ()
 Level of detail of the first texture image. More...
 
virtual void SetMaxLevel (int)
 Level of detail of the first texture image. More...
 
virtual int GetMaxLevel ()
 Level of detail of the first texture image. More...
 
virtual bool GetDepthTextureCompare ()
 Tells if the output of a texture unit with a depth texture uses comparison or not. More...
 
virtual void SetDepthTextureCompare (bool)
 Tells if the output of a texture unit with a depth texture uses comparison or not. More...
 
virtual int GetDepthTextureCompareFunction ()
 In case DepthTextureCompare is true, specify the comparison function in use. More...
 
virtual void SetDepthTextureCompareFunction (int)
 In case DepthTextureCompare is true, specify the comparison function in use. More...
 
virtual int GetDepthTextureMode ()
 Defines the mapping from depth component `r' to RGBA components. More...
 
virtual void SetDepthTextureMode (int)
 Defines the mapping from depth component `r' to RGBA components. More...
 
virtual bool GetGenerateMipmap ()
 Tells the hardware to generate mipmap textures from the first texture image at BaseLevel. More...
 
virtual void SetGenerateMipmap (bool)
 Tells the hardware to generate mipmap textures from the first texture image at BaseLevel. More...
 
void SetContext (vtkOpenGLRenderWindow *)
 Get/Set the context. More...
 
vtkOpenGLRenderWindowGetContext ()
 Get/Set the context. More...
 
virtual unsigned int GetWidth ()
 Get the texture dimensions. More...
 
virtual unsigned int GetHeight ()
 Get the texture dimensions. More...
 
virtual unsigned int GetDepth ()
 Get the texture dimensions. More...
 
virtual int GetComponents ()
 Get the texture dimensions. More...
 
unsigned int GetTuples ()
 Get the texture dimensions. More...
 
virtual unsigned int GetTarget ()
 Returns OpenGL texture target to which the texture is/can be bound. More...
 
virtual unsigned int GetHandle ()
 Returns the OpenGL handle. More...
 
void Bind ()
 Bind UnBind The texture must have been created using Create(). More...
 
void UnBind ()
 Bind UnBind The texture must have been created using Create(). More...
 
void SendParameters ()
 Send all the texture object parameters to the hardware if not done yet. More...
 
virtual void SetAutoParameters (int)
 Send all the texture object parameters to the hardware if not done yet. More...
 
virtual int GetAutoParameters ()
 Send all the texture object parameters to the hardware if not done yet. More...
 
bool Create2D (unsigned int width, unsigned int height, int numComps, int vtktype, bool shaderSupportsTextureInt)
 Create texture without uploading any data. More...
 
bool Create3D (unsigned int width, unsigned int height, unsigned int depth, int numComps, int vtktype, bool shaderSupportsTextureInt)
 Create texture without uploading any data. More...
 
int GetDataType (int vtk_scalar_type)
 Get the data type for the texture as GLenum type. More...
 
void SetDataType (unsigned int glType)
 Get the data type for the texture as GLenum type. More...
 
int GetDefaultDataType (int vtk_scalar_type)
 Get the data type for the texture as GLenum type. More...
 
unsigned int GetInternalFormat (int vtktype, int numComps, bool shaderSupportsTextureInt)
 Get/Set internal format (OpenGL internal format) that should be used. More...
 
void SetInternalFormat (unsigned int glInternalFormat)
 Get/Set internal format (OpenGL internal format) that should be used. More...
 
unsigned int GetDefaultInternalFormat (int vtktype, int numComps, bool shaderSupportsTextureInt)
 Get/Set internal format (OpenGL internal format) that should be used. More...
 
unsigned int GetFormat (int vtktype, int numComps, bool shaderSupportsTextureInt)
 Get/Set format (OpenGL internal format) that should be used. More...
 
void SetFormat (unsigned int glFormat)
 Get/Set format (OpenGL internal format) that should be used. More...
 
unsigned int GetDefaultFormat (int vtktype, int numComps, bool shaderSupportsTextureInt)
 Get/Set format (OpenGL internal format) that should be used. More...
 
virtual void SetRequireDepthBufferFloat (bool)
 Optional, require support for floating point depth buffer formats. More...
 
virtual bool GetRequireDepthBufferFloat ()
 Optional, require support for floating point depth buffer formats. More...
 
virtual bool GetSupportsDepthBufferFloat ()
 Optional, require support for floating point depth buffer formats. More...
 
virtual void SetRequireTextureFloat (bool)
 Optional, require support for floating point texture formats. More...
 
virtual bool GetRequireTextureFloat ()
 Optional, require support for floating point texture formats. More...
 
virtual bool GetSupportsTextureFloat ()
 Optional, require support for floating point texture formats. More...
 
virtual void SetRequireTextureInteger (bool)
 Optional, require support for integer texture formats. More...
 
virtual bool GetRequireTextureInteger ()
 Optional, require support for integer texture formats. More...
 
virtual bool GetSupportsTextureInteger ()
 Optional, require support for integer texture formats. More...
 
virtual int GetWrapS ()
 Wrap mode for the first texture coordinate "s" Valid values are: More...
 
virtual void SetWrapS (int)
 Wrap mode for the first texture coordinate "s" Valid values are: More...
 
virtual int GetWrapT ()
 Wrap mode for the first texture coordinate "t" Valid values are: More...
 
virtual void SetWrapT (int)
 Wrap mode for the first texture coordinate "t" Valid values are: More...
 
virtual int GetWrapR ()
 Wrap mode for the first texture coordinate "r" Valid values are: More...
 
virtual void SetWrapR (int)
 Wrap mode for the first texture coordinate "r" Valid values are: More...
 
virtual int GetMinificationFilter ()
 Minification filter mode. More...
 
virtual void SetMinificationFilter (int)
 Minification filter mode. More...
 
virtual int GetMagnificationFilter ()
 Magnification filter mode. More...
 
virtual void SetMagnificationFilter (int)
 Magnification filter mode. More...
 
virtual void SetBorderColor (float, float, float, float)
 Border Color (RGBA). More...
 
virtual void SetBorderColor (float[4])
 Border Color (RGBA). More...
 
virtual floatGetBorderColor ()
 Border Color (RGBA). More...
 
virtual void GetBorderColor (float &, float &, float &, float &)
 Border Color (RGBA). More...
 
virtual void GetBorderColor (float[4])
 Border Color (RGBA). More...
 
virtual void SetMinLOD (float)
 Lower-clamp the computed LOD against this value. More...
 
virtual float GetMinLOD ()
 Lower-clamp the computed LOD against this value. More...
 
virtual void SetMaxLOD (float)
 Upper-clamp the computed LOD against this value. More...
 
virtual float GetMaxLOD ()
 Upper-clamp the computed LOD against this value. More...
 
virtual void SetBaseLevel (int)
 Level of detail of the first texture image. More...
 
virtual int GetBaseLevel ()
 Level of detail of the first texture image. More...
 
virtual void SetMaxLevel (int)
 Level of detail of the first texture image. More...
 
virtual int GetMaxLevel ()
 Level of detail of the first texture image. More...
 
virtual bool GetDepthTextureCompare ()
 Tells if the output of a texture unit with a depth texture uses comparison or not. More...
 
virtual void SetDepthTextureCompare (bool)
 Tells if the output of a texture unit with a depth texture uses comparison or not. More...
 
virtual int GetDepthTextureCompareFunction ()
 In case DepthTextureCompare is true, specify the comparison function in use. More...
 
virtual void SetDepthTextureCompareFunction (int)
 In case DepthTextureCompare is true, specify the comparison function in use. More...
 
virtual bool GetGenerateMipmap ()
 Tells the hardware to generate mipmap textures from the first texture image at BaseLevel. More...
 
virtual void SetGenerateMipmap (bool)
 Tells the hardware to generate mipmap textures from the first texture image at BaseLevel. More...
 
void CopyToFrameBuffer (vtkShaderProgram *program, vtkOpenGLVertexArrayObject *vao)
 Copy the texture (src) in the current framebuffer. More...
 
void CopyToFrameBuffer (int srcXmin, int srcYmin, int srcXmax, int srcYmax, int dstXmin, int dstYmin, int dstXmax, int dstYmax, int dstSizeX, int dstSizeY, vtkShaderProgram *program, vtkOpenGLVertexArrayObject *vao)
 Copy the texture (src) in the current framebuffer. More...
 
void CopyToFrameBuffer (int srcXmin, int srcYmin, int srcXmax, int srcYmax, int dstXmin, int dstYmin, int dstSizeX, int dstSizeY, vtkShaderProgram *program, vtkOpenGLVertexArrayObject *vao)
 Copy the texture (src) in the current framebuffer. More...
 
void CopyToFrameBuffer (float *tcoords, float *verts, vtkShaderProgram *program, vtkOpenGLVertexArrayObject *vao)
 Copy the texture (src) in the current framebuffer. More...
 
- Public Member Functions inherited from vtkObject
 vtkBaseTypeMacro (vtkObject, vtkObjectBase)
 
virtual void DebugOn ()
 Turn debugging output on. More...
 
virtual void DebugOff ()
 Turn debugging output off. More...
 
bool GetDebug ()
 Get the value of the debug flag. More...
 
void SetDebug (bool debugFlag)
 Set the value of the debug flag. More...
 
virtual void Modified ()
 Update the modification time for this object. More...
 
virtual vtkMTimeType GetMTime ()
 Return this object's modified time. More...
 
void RemoveObserver (unsigned long tag)
 
void RemoveObservers (unsigned long event)
 
void RemoveObservers (const char *event)
 
void RemoveAllObservers ()
 
int HasObserver (unsigned long event)
 
int HasObserver (const char *event)
 
int InvokeEvent (unsigned long event)
 
int InvokeEvent (const char *event)
 
unsigned long AddObserver (unsigned long event, vtkCommand *, float priority=0.0f)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
unsigned long AddObserver (const char *event, vtkCommand *, float priority=0.0f)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
vtkCommandGetCommand (unsigned long tag)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
void RemoveObserver (vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
void RemoveObservers (unsigned long event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
void RemoveObservers (const char *event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
int HasObserver (unsigned long event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
int HasObserver (const char *event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f)
 Overloads to AddObserver that allow developers to add class member functions as callbacks for events. More...
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 Overloads to AddObserver that allow developers to add class member functions as callbacks for events. More...
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, bool(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 Allow user to set the AbortFlagOn() with the return value of the callback method. More...
 
int InvokeEvent (unsigned long event, void *callData)
 This method invokes an event and return whether the event was aborted or not. More...
 
int InvokeEvent (const char *event, void *callData)
 This method invokes an event and return whether the event was aborted or not. More...
 
- Public Member Functions inherited from vtkObjectBase
const char * GetClassName () const
 Return the class name as a string. More...
 
virtual void Delete ()
 Delete a VTK object. More...
 
virtual void FastDelete ()
 Delete a reference to this object. More...
 
void InitializeObjectBase ()
 
void Print (ostream &os)
 Print an object to an ostream. More...
 
virtual void Register (vtkObjectBase *o)
 Increase the reference count (mark as used by another object). More...
 
virtual void UnRegister (vtkObjectBase *o)
 Decrease the reference count (release by another object). More...
 
int GetReferenceCount ()
 Return the current reference count of this object. More...
 
void SetReferenceCount (int)
 Sets the reference count. More...
 
void PrintRevisions (ostream &)
 Legacy. More...
 
virtual void PrintHeader (ostream &os, vtkIndent indent)
 Methods invoked by print to print information about the object including superclasses. More...
 
virtual void PrintTrailer (ostream &os, vtkIndent indent)
 Methods invoked by print to print information about the object including superclasses. More...
 

Static Public Member Functions

static vtkTextureObjectNew ()
 
static int IsTypeOf (const char *type)
 
static vtkTextureObjectSafeDownCast (vtkObjectBase *o)
 
static bool IsSupported (vtkRenderWindow *renWin, bool requireTexFloat, bool requireDepthFloat, bool requireTexInt)
 Returns if the context supports the required extensions. More...
 
static bool IsSupported (vtkRenderWindow *renWin)
 Check for feature support, without any optional features. More...
 
static vtkTextureObjectNew ()
 
static int IsTypeOf (const char *type)
 
static vtkTextureObjectSafeDownCast (vtkObjectBase *o)
 
static int GetMaximumTextureSize (vtkOpenGLRenderWindow *context)
 Query and return maximum texture size (dimension) supported by the OpenGL driver for a particular context. More...
 
static bool IsSupported (vtkOpenGLRenderWindow *renWin, bool requireTexFloat, bool requireDepthFloat, bool requireTexInt)
 Returns if the context supports the required extensions. More...
 
static bool IsSupported (vtkOpenGLRenderWindow *renWin)
 Check for feature support, without any optional features. More...
 
- Static Public Member Functions inherited from vtkObject
static vtkObjectNew ()
 Create an object with Debug turned off, modified time initialized to zero, and reference counting on. More...
 
static void BreakOnError ()
 This method is called when vtkErrorMacro executes. More...
 
static void SetGlobalWarningDisplay (int val)
 This is a global flag that controls whether any debug, warning or error messages are displayed. More...
 
static void GlobalWarningDisplayOn ()
 This is a global flag that controls whether any debug, warning or error messages are displayed. More...
 
static void GlobalWarningDisplayOff ()
 This is a global flag that controls whether any debug, warning or error messages are displayed. More...
 
static int GetGlobalWarningDisplay ()
 This is a global flag that controls whether any debug, warning or error messages are displayed. More...
 
- Static Public Member Functions inherited from vtkObjectBase
static vtkTypeBool IsTypeOf (const char *name)
 Return 1 if this class type is the same type of (or a subclass of) the named class. More...
 
static vtkObjectBaseNew ()
 Create an object with Debug turned off, modified time initialized to zero, and reference counting on. More...
 

Protected Member Functions

virtual vtkObjectBaseNewInstanceInternal () const
 
 vtkTextureObject ()
 
 ~vtkTextureObject ()
 
bool LoadRequiredExtensions (vtkRenderWindow *renWin)
 Load all necessary extensions. More...
 
void CreateTexture ()
 Creates a texture handle if not already created. More...
 
void DestroyTexture ()
 Destroy the texture. More...
 
virtual vtkObjectBaseNewInstanceInternal () const
 
 vtkTextureObject ()
 
 ~vtkTextureObject ()
 
bool LoadRequiredExtensions (vtkOpenGLRenderWindow *renWin)
 Load all necessary extensions. More...
 
void CreateTexture ()
 Creates a texture handle if not already created. More...
 
void DestroyTexture ()
 Destroy the texture. More...
 
- Protected Member Functions inherited from vtkObject
 vtkObject ()
 
 ~vtkObject () override
 
void RegisterInternal (vtkObjectBase *, vtkTypeBool check) override
 
void UnRegisterInternal (vtkObjectBase *, vtkTypeBool check) override
 
void InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=NULL)
 These methods allow a command to exclusively grab all events. More...
 
void InternalReleaseFocus ()
 These methods allow a command to exclusively grab all events. More...
 
- Protected Member Functions inherited from vtkObjectBase
 vtkObjectBase ()
 
virtual ~vtkObjectBase ()
 
virtual void CollectRevisions (ostream &)
 
virtual void ReportReferences (vtkGarbageCollector *)
 
 vtkObjectBase (const vtkObjectBase &)
 
void operator= (const vtkObjectBase &)
 

Protected Attributes

int NumberOfDimensions
 
unsigned int Width
 
unsigned int Height
 
unsigned int Depth
 
unsigned int Target
 
unsigned int Format
 
unsigned int Type
 
int Components
 
vtkWeakPointer< vtkRenderWindowContext
 
unsigned int Handle
 
bool RequireTextureInteger
 
bool SupportsTextureInteger
 
bool RequireTextureFloat
 
bool SupportsTextureFloat
 
bool RequireDepthBufferFloat
 
bool SupportsDepthBufferFloat
 
int WrapS
 
int WrapT
 
int WrapR
 
int MinificationFilter
 
int MagnificationFilter
 
bool LinearMagnification
 
float BorderColor [4]
 
float Priority
 
float MinLOD
 
float MaxLOD
 
int BaseLevel
 
int MaxLevel
 
bool DepthTextureCompare
 
int DepthTextureCompareFunction
 
int DepthTextureMode
 
bool GenerateMipmap
 
int AutoParameters
 
vtkTimeStamp SendParametersTime
 
vtkGenericOpenGLResourceFreeCallbackResourceCallback
 
unsigned int InternalFormat
 
vtkWeakPointer< vtkOpenGLRenderWindowContext
 
vtkOpenGLHelperShaderProgram
 
vtkOpenGLBufferObjectBufferObject
 
- Protected Attributes inherited from vtkObject
bool Debug
 
vtkTimeStamp MTime
 
vtkSubjectHelper * SubjectHelper
 
- Protected Attributes inherited from vtkObjectBase
vtkAtomicInt32 ReferenceCount
 
vtkWeakPointerBase ** WeakPointers
 

Detailed Description

abstracts an OpenGL texture object.

vtkTextureObject represents an OpenGL texture object. It provides API to create textures using data already loaded into pixel buffer objects. It can also be used to create textures without uploading any data.

Warning
DON'T PLAY WITH IT YET.

vtkTextureObject represents an OpenGL texture object. It provides API to create textures using data already loaded into pixel buffer objects. It can also be used to create textures without uploading any data.

Tests:
vtkTextureObject (Tests)

Definition at line 40 of file vtkTextureObject.h.

Member Typedef Documentation

Definition at line 102 of file vtkTextureObject.h.

Definition at line 129 of file vtkTextureObject.h.

Member Enumeration Documentation

anonymous enum
Enumerator
Lequal 
Gequal 
Less 
Greater 
Equal 
NotEqual 
AlwaysTrue 
Never 
NumberOfDepthTextureCompareFunctions 

Definition at line 45 of file vtkTextureObject.h.

anonymous enum
Enumerator
Luminance 
Intensity 
Alpha 
NumberOfDepthTextureModes 

Definition at line 59 of file vtkTextureObject.h.

anonymous enum
Enumerator
Clamp 
ClampToEdge 
Repeat 
ClampToBorder 
MirroredRepeat 
NumberOfWrapModes 

Definition at line 68 of file vtkTextureObject.h.

anonymous enum
Enumerator
Nearest 
Linear 
NearestMipmapNearest 
NearestMipmapLinear 
LinearMipmapNearest 
LinearMipmapLinear 
NumberOfMinificationModes 

Definition at line 79 of file vtkTextureObject.h.

anonymous enum
Enumerator
Native 
Fixed16 
Fixed24 
Fixed32 
Float32 
NumberOfDepthFormats 

Definition at line 91 of file vtkTextureObject.h.

anonymous enum
Enumerator
Lequal 
Gequal 
Less 
Greater 
Equal 
NotEqual 
AlwaysTrue 
Never 
NumberOfDepthTextureCompareFunctions 

Definition at line 51 of file vtkTextureObject.h.

anonymous enum
Enumerator
ClampToEdge 
Repeat 
MirroredRepeat 
ClampToBorder 
NumberOfWrapModes 

Definition at line 67 of file vtkTextureObject.h.

anonymous enum
Enumerator
Nearest 
Linear 
NearestMipmapNearest 
NearestMipmapLinear 
LinearMipmapNearest 
LinearMipmapLinear 
NumberOfMinificationModes 

Definition at line 86 of file vtkTextureObject.h.

anonymous enum
Enumerator
Native 
Fixed16 
Fixed24 
Fixed32 
Float32 
NumberOfDepthFormats 

Definition at line 98 of file vtkTextureObject.h.

anonymous enum
Enumerator
alpha 
alpha8 
alpha16 
alpha16f 
alpha32f 
NumberOfAlphaFormats 

Definition at line 109 of file vtkTextureObject.h.

anonymous enum
Enumerator
DepthAlpha 
DepthLuminance 
DepthIntensity 
NumberOfDepthModeFormats 

Definition at line 120 of file vtkTextureObject.h.

Constructor & Destructor Documentation

vtkTextureObject::vtkTextureObject ( )
protected
vtkTextureObject::~vtkTextureObject ( )
protected
vtkTextureObject::vtkTextureObject ( )
protected
vtkTextureObject::~vtkTextureObject ( )
protected

Member Function Documentation

static vtkTextureObject* vtkTextureObject::New ( )
static
static int vtkTextureObject::IsTypeOf ( const char *  type)
static
virtual int vtkTextureObject::IsA ( const char *  name)
virtual

Return 1 if this class is the same type of (or a subclass of) the named class.

Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkObjectBase.

static vtkTextureObject* vtkTextureObject::SafeDownCast ( vtkObjectBase o)
static
virtual vtkObjectBase* vtkTextureObject::NewInstanceInternal ( ) const
protectedvirtual
vtkTextureObject* vtkTextureObject::NewInstance ( ) const
void vtkTextureObject::PrintSelf ( ostream &  os,
vtkIndent  indent 
)
virtual

Methods invoked by print to print information about the object including superclasses.

Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

Reimplemented from vtkObject.

void vtkTextureObject::SetContext ( vtkRenderWindow )

Get/Set the context.

This does not increase the reference count of the context to avoid reference loops. SetContext() may raise an error is the OpenGL context does not support the required OpenGL extensions.

vtkRenderWindow* vtkTextureObject::GetContext ( )

Get/Set the context.

This does not increase the reference count of the context to avoid reference loops. SetContext() may raise an error is the OpenGL context does not support the required OpenGL extensions.

virtual unsigned int vtkTextureObject::GetWidth ( )
virtual

Get the texture dimensions.

These are the properties of the OpenGL texture this instance represents.

virtual unsigned int vtkTextureObject::GetHeight ( )
virtual

Get the texture dimensions.

These are the properties of the OpenGL texture this instance represents.

virtual unsigned int vtkTextureObject::GetDepth ( )
virtual

Get the texture dimensions.

These are the properties of the OpenGL texture this instance represents.

virtual int vtkTextureObject::GetComponents ( )
virtual

Get the texture dimensions.

These are the properties of the OpenGL texture this instance represents.

unsigned int vtkTextureObject::GetTuples ( )
inline

Get the texture dimensions.

These are the properties of the OpenGL texture this instance represents.

Definition at line 125 of file vtkTextureObject.h.

virtual int vtkTextureObject::GetNumberOfDimensions ( )
virtual
virtual unsigned int vtkTextureObject::GetTarget ( )
virtual

Returns OpenGL texture target to which the texture is/can be bound.

virtual unsigned int vtkTextureObject::GetHandle ( )
virtual

Returns the OpenGL handle.

void vtkTextureObject::Bind ( )

Activate the texture.

The texture must have been created using Create(). A side affect is that tex paramteres are sent. RenderWindow must be set before calling this.

void vtkTextureObject::UnBind ( )

Activate the texture.

The texture must have been created using Create(). A side affect is that tex paramteres are sent. RenderWindow must be set before calling this.

void vtkTextureObject::Activate ( unsigned int  texUnit)

Set the active tex unit and bind (using our bind).

void vtkTextureObject::Deactivate ( unsigned int  texUnit)

Set the active tex unit and bind (using our bind).

bool vtkTextureObject::IsBound ( )

Tells if the texture object is bound to the active texture image unit.

(a texture object can be bound to multiple texture image unit).

void vtkTextureObject::SendParameters ( )

Send all the texture object parameters to the hardware if not done yet.

Parameters are automatically sent as a side affect of Bind. Disable this by setting AutoParameters 0.

Precondition
is_bound: IsBound()
virtual void vtkTextureObject::SetAutoParameters ( int  )
virtual

Send all the texture object parameters to the hardware if not done yet.

Parameters are automatically sent as a side affect of Bind. Disable this by setting AutoParameters 0.

Precondition
is_bound: IsBound()
virtual int vtkTextureObject::GetAutoParameters ( )
virtual

Send all the texture object parameters to the hardware if not done yet.

Parameters are automatically sent as a side affect of Bind. Disable this by setting AutoParameters 0.

Precondition
is_bound: IsBound()
bool vtkTextureObject::Create1D ( int  numComps,
vtkPixelBufferObject pbo,
bool  shaderSupportsTextureInt 
)

Create a 1D texture using the PBO.

Eventually we may start supporting creating a texture from subset of data in the PBO, but for simplicity we'll begin with entire PBO data. numComps must be in [1-4]. shaderSupportsTextureInt is true if the shader has an alternate implementation supporting sampler with integer values. Even if the card supports texture int, it does not mean that the implementor of the shader made a version that supports texture int.

bool vtkTextureObject::Create2D ( unsigned int  width,
unsigned int  height,
int  numComps,
vtkPixelBufferObject pbo,
bool  shaderSupportsTextureInt 
)

Create a 2D texture using the PBO.

Eventually we may start supporting creating a texture from subset of data in the PBO, but for simplicity we'll begin with entire PBO data. numComps must be in [1-4].

bool vtkTextureObject::CreateDepth ( unsigned int  width,
unsigned int  height,
int  internalFormat,
vtkPixelBufferObject pbo 
)

Create a 2D depth texture using a PBO.

Precondition
: valid_internalFormat: internalFormat>=0 && internalFormat<NumberOfDepthFormats
bool vtkTextureObject::CreateDepthFromRaw ( unsigned int  width,
unsigned int  height,
int  internalFormat,
int  rawType,
void *  raw 
)

Create a 2D depth texture using a raw pointer.

This is a blocking call. If you can, use PBO instead.

bool vtkTextureObject::AllocateDepth ( unsigned int  width,
unsigned int  height,
int  internalFormat 
)

Create a 2D depth texture but does not initialize its values.

bool vtkTextureObject::Allocate1D ( unsigned int  width,
int  numComps,
int  vtkType 
)

Create a 1D color texture but does not initialize its values.

Internal format is deduced from numComps and vtkType.

bool vtkTextureObject::Allocate2D ( unsigned int  width,
unsigned int  height,
int  numComps,
int  vtkType 
)

Create a 2D color texture but does not initialize its values.

Internal format is deduced from numComps and vtkType.

bool vtkTextureObject::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.

Internal format is deduced from numComps and vtkType.

bool vtkTextureObject::Create3D ( unsigned int  width,
unsigned int  height,
unsigned int  depth,
int  numComps,
vtkPixelBufferObject pbo,
bool  shaderSupportsTextureInt 
)

Create a 3D texture using the PBO.

Eventually we may start supporting creating a texture from subset of data in the PBO, but for simplicity we'll begin with entire PBO data. numComps must be in [1-4].

bool vtkTextureObject::Create2D ( unsigned int  width,
unsigned int  height,
int  numComps,
int  vtktype,
bool  shaderSupportsTextureInt 
)

Create texture without uploading any data.

To create a DEPTH_COMPONENT texture, vtktype must be set to VTK_VOID and numComps must be 1.

bool vtkTextureObject::Create3D ( unsigned int  width,
unsigned int  height,
unsigned int  depth,
int  numComps,
int  vtktype,
bool  shaderSupportsTextureInt 
)

Create texture without uploading any data.

To create a DEPTH_COMPONENT texture, vtktype must be set to VTK_VOID and numComps must be 1.

vtkPixelBufferObject* vtkTextureObject::Download ( )

This is used to download raw data from the texture into a pixel bufer.

The pixel buffer API can then be used to download the pixel buffer data to CPU arrays. The caller takes on the responsibility of deleting the returns vtkPixelBufferObject once it done with it.

int vtkTextureObject::GetDataType ( )

Get the data type for the texture as a vtk type int i.e.

VTK_INT etc.

unsigned int vtkTextureObject::GetInternalFormat ( int  vtktype,
int  numComps,
bool  shaderSupportsTextureInt 
)
unsigned int vtkTextureObject::GetFormat ( int  vtktype,
int  numComps,
bool  shaderSupportsTextureInt 
)
virtual void vtkTextureObject::SetRequireDepthBufferFloat ( bool  )
virtual

Optional, require support for floating point depth buffer formats.

If supported extensions will be loaded, however loading will fail if the extension is required but not available.

virtual bool vtkTextureObject::GetRequireDepthBufferFloat ( )
virtual

Optional, require support for floating point depth buffer formats.

If supported extensions will be loaded, however loading will fail if the extension is required but not available.

virtual bool vtkTextureObject::GetSupportsDepthBufferFloat ( )
virtual

Optional, require support for floating point depth buffer formats.

If supported extensions will be loaded, however loading will fail if the extension is required but not available.

virtual void vtkTextureObject::SetRequireTextureFloat ( bool  )
virtual

Optional, require support for floating point texture formats.

If supported extensions will be loaded, however loading will fail if the extension is required but not available.

virtual bool vtkTextureObject::GetRequireTextureFloat ( )
virtual

Optional, require support for floating point texture formats.

If supported extensions will be loaded, however loading will fail if the extension is required but not available.

virtual bool vtkTextureObject::GetSupportsTextureFloat ( )
virtual

Optional, require support for floating point texture formats.

If supported extensions will be loaded, however loading will fail if the extension is required but not available.

virtual void vtkTextureObject::SetRequireTextureInteger ( bool  )
virtual

Optional, require support for integer texture formats.

If supported extensions will be loaded, however loading will fail if the extension is required but not available.

virtual bool vtkTextureObject::GetRequireTextureInteger ( )
virtual

Optional, require support for integer texture formats.

If supported extensions will be loaded, however loading will fail if the extension is required but not available.

virtual bool vtkTextureObject::GetSupportsTextureInteger ( )
virtual

Optional, require support for integer texture formats.

If supported extensions will be loaded, however loading will fail if the extension is required but not available.

virtual int vtkTextureObject::GetWrapS ( )
virtual

Wrap mode for the first texture coordinate "s" Valid values are:

  • Clamp
  • ClampToEdge
  • Repeat
  • ClampToBorder
  • MirroredRepeat Initial value is Repeat (as in OpenGL spec)
virtual void vtkTextureObject::SetWrapS ( int  )
virtual

Wrap mode for the first texture coordinate "s" Valid values are:

  • Clamp
  • ClampToEdge
  • Repeat
  • ClampToBorder
  • MirroredRepeat Initial value is Repeat (as in OpenGL spec)
virtual int vtkTextureObject::GetWrapT ( )
virtual

Wrap mode for the first texture coordinate "t" Valid values are:

  • Clamp
  • ClampToEdge
  • Repeat
  • ClampToBorder
  • MirroredRepeat Initial value is Repeat (as in OpenGL spec)
virtual void vtkTextureObject::SetWrapT ( int  )
virtual

Wrap mode for the first texture coordinate "t" Valid values are:

  • Clamp
  • ClampToEdge
  • Repeat
  • ClampToBorder
  • MirroredRepeat Initial value is Repeat (as in OpenGL spec)
virtual int vtkTextureObject::GetWrapR ( )
virtual

Wrap mode for the first texture coordinate "r" Valid values are:

  • Clamp
  • ClampToEdge
  • Repeat
  • ClampToBorder
  • MirroredRepeat Initial value is Repeat (as in OpenGL spec)
virtual void vtkTextureObject::SetWrapR ( int  )
virtual

Wrap mode for the first texture coordinate "r" Valid values are:

  • Clamp
  • ClampToEdge
  • Repeat
  • ClampToBorder
  • MirroredRepeat Initial value is Repeat (as in OpenGL spec)
virtual int vtkTextureObject::GetMinificationFilter ( )
virtual

Minification filter mode.

Valid values are:

  • Nearest
  • Linear
  • NearestMipmapNearest
  • NearestMipmapLinear
  • LinearMipmapNearest
  • LinearMipmapLinear Initial value is Nearest. (Note initial value in OpenGL spec is NearestMipMapLinear but this is error-prone because it makes the texture object incomplete.)
virtual void vtkTextureObject::SetMinificationFilter ( int  )
virtual

Minification filter mode.

Valid values are:

  • Nearest
  • Linear
  • NearestMipmapNearest
  • NearestMipmapLinear
  • LinearMipmapNearest
  • LinearMipmapLinear Initial value is Nearest. (Note initial value in OpenGL spec is NearestMipMapLinear but this is error-prone because it makes the texture object incomplete.)
virtual int vtkTextureObject::GetMagnificationFilter ( )
virtual

Magnification filter mode.

Valid values are:

  • Nearest
  • Linear Initial value is Nearest
virtual void vtkTextureObject::SetMagnificationFilter ( int  )
virtual

Magnification filter mode.

Valid values are:

  • Nearest
  • Linear Initial value is Nearest
void vtkTextureObject::SetLinearMagnification ( bool  val)
inline

Tells if the magnification mode is linear (true) or nearest (false).

Initial value is false (initial value in OpenGL spec is true).

Definition at line 411 of file vtkTextureObject.h.

bool vtkTextureObject::GetLinearMagnification ( )
inline

Definition at line 414 of file vtkTextureObject.h.

virtual void vtkTextureObject::SetBorderColor ( float  ,
float  ,
float  ,
float   
)
virtual

Border Color (RGBA).

The values can be any valid float value, if the gpu supports it. Initial value is (0.0f, 0.0f, 0.0f, 0.0f), as in OpenGL spec.

virtual void vtkTextureObject::SetBorderColor ( float  [4])
virtual

Border Color (RGBA).

The values can be any valid float value, if the gpu supports it. Initial value is (0.0f, 0.0f, 0.0f, 0.0f), as in OpenGL spec.

virtual float* vtkTextureObject::GetBorderColor ( )
virtual

Border Color (RGBA).

The values can be any valid float value, if the gpu supports it. Initial value is (0.0f, 0.0f, 0.0f, 0.0f), as in OpenGL spec.

virtual void vtkTextureObject::GetBorderColor ( float ,
float ,
float ,
float  
)
virtual

Border Color (RGBA).

The values can be any valid float value, if the gpu supports it. Initial value is (0.0f, 0.0f, 0.0f, 0.0f), as in OpenGL spec.

virtual void vtkTextureObject::GetBorderColor ( float  [4])
virtual

Border Color (RGBA).

The values can be any valid float value, if the gpu supports it. Initial value is (0.0f, 0.0f, 0.0f, 0.0f), as in OpenGL spec.

virtual void vtkTextureObject::SetPriority ( float  )
virtual

Priority of the texture object to be resident on the card for higher performance in the range [0.0f, 1.0f].

Initial value is 1.0f, as in OpenGL spec.

virtual float vtkTextureObject::GetPriority ( )
virtual

Priority of the texture object to be resident on the card for higher performance in the range [0.0f, 1.0f].

Initial value is 1.0f, as in OpenGL spec.

virtual void vtkTextureObject::SetMinLOD ( float  )
virtual

Lower-clamp the computed LOD against this value.

Any float value is valid. Initial value is -1000.0f, as in OpenGL spec.

virtual float vtkTextureObject::GetMinLOD ( )
virtual

Lower-clamp the computed LOD against this value.

Any float value is valid. Initial value is -1000.0f, as in OpenGL spec.

virtual void vtkTextureObject::SetMaxLOD ( float  )
virtual

Upper-clamp the computed LOD against this value.

Any float value is valid. Initial value is 1000.0f, as in OpenGL spec.

virtual float vtkTextureObject::GetMaxLOD ( )
virtual

Upper-clamp the computed LOD against this value.

Any float value is valid. Initial value is 1000.0f, as in OpenGL spec.

virtual void vtkTextureObject::SetBaseLevel ( int  )
virtual

Level of detail of the first texture image.

A texture object is a list of texture images. It is a non-negative integer value. Initial value is 0, as in OpenGL spec.

virtual int vtkTextureObject::GetBaseLevel ( )
virtual

Level of detail of the first texture image.

A texture object is a list of texture images. It is a non-negative integer value. Initial value is 0, as in OpenGL spec.

virtual void vtkTextureObject::SetMaxLevel ( int  )
virtual

Level of detail of the first texture image.

A texture object is a list of texture images. It is a non-negative integer value. Initial value is 1000, as in OpenGL spec.

virtual int vtkTextureObject::GetMaxLevel ( )
virtual

Level of detail of the first texture image.

A texture object is a list of texture images. It is a non-negative integer value. Initial value is 1000, as in OpenGL spec.

virtual bool vtkTextureObject::GetDepthTextureCompare ( )
virtual

Tells if the output of a texture unit with a depth texture uses comparison or not.

Comparison happens between D_t the depth texture value in the range [0,1] and with R the interpolated third texture coordinate clamped to range [0,1]. The result of the comparison is noted `r'. If this flag is false, r=D_t. Initial value is false, as in OpenGL spec. Ignored if the texture object is not a depth texture.

virtual void vtkTextureObject::SetDepthTextureCompare ( bool  )
virtual

Tells if the output of a texture unit with a depth texture uses comparison or not.

Comparison happens between D_t the depth texture value in the range [0,1] and with R the interpolated third texture coordinate clamped to range [0,1]. The result of the comparison is noted `r'. If this flag is false, r=D_t. Initial value is false, as in OpenGL spec. Ignored if the texture object is not a depth texture.

virtual int vtkTextureObject::GetDepthTextureCompareFunction ( )
virtual

In case DepthTextureCompare is true, specify the comparison function in use.

The result of the comparison is noted `r'. Valid values are:

  • Value
  • Lequal: r=R<=Dt ? 1.0 : 0.0
  • Gequal: r=R>=Dt ? 1.0 : 0.0
  • Less: r=R<D_t ? 1.0 : 0.0
  • Greater: r=R>Dt ? 1.0 : 0.0
  • Equal: r=R==Dt ? 1.0 : 0.0
  • NotEqual: r=R!=Dt ? 1.0 : 0.0
  • AlwaysTrue: r=1.0
  • Never: r=0.0 If the magnification of minification factor are not nearest, percentage closer filtering (PCF) is used: R is compared to several D_t and r is the average of the comparisons (it is NOT the average of D_t compared once to R). Initial value is Lequal, as in OpenGL spec. Ignored if the texture object is not a depth texture.
virtual void vtkTextureObject::SetDepthTextureCompareFunction ( int  )
virtual

In case DepthTextureCompare is true, specify the comparison function in use.

The result of the comparison is noted `r'. Valid values are:

  • Value
  • Lequal: r=R<=Dt ? 1.0 : 0.0
  • Gequal: r=R>=Dt ? 1.0 : 0.0
  • Less: r=R<D_t ? 1.0 : 0.0
  • Greater: r=R>Dt ? 1.0 : 0.0
  • Equal: r=R==Dt ? 1.0 : 0.0
  • NotEqual: r=R!=Dt ? 1.0 : 0.0
  • AlwaysTrue: r=1.0
  • Never: r=0.0 If the magnification of minification factor are not nearest, percentage closer filtering (PCF) is used: R is compared to several D_t and r is the average of the comparisons (it is NOT the average of D_t compared once to R). Initial value is Lequal, as in OpenGL spec. Ignored if the texture object is not a depth texture.
virtual int vtkTextureObject::GetDepthTextureMode ( )
virtual

Defines the mapping from depth component `r' to RGBA components.

Ignored if the texture object is not a depth texture. Valid modes are:

  • Luminance: (R,G,B,A)=(r,r,r,1)
  • Intensity: (R,G,B,A)=(r,r,r,r)
  • Alpha: (R,G,B,A)=(0,0,0,r) Initial value is Luminance, as in OpenGL spec.
virtual void vtkTextureObject::SetDepthTextureMode ( int  )
virtual

Defines the mapping from depth component `r' to RGBA components.

Ignored if the texture object is not a depth texture. Valid modes are:

  • Luminance: (R,G,B,A)=(r,r,r,1)
  • Intensity: (R,G,B,A)=(r,r,r,r)
  • Alpha: (R,G,B,A)=(0,0,0,r) Initial value is Luminance, as in OpenGL spec.
virtual bool vtkTextureObject::GetGenerateMipmap ( )
virtual

Tells the hardware to generate mipmap textures from the first texture image at BaseLevel.

Initial value is false, as in OpenGL spec.

virtual void vtkTextureObject::SetGenerateMipmap ( bool  )
virtual

Tells the hardware to generate mipmap textures from the first texture image at BaseLevel.

Initial value is false, as in OpenGL spec.

static bool vtkTextureObject::IsSupported ( vtkRenderWindow renWin,
bool  requireTexFloat,
bool  requireDepthFloat,
bool  requireTexInt 
)
static

Returns if the context supports the required extensions.

If flags for optional extenisons are set then the test fails when support for them is not found.

static bool vtkTextureObject::IsSupported ( vtkRenderWindow renWin)
inlinestatic

Check for feature support, without any optional features.

Definition at line 553 of file vtkTextureObject.h.

void vtkTextureObject::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,dstYmin).

(dstXmin,dstYmin) is the location of the lower left corner of the rectangle. width and height are the dimensions of the framebuffer.

  • texture coordinates are sent on texture coordinate processing unit 0.
  • if the fixed-pipeline fragment shader is used, texturing has to be set on texture image unit 0 and the texture object has to be bound on texture image unit 0.
  • if a customized fragment shader is used, you are free to pick the texture image unit you want. You can even have multiple texture objects attached on multiple texture image units. In this case, you call this method only on one of them.
    Precondition
    positive_srcXmin: srcXmin>=0
    max_srcXmax: srcXmax<this->GetWidth()
    increasing_x: srcXmin<=srcXmax
    positive_srcYmin: srcYmin>=0
    max_srcYmax: srcYmax<this->GetHeight()
    increasing_y: srcYmin<=srcYmax
    positive_dstXmin: dstXmin>=0
    positive_dstYmin: dstYmin>=0
    positive_width: width>0
    positive_height: height>0
    x_fit: destXmin+(srcXmax-srcXmin)<width
    y_fit: destYmin+(srcYmax-srcYmin)<height
void vtkTextureObject::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.

src is the framebuffer, dst is the texture. (srcXmin,srcYmin) is the location of the lower left corner of the rectangle in the framebuffer. (dstXmin,dstYmin) is the location of the lower left corner of the rectangle in the texture. width and height specifies the size of the rectangle in pixels. If the logical buffer is a color buffer, it has to be selected first with glReadBuffer().

Precondition
is2D: GetNumberOfDimensions()==2
bool vtkTextureObject::LoadRequiredExtensions ( vtkRenderWindow renWin)
protected

Load all necessary extensions.

void vtkTextureObject::CreateTexture ( )
protected

Creates a texture handle if not already created.

void vtkTextureObject::DestroyTexture ( )
protected

Destroy the texture.

static vtkTextureObject* vtkTextureObject::New ( )
static
static int vtkTextureObject::IsTypeOf ( const char *  type)
static
virtual int vtkTextureObject::IsA ( const char *  name)
virtual

Return 1 if this class is the same type of (or a subclass of) the named class.

Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkObjectBase.

static vtkTextureObject* vtkTextureObject::SafeDownCast ( vtkObjectBase o)
static
virtual vtkObjectBase* vtkTextureObject::NewInstanceInternal ( ) const
protectedvirtual
vtkTextureObject* vtkTextureObject::NewInstance ( ) const
void vtkTextureObject::PrintSelf ( ostream &  os,
vtkIndent  indent 
)
virtual

Methods invoked by print to print information about the object including superclasses.

Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

Reimplemented from vtkObject.

void vtkTextureObject::SetContext ( vtkOpenGLRenderWindow )

Get/Set the context.

This does not increase the reference count of the context to avoid reference loops.

{ this->TextureObject = vtkTextureObject::New(); }SetContext() may raise an error is the OpenGL context does not support the required OpenGL extensions.

vtkOpenGLRenderWindow* vtkTextureObject::GetContext ( )

Get/Set the context.

This does not increase the reference count of the context to avoid reference loops.

{ this->TextureObject = vtkTextureObject::New(); }SetContext() may raise an error is the OpenGL context does not support the required OpenGL extensions.

virtual unsigned int vtkTextureObject::GetWidth ( )
virtual

Get the texture dimensions.

These are the properties of the OpenGL texture this instance represents.

virtual unsigned int vtkTextureObject::GetHeight ( )
virtual

Get the texture dimensions.

These are the properties of the OpenGL texture this instance represents.

virtual unsigned int vtkTextureObject::GetDepth ( )
virtual

Get the texture dimensions.

These are the properties of the OpenGL texture this instance represents.

virtual int vtkTextureObject::GetComponents ( )
virtual

Get the texture dimensions.

These are the properties of the OpenGL texture this instance represents.

unsigned int vtkTextureObject::GetTuples ( )
inline

Get the texture dimensions.

These are the properties of the OpenGL texture this instance represents.

Definition at line 155 of file vtkTextureObject.h.

virtual int vtkTextureObject::GetNumberOfDimensions ( )
virtual
virtual unsigned int vtkTextureObject::GetTarget ( )
virtual

Returns OpenGL texture target to which the texture is/can be bound.

virtual unsigned int vtkTextureObject::GetHandle ( )
virtual

Returns the OpenGL handle.

int vtkTextureObject::GetTextureUnit ( )

Return the texture unit used for this texture.

void vtkTextureObject::Bind ( )

Bind UnBind The texture must have been created using Create().

A side affect is that tex paramteres are sent. RenderWindow must be set before calling this.

void vtkTextureObject::UnBind ( )

Bind UnBind The texture must have been created using Create().

A side affect is that tex paramteres are sent. RenderWindow must be set before calling this.

void vtkTextureObject::Activate ( )

Activate and Bind the texture.

void vtkTextureObject::Deactivate ( )

Deactivate and UnBind the texture.

void vtkTextureObject::ReleaseGraphicsResources ( vtkWindow win)

Deactivate and UnBind the texture.

bool vtkTextureObject::IsBound ( )

Tells if the texture object is bound to the active texture image unit.

(a texture object can be bound to multiple texture image unit).

void vtkTextureObject::SendParameters ( )

Send all the texture object parameters to the hardware if not done yet.

Parameters are automatically sent as a side affect of Bind. Disable this by setting AutoParameters 0.

Precondition
is_bound: IsBound()
virtual void vtkTextureObject::SetAutoParameters ( int  )
virtual

Send all the texture object parameters to the hardware if not done yet.

Parameters are automatically sent as a side affect of Bind. Disable this by setting AutoParameters 0.

Precondition
is_bound: IsBound()
virtual int vtkTextureObject::GetAutoParameters ( )
virtual

Send all the texture object parameters to the hardware if not done yet.

Parameters are automatically sent as a side affect of Bind. Disable this by setting AutoParameters 0.

Precondition
is_bound: IsBound()
bool vtkTextureObject::Create2DFromRaw ( unsigned int  width,
unsigned int  height,
int  numComps,
int  dataType,
void *  data 
)

Create a 2D texture from client memory numComps must be in [1-4].

bool vtkTextureObject::CreateDepthFromRaw ( unsigned int  width,
unsigned int  height,
int  internalFormat,
int  rawType,
void *  raw 
)

Create a 2D depth texture using a raw pointer.

This is a blocking call. If you can, use PBO instead.

bool vtkTextureObject::CreateTextureBuffer ( unsigned int  numValues,
int  numComps,
int  dataType,
vtkOpenGLBufferObject bo 
)

Create a texture buffer basically a 1D texture that can be very large for passing data into the fragment shader.

bool vtkTextureObject::CreateCubeFromRaw ( unsigned int  width,
unsigned int  height,
int  numComps,
int  dataType,
void *  data[6] 
)

Create a cube texture from 6 buffers from client memory.

Image data must be provided in the following order: +X -X +Y -Y +Z -Z. numComps must be in [1-4].

bool vtkTextureObject::Create1D ( int  numComps,
vtkPixelBufferObject pbo,
bool  shaderSupportsTextureInt 
)

Create a 1D texture using the PBO.

Eventually we may start supporting creating a texture from subset of data in the PBO, but for simplicity we'll begin with entire PBO data. numComps must be in [1-4]. shaderSupportsTextureInt is true if the shader has an alternate implementation supporting sampler with integer values. Even if the card supports texture int, it does not mean that the implementor of the shader made a version that supports texture int.

bool vtkTextureObject::Create1DFromRaw ( unsigned int  width,
int  numComps,
int  dataType,
void *  data 
)

Create 1D texture from client memory.

bool vtkTextureObject::CreateAlphaFromRaw ( unsigned int  width,
int  internalFormat,
int  rawType,
void *  raw 
)

Create a 1D alpha texture using a raw pointer.

This is a blocking call. If you can, use PBO instead.

bool vtkTextureObject::Create2D ( unsigned int  width,
unsigned int  height,
int  numComps,
vtkPixelBufferObject pbo,
bool  shaderSupportsTextureInt 
)

Create a 2D texture using the PBO.

Eventually we may start supporting creating a texture from subset of data in the PBO, but for simplicity we'll begin with entire PBO data. numComps must be in [1-4].

bool vtkTextureObject::Create3D ( unsigned int  width,
unsigned int  height,
unsigned int  depth,
int  numComps,
vtkPixelBufferObject pbo,
bool  shaderSupportsTextureInt 
)

Create a 3D texture using the PBO.

Eventually we may start supporting creating a texture from subset of data in the PBO, but for simplicity we'll begin with entire PBO data. numComps must be in [1-4].

bool vtkTextureObject::Create3DFromRaw ( unsigned int  width,
unsigned int  height,
unsigned int  depth,
int  numComps,
int  dataType,
void *  data 
)

Create a 3D texture from client memory numComps must be in [1-4].

vtkPixelBufferObject* vtkTextureObject::Download ( )

This is used to download raw data from the texture into a pixel bufer.

The pixel buffer API can then be used to download the pixel buffer data to CPU arrays. The caller takes on the responsibility of deleting the returns vtkPixelBufferObject once it done with it.

bool vtkTextureObject::CreateDepth ( unsigned int  width,
unsigned int  height,
int  internalFormat,
vtkPixelBufferObject pbo 
)

Create a 2D depth texture using a PBO.

Precondition
: valid_internalFormat: internalFormat>=0 && internalFormat<NumberOfDepthFormats
bool vtkTextureObject::AllocateDepth ( unsigned int  width,
unsigned int  height,
int  internalFormat 
)

Create a 2D depth texture but does not initialize its values.

bool vtkTextureObject::Allocate1D ( unsigned int  width,
int  numComps,
int  vtkType 
)

Create a 1D color texture but does not initialize its values.

Internal format is deduced from numComps and vtkType.

bool vtkTextureObject::Allocate2D ( unsigned int  width,
unsigned int  height,
int  numComps,
int  vtkType 
)

Create a 2D color texture but does not initialize its values.

Internal format is deduced from numComps and vtkType.

bool vtkTextureObject::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.

Internal format is deduced from numComps and vtkType.

bool vtkTextureObject::Create2D ( unsigned int  width,
unsigned int  height,
int  numComps,
int  vtktype,
bool  shaderSupportsTextureInt 
)

Create texture without uploading any data.

bool vtkTextureObject::Create3D ( unsigned int  width,
unsigned int  height,
unsigned int  depth,
int  numComps,
int  vtktype,
bool  shaderSupportsTextureInt 
)

Create texture without uploading any data.

int vtkTextureObject::GetVTKDataType ( )

Get the data type for the texture as a vtk type int i.e.

VTK_INT etc.

int vtkTextureObject::GetDataType ( int  vtk_scalar_type)

Get the data type for the texture as GLenum type.

void vtkTextureObject::SetDataType ( unsigned int  glType)

Get the data type for the texture as GLenum type.

int vtkTextureObject::GetDefaultDataType ( int  vtk_scalar_type)

Get the data type for the texture as GLenum type.

unsigned int vtkTextureObject::GetInternalFormat ( int  vtktype,
int  numComps,
bool  shaderSupportsTextureInt 
)

Get/Set internal format (OpenGL internal format) that should be used.

(https://www.opengl.org/sdk/docs/man2/xhtml/glTexImage2D.xml)

void vtkTextureObject::SetInternalFormat ( unsigned int  glInternalFormat)

Get/Set internal format (OpenGL internal format) that should be used.

(https://www.opengl.org/sdk/docs/man2/xhtml/glTexImage2D.xml)

unsigned int vtkTextureObject::GetDefaultInternalFormat ( int  vtktype,
int  numComps,
bool  shaderSupportsTextureInt 
)

Get/Set internal format (OpenGL internal format) that should be used.

(https://www.opengl.org/sdk/docs/man2/xhtml/glTexImage2D.xml)

unsigned int vtkTextureObject::GetFormat ( int  vtktype,
int  numComps,
bool  shaderSupportsTextureInt 
)

Get/Set format (OpenGL internal format) that should be used.

(https://www.opengl.org/sdk/docs/man2/xhtml/glTexImage2D.xml)

void vtkTextureObject::SetFormat ( unsigned int  glFormat)

Get/Set format (OpenGL internal format) that should be used.

(https://www.opengl.org/sdk/docs/man2/xhtml/glTexImage2D.xml)

unsigned int vtkTextureObject::GetDefaultFormat ( int  vtktype,
int  numComps,
bool  shaderSupportsTextureInt 
)

Get/Set format (OpenGL internal format) that should be used.

(https://www.opengl.org/sdk/docs/man2/xhtml/glTexImage2D.xml)

void vtkTextureObject::ResetFormatAndType ( )

Reset format, internal format, and type of the texture.

This method is useful when a texture is reused in a context same as the previous render call. In such cases, texture destruction does not happen and therefore previous set values are used.

unsigned int vtkTextureObject::GetMinificationFilterMode ( int  vtktype)
unsigned int vtkTextureObject::GetMagnificationFilterMode ( int  vtktype)
unsigned int vtkTextureObject::GetWrapSMode ( int  vtktype)
unsigned int vtkTextureObject::GetWrapTMode ( int  vtktype)
unsigned int vtkTextureObject::GetWrapRMode ( int  vtktype)
virtual void vtkTextureObject::SetRequireDepthBufferFloat ( bool  )
virtual

Optional, require support for floating point depth buffer formats.

If supported extensions will be loaded, however loading will fail if the extension is required but not available.

virtual bool vtkTextureObject::GetRequireDepthBufferFloat ( )
virtual

Optional, require support for floating point depth buffer formats.

If supported extensions will be loaded, however loading will fail if the extension is required but not available.

virtual bool vtkTextureObject::GetSupportsDepthBufferFloat ( )
virtual

Optional, require support for floating point depth buffer formats.

If supported extensions will be loaded, however loading will fail if the extension is required but not available.

virtual void vtkTextureObject::SetRequireTextureFloat ( bool  )
virtual

Optional, require support for floating point texture formats.

If supported extensions will be loaded, however loading will fail if the extension is required but not available.

virtual bool vtkTextureObject::GetRequireTextureFloat ( )
virtual

Optional, require support for floating point texture formats.

If supported extensions will be loaded, however loading will fail if the extension is required but not available.

virtual bool vtkTextureObject::GetSupportsTextureFloat ( )
virtual

Optional, require support for floating point texture formats.

If supported extensions will be loaded, however loading will fail if the extension is required but not available.

virtual void vtkTextureObject::SetRequireTextureInteger ( bool  )
virtual

Optional, require support for integer texture formats.

If supported extensions will be loaded, however loading will fail if the extension is required but not available.

virtual bool vtkTextureObject::GetRequireTextureInteger ( )
virtual

Optional, require support for integer texture formats.

If supported extensions will be loaded, however loading will fail if the extension is required but not available.

virtual bool vtkTextureObject::GetSupportsTextureInteger ( )
virtual

Optional, require support for integer texture formats.

If supported extensions will be loaded, however loading will fail if the extension is required but not available.

virtual int vtkTextureObject::GetWrapS ( )
virtual

Wrap mode for the first texture coordinate "s" Valid values are:

  • Clamp
  • ClampToEdge
  • Repeat
  • ClampToBorder
  • MirroredRepeat Initial value is Repeat (as in OpenGL spec)
virtual void vtkTextureObject::SetWrapS ( int  )
virtual

Wrap mode for the first texture coordinate "s" Valid values are:

  • Clamp
  • ClampToEdge
  • Repeat
  • ClampToBorder
  • MirroredRepeat Initial value is Repeat (as in OpenGL spec)
virtual int vtkTextureObject::GetWrapT ( )
virtual

Wrap mode for the first texture coordinate "t" Valid values are:

  • Clamp
  • ClampToEdge
  • Repeat
  • ClampToBorder
  • MirroredRepeat Initial value is Repeat (as in OpenGL spec)
virtual void vtkTextureObject::SetWrapT ( int  )
virtual

Wrap mode for the first texture coordinate "t" Valid values are:

  • Clamp
  • ClampToEdge
  • Repeat
  • ClampToBorder
  • MirroredRepeat Initial value is Repeat (as in OpenGL spec)
virtual int vtkTextureObject::GetWrapR ( )
virtual

Wrap mode for the first texture coordinate "r" Valid values are:

  • Clamp
  • ClampToEdge
  • Repeat
  • ClampToBorder
  • MirroredRepeat Initial value is Repeat (as in OpenGL spec)
virtual void vtkTextureObject::SetWrapR ( int  )
virtual

Wrap mode for the first texture coordinate "r" Valid values are:

  • Clamp
  • ClampToEdge
  • Repeat
  • ClampToBorder
  • MirroredRepeat Initial value is Repeat (as in OpenGL spec)
virtual int vtkTextureObject::GetMinificationFilter ( )
virtual

Minification filter mode.

Valid values are:

  • Nearest
  • Linear
  • NearestMipmapNearest
  • NearestMipmapLinear
  • LinearMipmapNearest
  • LinearMipmapLinear Initial value is Nearest (note initial value in OpenGL spec is NearestMipMapLinear but this is error-prone because it makes the texture object incomplete. ).
virtual void vtkTextureObject::SetMinificationFilter ( int  )
virtual

Minification filter mode.

Valid values are:

  • Nearest
  • Linear
  • NearestMipmapNearest
  • NearestMipmapLinear
  • LinearMipmapNearest
  • LinearMipmapLinear Initial value is Nearest (note initial value in OpenGL spec is NearestMipMapLinear but this is error-prone because it makes the texture object incomplete. ).
virtual int vtkTextureObject::GetMagnificationFilter ( )
virtual

Magnification filter mode.

Valid values are:

  • Nearest
  • Linear Initial value is Nearest
virtual void vtkTextureObject::SetMagnificationFilter ( int  )
virtual

Magnification filter mode.

Valid values are:

  • Nearest
  • Linear Initial value is Nearest
void vtkTextureObject::SetLinearMagnification ( bool  val)
inline

Tells if the magnification mode is linear (true) or nearest (false).

Initial value is false (initial value in OpenGL spec is true).

Definition at line 544 of file vtkTextureObject.h.

bool vtkTextureObject::GetLinearMagnification ( )
inline

Definition at line 547 of file vtkTextureObject.h.

virtual void vtkTextureObject::SetBorderColor ( float  ,
float  ,
float  ,
float   
)
virtual

Border Color (RGBA).

The values can be any valid float value, if the gpu supports it. Initial value is (0.0f, 0.0f, 0.0f, 0.0f), as in the OpenGL spec.

virtual void vtkTextureObject::SetBorderColor ( float  [4])
virtual

Border Color (RGBA).

The values can be any valid float value, if the gpu supports it. Initial value is (0.0f, 0.0f, 0.0f, 0.0f), as in the OpenGL spec.

virtual float* vtkTextureObject::GetBorderColor ( )
virtual

Border Color (RGBA).

The values can be any valid float value, if the gpu supports it. Initial value is (0.0f, 0.0f, 0.0f, 0.0f), as in the OpenGL spec.

virtual void vtkTextureObject::GetBorderColor ( float ,
float ,
float ,
float  
)
virtual

Border Color (RGBA).

The values can be any valid float value, if the gpu supports it. Initial value is (0.0f, 0.0f, 0.0f, 0.0f), as in the OpenGL spec.

virtual void vtkTextureObject::GetBorderColor ( float  [4])
virtual

Border Color (RGBA).

The values can be any valid float value, if the gpu supports it. Initial value is (0.0f, 0.0f, 0.0f, 0.0f), as in the OpenGL spec.

virtual void vtkTextureObject::SetMinLOD ( float  )
virtual

Lower-clamp the computed LOD against this value.

Any float value is valid. Initial value is -1000.0f, as in OpenGL spec.

virtual float vtkTextureObject::GetMinLOD ( )
virtual

Lower-clamp the computed LOD against this value.

Any float value is valid. Initial value is -1000.0f, as in OpenGL spec.

virtual void vtkTextureObject::SetMaxLOD ( float  )
virtual

Upper-clamp the computed LOD against this value.

Any float value is valid. Initial value is 1000.0f, as in OpenGL spec.

virtual float vtkTextureObject::GetMaxLOD ( )
virtual

Upper-clamp the computed LOD against this value.

Any float value is valid. Initial value is 1000.0f, as in OpenGL spec.

virtual void vtkTextureObject::SetBaseLevel ( int  )
virtual

Level of detail of the first texture image.

A texture object is a list of texture images. It is a non-negative integer value. Initial value is 0, as in OpenGL spec.

virtual int vtkTextureObject::GetBaseLevel ( )
virtual

Level of detail of the first texture image.

A texture object is a list of texture images. It is a non-negative integer value. Initial value is 0, as in OpenGL spec.

virtual void vtkTextureObject::SetMaxLevel ( int  )
virtual

Level of detail of the first texture image.

A texture object is a list of texture images. It is a non-negative integer value. Initial value is 1000, as in OpenGL spec.

virtual int vtkTextureObject::GetMaxLevel ( )
virtual

Level of detail of the first texture image.

A texture object is a list of texture images. It is a non-negative integer value. Initial value is 1000, as in OpenGL spec.

virtual bool vtkTextureObject::GetDepthTextureCompare ( )
virtual

Tells if the output of a texture unit with a depth texture uses comparison or not.

Comparison happens between D_t the depth texture value in the range [0,1] and with R the interpolated third texture coordinate clamped to range [0,1]. The result of the comparison is noted `r'. If this flag is false, r=D_t. Initial value is false, as in OpenGL spec. Ignored if the texture object is not a depth texture.

virtual void vtkTextureObject::SetDepthTextureCompare ( bool  )
virtual

Tells if the output of a texture unit with a depth texture uses comparison or not.

Comparison happens between D_t the depth texture value in the range [0,1] and with R the interpolated third texture coordinate clamped to range [0,1]. The result of the comparison is noted `r'. If this flag is false, r=D_t. Initial value is false, as in OpenGL spec. Ignored if the texture object is not a depth texture.

virtual int vtkTextureObject::GetDepthTextureCompareFunction ( )
virtual

In case DepthTextureCompare is true, specify the comparison function in use.

The result of the comparison is noted `r'. Valid values are:

  • Value
  • Lequal: r=R<=Dt ? 1.0 : 0.0
  • Gequal: r=R>=Dt ? 1.0 : 0.0
  • Less: r=R<D_t ? 1.0 : 0.0
  • Greater: r=R>Dt ? 1.0 : 0.0
  • Equal: r=R==Dt ? 1.0 : 0.0
  • NotEqual: r=R!=Dt ? 1.0 : 0.0
  • AlwaysTrue: r=1.0
  • Never: r=0.0 If the magnification of minification factor are not nearest, percentage closer filtering (PCF) is used: R is compared to several D_t and r is the average of the comparisons (it is NOT the average of D_t compared once to R). Initial value is Lequal, as in OpenGL spec. Ignored if the texture object is not a depth texture.
virtual void vtkTextureObject::SetDepthTextureCompareFunction ( int  )
virtual

In case DepthTextureCompare is true, specify the comparison function in use.

The result of the comparison is noted `r'. Valid values are:

  • Value
  • Lequal: r=R<=Dt ? 1.0 : 0.0
  • Gequal: r=R>=Dt ? 1.0 : 0.0
  • Less: r=R<D_t ? 1.0 : 0.0
  • Greater: r=R>Dt ? 1.0 : 0.0
  • Equal: r=R==Dt ? 1.0 : 0.0
  • NotEqual: r=R!=Dt ? 1.0 : 0.0
  • AlwaysTrue: r=1.0
  • Never: r=0.0 If the magnification of minification factor are not nearest, percentage closer filtering (PCF) is used: R is compared to several D_t and r is the average of the comparisons (it is NOT the average of D_t compared once to R). Initial value is Lequal, as in OpenGL spec. Ignored if the texture object is not a depth texture.
virtual bool vtkTextureObject::GetGenerateMipmap ( )
virtual

Tells the hardware to generate mipmap textures from the first texture image at BaseLevel.

Initial value is false, as in OpenGL spec.

virtual void vtkTextureObject::SetGenerateMipmap ( bool  )
virtual

Tells the hardware to generate mipmap textures from the first texture image at BaseLevel.

Initial value is false, as in OpenGL spec.

static int vtkTextureObject::GetMaximumTextureSize ( vtkOpenGLRenderWindow context)
static

Query and return maximum texture size (dimension) supported by the OpenGL driver for a particular context.

It should be noted that this size does not consider the internal format of the texture and therefore there is no guarentee that a texture of this size will be allocated by the driver. Also, the method does not make the context current so if the passed context is not valid or current, a value of -1 will be returned.

static bool vtkTextureObject::IsSupported ( vtkOpenGLRenderWindow renWin,
bool  requireTexFloat,
bool  requireDepthFloat,
bool  requireTexInt 
)
static

Returns if the context supports the required extensions.

If flags for optional extenisons are set then the test fails when support for them is not found.

static bool vtkTextureObject::IsSupported ( vtkOpenGLRenderWindow renWin)
inlinestatic

Check for feature support, without any optional features.

Definition at line 673 of file vtkTextureObject.h.

void vtkTextureObject::CopyToFrameBuffer ( vtkShaderProgram program,
vtkOpenGLVertexArrayObject vao 
)

Copy the texture (src) in the current framebuffer.

A variety of signatures based on what you want to do Copy the entire texture to the entire current viewport

void vtkTextureObject::CopyToFrameBuffer ( int  srcXmin,
int  srcYmin,
int  srcXmax,
int  srcYmax,
int  dstXmin,
int  dstYmin,
int  dstXmax,
int  dstYmax,
int  dstSizeX,
int  dstSizeY,
vtkShaderProgram program,
vtkOpenGLVertexArrayObject vao 
)

Copy the texture (src) in the current framebuffer.

A variety of signatures based on what you want to do Copy the entire texture to the entire current viewport

void vtkTextureObject::CopyToFrameBuffer ( int  srcXmin,
int  srcYmin,
int  srcXmax,
int  srcYmax,
int  dstXmin,
int  dstYmin,
int  dstSizeX,
int  dstSizeY,
vtkShaderProgram program,
vtkOpenGLVertexArrayObject vao 
)

Copy the texture (src) in the current framebuffer.

A variety of signatures based on what you want to do Copy the entire texture to the entire current viewport

void vtkTextureObject::CopyToFrameBuffer ( float tcoords,
float verts,
vtkShaderProgram program,
vtkOpenGLVertexArrayObject vao 
)

Copy the texture (src) in the current framebuffer.

A variety of signatures based on what you want to do Copy the entire texture to the entire current viewport

void vtkTextureObject::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.

src is the framebuffer, dst is the texture. (srcXmin,srcYmin) is the location of the lower left corner of the rectangle in the framebuffer. (dstXmin,dstYmin) is the location of the lower left corner of the rectangle in the texture. width and height specifies the size of the rectangle in pixels. If the logical buffer is a color buffer, it has to be selected first with glReadBuffer().

Precondition
is2D: GetNumberOfDimensions()==2
void vtkTextureObject::GetShiftAndScale ( float shift,
float scale 
)

Get the shift and scale required in the shader to return the texture values to their original range.

Thsi is useful when for example you have unsigned char data and it is being accessed using the floating point texture calls. In that case OpenGL maps the uchar range to a different floating point range under the hood. Applying the shift and scale will return the data to its original values in the shader. The texture's internal format must be set before calling these routines. Creating the texture does set it.

bool vtkTextureObject::LoadRequiredExtensions ( vtkOpenGLRenderWindow renWin)
protected

Load all necessary extensions.

void vtkTextureObject::CreateTexture ( )
protected

Creates a texture handle if not already created.

void vtkTextureObject::DestroyTexture ( )
protected

Destroy the texture.

Member Data Documentation

int vtkTextureObject::NumberOfDimensions
protected

Definition at line 629 of file vtkTextureObject.h.

unsigned int vtkTextureObject::Width
protected

Definition at line 630 of file vtkTextureObject.h.

unsigned int vtkTextureObject::Height
protected

Definition at line 631 of file vtkTextureObject.h.

unsigned int vtkTextureObject::Depth
protected

Definition at line 632 of file vtkTextureObject.h.

unsigned int vtkTextureObject::Target
protected

Definition at line 634 of file vtkTextureObject.h.

unsigned int vtkTextureObject::Format
protected

Definition at line 635 of file vtkTextureObject.h.

unsigned int vtkTextureObject::Type
protected

Definition at line 636 of file vtkTextureObject.h.

int vtkTextureObject::Components
protected

Definition at line 637 of file vtkTextureObject.h.

vtkWeakPointer<vtkRenderWindow> vtkTextureObject::Context
protected

Definition at line 639 of file vtkTextureObject.h.

unsigned int vtkTextureObject::Handle
protected

Definition at line 640 of file vtkTextureObject.h.

bool vtkTextureObject::RequireTextureInteger
protected

Definition at line 641 of file vtkTextureObject.h.

bool vtkTextureObject::SupportsTextureInteger
protected

Definition at line 642 of file vtkTextureObject.h.

bool vtkTextureObject::RequireTextureFloat
protected

Definition at line 643 of file vtkTextureObject.h.

bool vtkTextureObject::SupportsTextureFloat
protected

Definition at line 644 of file vtkTextureObject.h.

bool vtkTextureObject::RequireDepthBufferFloat
protected

Definition at line 645 of file vtkTextureObject.h.

bool vtkTextureObject::SupportsDepthBufferFloat
protected

Definition at line 646 of file vtkTextureObject.h.

int vtkTextureObject::WrapS
protected

Definition at line 648 of file vtkTextureObject.h.

int vtkTextureObject::WrapT
protected

Definition at line 649 of file vtkTextureObject.h.

int vtkTextureObject::WrapR
protected

Definition at line 650 of file vtkTextureObject.h.

int vtkTextureObject::MinificationFilter
protected

Definition at line 651 of file vtkTextureObject.h.

int vtkTextureObject::MagnificationFilter
protected

Definition at line 652 of file vtkTextureObject.h.

bool vtkTextureObject::LinearMagnification
protected

Definition at line 653 of file vtkTextureObject.h.

float vtkTextureObject::BorderColor
protected

Definition at line 654 of file vtkTextureObject.h.

float vtkTextureObject::Priority
protected

Definition at line 656 of file vtkTextureObject.h.

float vtkTextureObject::MinLOD
protected

Definition at line 657 of file vtkTextureObject.h.

float vtkTextureObject::MaxLOD
protected

Definition at line 658 of file vtkTextureObject.h.

int vtkTextureObject::BaseLevel
protected

Definition at line 659 of file vtkTextureObject.h.

int vtkTextureObject::MaxLevel
protected

Definition at line 660 of file vtkTextureObject.h.

bool vtkTextureObject::DepthTextureCompare
protected

Definition at line 663 of file vtkTextureObject.h.

int vtkTextureObject::DepthTextureCompareFunction
protected

Definition at line 664 of file vtkTextureObject.h.

int vtkTextureObject::DepthTextureMode
protected

Definition at line 665 of file vtkTextureObject.h.

bool vtkTextureObject::GenerateMipmap
protected

Definition at line 667 of file vtkTextureObject.h.

int vtkTextureObject::AutoParameters
protected

Definition at line 669 of file vtkTextureObject.h.

vtkTimeStamp vtkTextureObject::SendParametersTime
protected

Definition at line 670 of file vtkTextureObject.h.

vtkGenericOpenGLResourceFreeCallback* vtkTextureObject::ResourceCallback
protected

Definition at line 745 of file vtkTextureObject.h.

unsigned int vtkTextureObject::InternalFormat
protected

Definition at line 769 of file vtkTextureObject.h.

vtkWeakPointer<vtkOpenGLRenderWindow> vtkTextureObject::Context
protected

Definition at line 773 of file vtkTextureObject.h.

vtkOpenGLHelper* vtkTextureObject::ShaderProgram
protected

Definition at line 803 of file vtkTextureObject.h.

vtkOpenGLBufferObject* vtkTextureObject::BufferObject
protected

Definition at line 806 of file vtkTextureObject.h.


The documentation for this class was generated from the following file: