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 Types inherited from vtkObject
typedef vtkObjectBase Superclass
 

Public Member Functions

virtual int IsA (const char *type)
 
vtkTextureObjectNewInstance () const
 
void PrintSelf (ostream &os, vtkIndent indent)
 
virtual int GetNumberOfDimensions ()
 
bool IsBound ()
 
bool Allocate1D (unsigned int width, int numComps, int vtkType)
 
vtkPixelBufferObjectDownload ()
 
int GetDataType ()
 
unsigned int GetInternalFormat (int vtktype, int numComps, bool shaderSupportsTextureInt)
 
unsigned int GetFormat (int vtktype, int numComps, bool shaderSupportsTextureInt)
 
bool GetLinearMagnification ()
 
virtual int IsA (const char *type)
 
vtkTextureObjectNewInstance () const
 
void PrintSelf (ostream &os, vtkIndent indent)
 
virtual int GetNumberOfDimensions ()
 
int GetTextureUnit ()
 
void Activate ()
 
void Deactivate ()
 
void ReleaseGraphicsResources (vtkWindow *win)
 
bool IsBound ()
 
vtkPixelBufferObjectDownload ()
 
bool Allocate1D (unsigned int width, int numComps, int vtkType)
 
int GetVTKDataType ()
 
void ResetFormatAndType ()
 
unsigned int GetDepthTextureModeFormat (int vtktype)
 
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)
 
bool GetLinearMagnification ()
 
void SetContext (vtkRenderWindow *)
 
vtkRenderWindowGetContext ()
 
virtual unsigned int GetWidth ()
 
virtual unsigned int GetHeight ()
 
virtual unsigned int GetDepth ()
 
virtual int GetComponents ()
 
unsigned int GetTuples ()
 
virtual unsigned int GetTarget ()
 
virtual unsigned int GetHandle ()
 
void Bind ()
 
void UnBind ()
 
void Activate (unsigned int texUnit)
 
void Deactivate (unsigned int texUnit)
 
void SendParameters ()
 
virtual void SetAutoParameters (int)
 
virtual int GetAutoParameters ()
 
bool Create1D (int numComps, vtkPixelBufferObject *pbo, bool shaderSupportsTextureInt)
 
bool Create2D (unsigned int width, unsigned int height, int numComps, vtkPixelBufferObject *pbo, bool shaderSupportsTextureInt)
 
bool CreateDepth (unsigned int width, unsigned int height, int internalFormat, vtkPixelBufferObject *pbo)
 
bool CreateDepthFromRaw (unsigned int width, unsigned int height, int internalFormat, int rawType, void *raw)
 
bool AllocateDepth (unsigned int width, unsigned int height, int internalFormat)
 
bool Allocate2D (unsigned int width, unsigned int height, int numComps, int vtkType)
 
bool Allocate3D (unsigned int width, unsigned int height, unsigned int depth, int numComps, int vtkType)
 
bool Create3D (unsigned int width, unsigned int height, unsigned int depth, int numComps, vtkPixelBufferObject *pbo, bool shaderSupportsTextureInt)
 
bool Create2D (unsigned int width, unsigned int height, int numComps, int vtktype, bool shaderSupportsTextureInt)
 
bool Create3D (unsigned int width, unsigned int height, unsigned int depth, int numComps, int vtktype, bool shaderSupportsTextureInt)
 
virtual void SetRequireDepthBufferFloat (bool)
 
virtual bool GetRequireDepthBufferFloat ()
 
virtual bool GetSupportsDepthBufferFloat ()
 
virtual void SetRequireTextureFloat (bool)
 
virtual bool GetRequireTextureFloat ()
 
virtual bool GetSupportsTextureFloat ()
 
virtual void SetRequireTextureInteger (bool)
 
virtual bool GetRequireTextureInteger ()
 
virtual bool GetSupportsTextureInteger ()
 
virtual int GetWrapS ()
 
virtual void SetWrapS (int)
 
virtual int GetWrapT ()
 
virtual void SetWrapT (int)
 
virtual int GetWrapR ()
 
virtual void SetWrapR (int)
 
virtual int GetMinificationFilter ()
 
virtual void SetMinificationFilter (int)
 
virtual int GetMagnificationFilter ()
 
virtual void SetMagnificationFilter (int)
 
void SetLinearMagnification (bool val)
 
