VTK  9.6.20260130
vtkOpenGLTexture.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
92
93#ifndef vtkOpenGLTexture_h
94#define vtkOpenGLTexture_h
95
96#include "vtkRenderingOpenGL2Module.h" // For export macro
97#include "vtkTexture.h"
98#include "vtkWeakPointer.h" // needed for vtkWeakPointer.
99#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
100
101VTK_ABI_NAMESPACE_BEGIN
102class vtkRenderWindow;
103class vtkTextureObject;
105
106class VTKRENDERINGOPENGL2_EXPORT VTK_MARSHALAUTO vtkOpenGLTexture : public vtkTexture
107{
108public:
113 void PrintSelf(ostream& os, vtkIndent indent) override;
114
120 void Render(vtkRenderer* ren) override;
121
125 void Load(vtkRenderer*) override;
126
127 // Descsription:
128 // Clean up after the rendering is complete.
129 void PostRender(vtkRenderer*) override;
130
138
142 void CopyTexImage(int x, int y, int width, int height);
143
145
148 vtkGetMacro(IsDepthTexture, int);
149 vtkSetMacro(IsDepthTexture, int);
151
153
156 vtkGetMacro(TextureType, int);
157 vtkSetMacro(TextureType, int);
159
161 vtkGetObjectMacro(TextureObject, vtkTextureObject);
164
168 int GetTextureUnit() override;
169
176 int IsTranslucent() override;
177
178protected:
180 ~vtkOpenGLTexture() override;
181
183 vtkWeakPointer<vtkRenderWindow> RenderWindow; // RenderWindow used for previous render
184
187
191
192 // used when the texture exceeds the GL limit
193 unsigned char* ResampleToPowerOfTwo(
194 int& xsize, int& ysize, unsigned char* dptr, int bpp, int maxDimGL);
195
196private:
197 vtkOpenGLTexture(const vtkOpenGLTexture&) = delete;
198 void operator=(const vtkOpenGLTexture&) = delete;
199};
200
201#define vtkOpenGLTexture_OVERRIDE_ATTRIBUTES vtkOpenGLTexture::CreateOverrideAttributes()
202VTK_ABI_NAMESPACE_END
203#endif
a simple class to control print indentation
Definition vtkIndent.h:108
void Load(vtkRenderer *) override
Implement base class method.
int GetTextureUnit() override
Return the texture unit used for this texture.
void CopyTexImage(int x, int y, int width, int height)
copy the renderers read buffer into this texture
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void ReleaseGraphicsResources(vtkWindow *) override
Release any graphics resources that are being consumed by this texture.
int IsTranslucent() override
Is this Texture Translucent?
unsigned char * ResampleToPowerOfTwo(int &xsize, int &ysize, unsigned char *dptr, int bpp, int maxDimGL)
static vtkOpenGLTexture * New()
void PostRender(vtkRenderer *) override
Cleans up after the texture rendering to restore the state of the graphics context.
void SetTextureObject(vtkTextureObject *)
void Render(vtkRenderer *ren) override
Renders a texture map.
vtkWeakPointer< vtkRenderWindow > RenderWindow
vtkTextureObject * TextureObject
vtkTimeStamp LoadTime
static vtkOverrideAttribute * CreateOverrideAttributes()
Attribute for vtkObjectFactory overrides.
create a window for renderers to draw into
abstract specification for renderers
abstracts an OpenGL texture object.
record modification and/or execution time
a weak reference to a vtkObject.
window superclass for vtkRenderWindow
Definition vtkWindow.h:61
#define VTK_MARSHAL_EXCLUDE_REASON_IS_INTERNAL
#define VTK_MARSHALAUTO
#define VTK_MARSHALEXCLUDE(reason)
#define VTK_NEWINSTANCE