VTK
vtkOpenGLTexture.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkOpenGLTexture.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
23 #ifndef vtkOpenGLTexture_h
24 #define vtkOpenGLTexture_h
25 
26 #include "vtkRenderingOpenGL2Module.h" // For export macro
27 #include "vtkTexture.h"
28 #include "vtkWeakPointer.h" // needed for vtkWeakPointer.
29 
30 class vtkRenderWindow;
31 class vtkTextureObject;
32 
33 class VTKRENDERINGOPENGL2_EXPORT vtkOpenGLTexture : public vtkTexture
34 {
35 public:
36  static vtkOpenGLTexture *New();
37  vtkTypeMacro(vtkOpenGLTexture, vtkTexture);
38  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
39 
45  virtual void Render(vtkRenderer* ren);
46 
50  void Load(vtkRenderer*);
51 
52  // Descsription:
53  // Clean up after the rendering is complete.
54  virtual void PostRender(vtkRenderer*);
55 
63 
67  void CopyTexImage(int x, int y, int width, int height);
68 
70 
73  vtkGetMacro(IsDepthTexture,int);
74  vtkSetMacro(IsDepthTexture,int);
76 
78 
81  vtkGetMacro(TextureType,int);
82  vtkSetMacro(TextureType,int);
84 
85  vtkGetObjectMacro(TextureObject, vtkTextureObject);
87 
91  virtual int GetTextureUnit();
92 
99  virtual int IsTranslucent();
100 
101 protected:
104 
105  vtkTimeStamp LoadTime;
106  vtkWeakPointer<vtkRenderWindow> RenderWindow; // RenderWindow used for previous render
107 
110 
113  int PrevBlendParams[4];
114 
115  // used when the texture exceeds the GL limit
116  unsigned char *ResampleToPowerOfTwo(int &xsize, int &ysize,
117  unsigned char *dptr, int bpp);
118 
119 
120 private:
121  vtkOpenGLTexture(const vtkOpenGLTexture&) VTK_DELETE_FUNCTION;
122  void operator=(const vtkOpenGLTexture&) VTK_DELETE_FUNCTION;
123 };
124 
125 #endif
vtkOpenGLTexture::TextureType
int TextureType
Definition: vtkOpenGLTexture.h:112
vtkOpenGLTexture::vtkOpenGLTexture
vtkOpenGLTexture()
vtkOpenGLTexture::~vtkOpenGLTexture
~vtkOpenGLTexture()
vtkTimeStamp
record modification and/or execution time
Definition: vtkTimeStamp.h:36
vtkOpenGLTexture::IsTranslucent
virtual int IsTranslucent()
Is this Texture Translucent? returns false (0) if the texture is either fully opaque or has only full...
vtkOpenGLTexture::IsDepthTexture
int IsDepthTexture
Definition: vtkOpenGLTexture.h:111
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:35
vtkOpenGLTexture::New
static vtkOpenGLTexture * New()
vtkOpenGLTexture::Load
void Load(vtkRenderer *)
Implement base class method.
vtkTexture
handles properties associated with a texture map
Definition: vtkTexture.h:71
vtkOpenGLTexture::ExternalTextureObject
bool ExternalTextureObject
Definition: vtkOpenGLTexture.h:108
vtkOpenGLTexture::GetTextureUnit
virtual int GetTextureUnit()
Return the texture unit used for this texture.
vtkOpenGLTexture::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkX3D::height
@ height
Definition: vtkX3D.h:254
vtkOpenGLTexture::SetTextureObject
void SetTextureObject(vtkTextureObject *)
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkTextureObject
abstracts an OpenGL texture object.
Definition: vtkTextureObject.h:44
vtkOpenGLTexture::PostRender
virtual void PostRender(vtkRenderer *)
Cleans up after the texture rendering to restore the state of the graphics context.
vtkOpenGLTexture::ResampleToPowerOfTwo
unsigned char * ResampleToPowerOfTwo(int &xsize, int &ysize, unsigned char *dptr, int bpp)
vtkOpenGLTexture::Render
virtual void Render(vtkRenderer *ren)
Renders a texture map.
vtkWeakPointer.h
vtkOpenGLTexture::TextureObject
vtkTextureObject * TextureObject
Definition: vtkOpenGLTexture.h:109
vtkTexture.h
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:64
vtkOpenGLTexture::ReleaseGraphicsResources
void ReleaseGraphicsResources(vtkWindow *)
Release any graphics resources that are being consumed by this texture.
vtkRenderWindow
create a window for renderers to draw into
Definition: vtkRenderWindow.h:87
vtkOpenGLTexture
OpenGL texture map.
Definition: vtkOpenGLTexture.h:40
vtkOpenGLTexture::CopyTexImage
void CopyTexImage(int x, int y, int width, int height)
copy the renderers read buffer into this texture
vtkWeakPointer< vtkRenderWindow >