virtual void SetBorderColor (float, float, float, float)
 
virtual void SetBorderColor (float[4])
 
virtual floatGetBorderColor ()
 
virtual void GetBorderColor (float &, float &, float &, float &)
 
virtual void GetBorderColor (float[4])
 
virtual void SetPriority (float)
 
virtual float GetPriority ()
 
virtual void SetMinLOD (float)
 
virtual float GetMinLOD ()
 
virtual void SetMaxLOD (float)
 
virtual float GetMaxLOD ()
 
virtual void SetBaseLevel (int)
 
virtual int GetBaseLevel ()
 
virtual void SetMaxLevel (int)
 
virtual int GetMaxLevel ()
 
virtual bool GetDepthTextureCompare ()
 
virtual void SetDepthTextureCompare (bool)
 
virtual int GetDepthTextureCompareFunction ()
 
virtual void SetDepthTextureCompareFunction (int)
 
virtual int GetDepthTextureMode ()
 
virtual void SetDepthTextureMode (int)
 
virtual bool GetGenerateMipmap ()
 
virtual void SetGenerateMipmap (bool)
 
void CopyToFrameBuffer (int srcXmin, int srcYmin, int srcXmax, int srcYmax, int dstXmin, int dstYmin, int width, int height)
 
void CopyFromFrameBuffer (int srcXmin, int srcYmin, int dstXmin, int dstYmin, int width, int height)
 
void SetContext (vtkOpenGLRenderWindow *)
 
vtkOpenGLRenderWindowGetContext ()
 
virtual unsigned int GetWidth ()
 
virtual unsigned int GetHeight ()
 
virtual unsigned int GetDepth ()
 
virtual int GetComponents ()
 
unsigned int GetTuples ()
 
virtual unsigned int GetTarget ()
 
virtual unsigned int GetHandle ()
 
void Bind ()
 
void UnBind ()
 
void SendParameters ()
 
virtual void SetAutoParameters (int)
 
virtual int GetAutoParameters ()
 
bool Create2DFromRaw (unsigned int width, unsigned int height, int numComps, int dataType, void *data)
 
bool CreateDepthFromRaw (unsigned int width, unsigned int height, int internalFormat, int rawType, void *raw)
 
bool CreateTextureBuffer (unsigned int numValues, int numComps, int dataType, vtkOpenGLBufferObject *bo)
 
bool Create1D (int numComps, vtkPixelBufferObject *pbo, bool shaderSupportsTextureInt)
 
bool Create1DFromRaw (unsigned int width, int numComps, int dataType, void *data)
 
bool CreateAlphaFromRaw (unsigned int width, int internalFormat, int rawType, void *raw)
 
bool Create2D (unsigned int width, unsigned int height, int numComps, vtkPixelBufferObject *pbo, bool shaderSupportsTextureInt)
 
bool Create3D (unsigned int width, unsigned int height, unsigned int depth, int numComps, vtkPixelBufferObject *pbo, bool shaderSupportsTextureInt)
 
bool Create3DFromRaw (unsigned int width, unsigned int height, unsigned int depth, int numComps, int dataType, void *data)
 
bool CreateDepth (unsigned int width, unsigned int height, int internalFormat, vtkPixelBufferObject *pbo)
 
bool AllocateDepth (unsigned int width, unsigned int height, int internalFormat)
 
bool Allocate2D (unsigned int width, unsigned int height, int numComps, int vtkType)
 
bool Allocate3D (unsigned int width, unsigned int height, unsigned int depth, int numComps, int vtkType)
 
bool Create2D (unsigned int width, unsigned int height, int numComps, int vtktype, bool shaderSupportsTextureInt)
 
bool Create3D (unsigned int width, unsigned int height, unsigned int depth, int numComps, int vtktype, bool shaderSupportsTextureInt)
 
int GetDataType (int vtk_scalar_type)
 
void SetDataType (unsigned int glType)
 
unsigned int GetInternalFormat (int vtktype, int numComps, bool shaderSupportsTextureInt)
 
void SetInternalFormat (unsigned int glInternalFormat)
 
unsigned int GetFormat (int vtktype, int numComps, bool shaderSupportsTextureInt)
 
void SetFormat (unsigned int glFormat)
 
virtual void SetRequireDepthBufferFloat (bool)
 
