VTK  9.7.1
vtkOpenGLTextureFramebufferNormalization.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
23 #ifndef vtkOpenGLTextureFramebufferNormalization_h
24 #define vtkOpenGLTextureFramebufferNormalization_h
25 
27 #include "vtkRenderingOpenGL2Module.h"
28 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
29 #include "vtk_glad.h"
30 
31 VTK_ABI_NAMESPACE_BEGIN
33 
36 {
37 public:
40  void PrintSelf(ostream& os, vtkIndent indent) override;
41 
47  void Initialize(vtkOpenGLRenderWindow* context);
48 
49  bool ConvertUShortToFloat(const void* sourceData, size_t numValues, int numComps,
50  unsigned int targetTexture, unsigned int width, unsigned int height) override;
51 
52  bool ConvertShortToFloat(const void* sourceData, size_t numValues, int numComps,
53  unsigned int targetTexture, unsigned int width, unsigned int height) override;
54 
55 protected:
58 
59  vtkOpenGLRenderWindow* Context = nullptr;
60  GLuint ConversionProgram = 0;
61  GLuint IntermediateTexture = 0;
62  GLuint ConversionFramebuffer = 0;
63  GLuint ConversionVAO = 0;
64 
65  bool InitializeConversionShader();
66  bool UploadToIntermediateTexture(const void* sourceData, size_t numValues, int numComps,
67  unsigned int width, unsigned int height, GLenum internalFormat, GLenum dataFormat);
68  bool PerformFramebufferConversion(unsigned int targetTexture, int numComps, unsigned int width,
69  unsigned int height, float scaleFactor);
70 
71 private:
74  void operator=(const vtkOpenGLTextureFramebufferNormalization&) = delete;
75 };
76 
77 VTK_ABI_NAMESPACE_END
78 #endif // vtkOpenGLTextureFramebufferNormalization_h
OpenGL rendering window.
GPU-based texture normalization for GLES 3.0 without GL_EXT_texture_norm16.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
a simple class to control print indentation
Definition: vtkIndent.h:28
Framebuffer-based shader conversion for 16-bit to float texture normalization.
#define VTK_MARSHALAUTO
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
virtual bool ConvertShortToFloat(const void *sourceData, size_t numValues, int numComps, unsigned int targetTexture, unsigned int width, unsigned int height)=0
Convert signed short texture data to float in GPU memory.
virtual bool ConvertUShortToFloat(const void *sourceData, size_t numValues, int numComps, unsigned int targetTexture, unsigned int width, unsigned int height)=0
Convert unsigned short texture data to float in GPU memory.