virtual bool GetRequireDepthBufferFloat ()
 
virtual bool GetSupportsDepthBufferFloat ()
 
virtual void SetRequireTextureFloat (bool)
 
virtual bool GetRequireTextureFloat ()
 
virtual bool GetSupportsTextureFloat ()
 
virtual void SetRequireTextureInteger (bool)
 
virtual bool GetRequireTextureInteger ()
 
virtual bool GetSupportsTextureInteger ()
 
virtual int GetWrapS ()
 
virtual void SetWrapS (int)
 
virtual int GetWrapT ()
 
virtual void SetWrapT (int)
 
virtual int GetWrapR ()
 
virtual void SetWrapR (int)
 
virtual int GetMinificationFilter ()
 
virtual void SetMinificationFilter (int)
 
virtual int GetMagnificationFilter ()
 
virtual void SetMagnificationFilter (int)
 
void SetLinearMagnification (bool val)
 
virtual void SetBorderColor (float, float, float, float)
 
virtual void SetBorderColor (float[4])
 
virtual floatGetBorderColor ()
 
virtual void GetBorderColor (float &, float &, float &, float &)
 
virtual void GetBorderColor (float[4])
 
virtual void SetMinLOD (float)
 
virtual float GetMinLOD ()
 
virtual void SetMaxLOD (float)
 
virtual float GetMaxLOD ()
 
virtual void SetBaseLevel (int)
 
virtual int GetBaseLevel ()
 
virtual void SetMaxLevel (int)
 
virtual int GetMaxLevel ()
 
virtual bool GetDepthTextureCompare ()
 
virtual void SetDepthTextureCompare (bool)
 
virtual int GetDepthTextureCompareFunction ()
 
virtual void SetDepthTextureCompareFunction (int)
 
virtual bool GetGenerateMipmap ()
 
virtual void SetGenerateMipmap (bool)
 
void CopyToFrameBuffer (vtkShaderProgram *program, vtkOpenGLVertexArrayObject *vao)
 
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)
 
void CopyToFrameBuffer (int srcXmin, int srcYmin, int srcXmax, int srcYmax, int dstXmin, int dstYmin, int dstSizeX, int dstSizeY, vtkShaderProgram *program, vtkOpenGLVertexArrayObject *vao)
 
void CopyToFrameBuffer (float *tcoords, float *verts, vtkShaderProgram *program, vtkOpenGLVertexArrayObject *vao)
 
void CopyFromFrameBuffer (int srcXmin, int srcYmin, int dstXmin, int dstYmin, int width, int height)
 
- Public Member Functions inherited from vtkObject
vtkObjectNewInstance () const
 
virtual void DebugOn ()
 
virtual void DebugOff ()
 
bool GetDebug ()
 
void SetDebug (bool debugFlag)
 
virtual void Modified ()
 
virtual unsigned long GetMTime ()
 
unsigned long AddObserver (unsigned long event, vtkCommand *, float priority=0.0f)
 
unsigned long AddObserver (const char *event, vtkCommand *, float priority=0.0f)
 
vtkCommandGetCommand (unsigned long tag)
 
void RemoveObserver (vtkCommand *)
 
void RemoveObservers (unsigned long event, vtkCommand *)
 
void RemoveObservers (const char *event, vtkCommand *)
 
int HasObserver (unsigned long event, vtkCommand *)
 
int HasObserver (const char *event, vtkCommand *)
 
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)
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f)
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, bool(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 
int InvokeEvent (unsigned long event, void *callData)
 
int InvokeEvent (const char *event, void *callData)
 
int InvokeEvent (unsigned long event)
 
int InvokeEvent (const char *event)
 
- Public Member Functions inherited from vtkObjectBase
const char * GetClassName () const
 
virtual void Delete ()
 
virtual void FastDelete ()
 
void Print (ostream &os)
 
virtual void Register (vtkObjectBase *o)
 
virtual void UnRegister (vtkObjectBase *o)
 
void SetReferenceCount (int)
 
void PrintRevisions (ostream &)
 
virtual void PrintHeader (ostream &os, vtkIndent indent)
 
virtual void PrintTrailer (ostream &os, vtkIndent indent)
 
int GetReferenceCount ()
 

Static Public Member Functions

static vtkTextureObjectNew ()
 
static int IsTypeOf (const char *type)
 
static vtkTextureObjectSafeDownCast (vtkObjectBase *o)
 
static vtkTextureObjectNew ()
 
static int IsTypeOf (const char *type)
 
static vtkTextureObjectSafeDownCast (vtkObjectBase *o)
 
static bool IsSupported (vtkRenderWindow *renWin, bool requireTexFloat, bool requireDepthFloat, bool requireTexInt)
 
static bool IsSupported (vtkRenderWindow *renWin)
 
static bool IsSupported (vtkOpenGLRenderWindow *renWin, bool requireTexFloat, bool requireDepthFloat, bool requireTexInt)
 
static bool IsSupported (vtkOpenGLRenderWindow *renWin)
 
- Static Public Member Functions inherited from vtkObject
static int IsTypeOf (const char *type)
 
static vtkObjectSafeDownCast (vtkObjectBase *o)
 
static vtkObjectNew ()
 
static void BreakOnError ()
 
static void SetGlobalWarningDisplay (int val)
 
static void GlobalWarningDisplayOn ()
 
static void GlobalWarningDisplayOff ()
 
static int GetGlobalWarningDisplay ()
 
- Static Public Member Functions inherited from vtkObjectBase
static int IsTypeOf (const char *name)
 
static vtkObjectBaseNew ()
 

Protected Member Functions

virtual vtkObjectBaseNewInstanceInternal () const
 
 vtkTextureObject ()
 
 ~vtkTextureObject ()
 
bool LoadRequiredExtensions (vtkRenderWindow *renWin)
 
void CreateTexture ()
 
void DestroyTexture ()
 
virtual vtkObjectBaseNewInstanceInternal () const
 
 vtkTextureObject ()
 
 ~vtkTextureObject ()
 
bool LoadRequiredExtensions (vtkOpenGLRenderWindow *renWin)
 
void CreateTexture ()
 
void DestroyTexture ()
 
- Protected Member Functions inherited from vtkObject
 vtkObject ()
 
virtual ~vtkObject ()
 
virtual void RegisterInternal (vtkObjectBase *, int check)
 
virtual void UnRegisterInternal (vtkObjectBase *, int check)
 
void InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=NULL)
 
void InternalReleaseFocus ()
 
- 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
 
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.

Definition at line 39 of file vtkTextureObject.h.

Member Typedef Documentation

Definition at line 104 of file vtkTextureObject.h.

Definition at line 124 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 46 of file vtkTextureObject.h.

anonymous enum
Enumerator
ClampToEdge 
Repeat 
MirroredRepeat 
ClampToBorder 
NumberOfWrapModes 

Definition at line 62 of file vtkTextureObject.h.

anonymous enum
Enumerator
Nearest 
Linear 
NearestMipmapNearest 
NearestMipmapLinear 
LinearMipmapNearest 
LinearMipmapLinear 
NumberOfMinificationModes 

Definition at line 81 of file vtkTextureObject.h.

anonymous enum
Enumerator
Native 
Fixed16 
Fixed24 
Fixed32 
Float32 
NumberOfDepthFormats 

Definition at line 93 of file vtkTextureObject.h.

anonymous enum
Enumerator
alpha 
alpha8 
alpha16 
alpha16f 
alpha32f 
NumberOfAlphaFormats 

Definition at line 104 of file vtkTextureObject.h.

anonymous enum
Enumerator
DepthAlpha 
DepthLuminance 
DepthIntensity 
NumberOfDepthModeFormats 

Definition at line 115 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 vtkObject.

static vtkTextureObject* vtkTextureObject::SafeDownCast ( vtkObjectBase o)
static
virtual vtkObjectBase* vtkTextureObject::NewInstanceInternal ( ) const
protectedvirtual

Reimplemented from vtkObject.

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 123 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 341 of file vtkTextureObject.h.

bool vtkTextureObject::GetLinearMagnification ( )
inline

Definition at line 345 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 450 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 vtkObject.

static vtkTextureObject* vtkTextureObject::SafeDownCast ( vtkObjectBase o)
static
virtual vtkObjectBase* vtkTextureObject::NewInstanceInternal ( ) const
protectedvirtual

Reimplemented from vtkObject.

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 143 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::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.

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::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)

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::GetDepthTextureModeFormat ( int  vtktype)
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 432 of file vtkTextureObject.h.

bool vtkTextureObject::GetLinearMagnification ( )
inline

Definition at line 436 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::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 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 523 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
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 518 of file vtkTextureObject.h.

unsigned int vtkTextureObject::Width
protected

Definition at line 519 of file vtkTextureObject.h.

unsigned int vtkTextureObject::Height
protected

Definition at line 520 of file vtkTextureObject.h.

unsigned int vtkTextureObject::Depth
protected

Definition at line 521 of file vtkTextureObject.h.

unsigned int vtkTextureObject::Target
protected

Definition at line 523 of file vtkTextureObject.h.

unsigned int vtkTextureObject::Format
protected

Definition at line 524 of file vtkTextureObject.h.

unsigned int vtkTextureObject::Type
protected

Definition at line 525 of file vtkTextureObject.h.

int vtkTextureObject::Components
protected

Definition at line 526 of file vtkTextureObject.h.

vtkWeakPointer<vtkRenderWindow> vtkTextureObject::Context
protected

Definition at line 528 of file vtkTextureObject.h.

unsigned int vtkTextureObject::Handle
protected

Definition at line 529 of file vtkTextureObject.h.

bool vtkTextureObject::RequireTextureInteger
protected

Definition at line 530 of file vtkTextureObject.h.

bool vtkTextureObject::SupportsTextureInteger
protected

Definition at line 531 of file vtkTextureObject.h.

bool vtkTextureObject::RequireTextureFloat
protected

Definition at line 532 of file vtkTextureObject.h.

bool vtkTextureObject::SupportsTextureFloat
protected

Definition at line 533 of file vtkTextureObject.h.

bool vtkTextureObject::RequireDepthBufferFloat
protected

Definition at line 534 of file vtkTextureObject.h.

bool vtkTextureObject::SupportsDepthBufferFloat
protected

Definition at line 535 of file vtkTextureObject.h.

int vtkTextureObject::WrapS
protected

Definition at line 537 of file vtkTextureObject.h.

int vtkTextureObject::WrapT
protected

Definition at line 538 of file vtkTextureObject.h.

int vtkTextureObject::WrapR
protected

Definition at line 539 of file vtkTextureObject.h.

int vtkTextureObject::MinificationFilter
protected

Definition at line 540 of file vtkTextureObject.h.

int vtkTextureObject::MagnificationFilter
protected

Definition at line 541 of file vtkTextureObject.h.

bool vtkTextureObject::LinearMagnification
protected

Definition at line 542 of file vtkTextureObject.h.

float vtkTextureObject::BorderColor
protected

Definition at line 543 of file vtkTextureObject.h.

float vtkTextureObject::Priority
protected

Definition at line 545 of file vtkTextureObject.h.

float vtkTextureObject::MinLOD
protected

Definition at line 546 of file vtkTextureObject.h.

float vtkTextureObject::MaxLOD
protected

Definition at line 547 of file vtkTextureObject.h.

int vtkTextureObject::BaseLevel
protected

Definition at line 548 of file vtkTextureObject.h.

int vtkTextureObject::MaxLevel
protected

Definition at line 549 of file vtkTextureObject.h.

bool vtkTextureObject::DepthTextureCompare
protected

Definition at line 552 of file vtkTextureObject.h.

int vtkTextureObject::DepthTextureCompareFunction
protected

Definition at line 553 of file vtkTextureObject.h.

int vtkTextureObject::DepthTextureMode
protected

Definition at line 554 of file vtkTextureObject.h.

bool vtkTextureObject::GenerateMipmap
protected

Definition at line 556 of file vtkTextureObject.h.

int vtkTextureObject::AutoParameters
protected

Definition at line 558 of file vtkTextureObject.h.

vtkTimeStamp vtkTextureObject::SendParametersTime
protected

Definition at line 559 of file vtkTextureObject.h.

unsigned int vtkTextureObject::InternalFormat
protected

Definition at line 597 of file vtkTextureObject.h.

vtkWeakPointer<vtkOpenGLRenderWindow> vtkTextureObject::Context
protected

Definition at line 601 of file vtkTextureObject.h.

vtkOpenGLHelper* vtkTextureObject::ShaderProgram
protected

Definition at line 632 of file vtkTextureObject.h.

vtkOpenGLBufferObject* vtkTextureObject::BufferObject
protected

Definition at line 635 of file vtkTextureObject.h.


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