VTK  9.6.20260516
vtkOpenGLTextureComputeShaderNormalization.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
17
18#ifndef vtkOpenGLTextureComputeShaderNormalization_h
19#define vtkOpenGLTextureComputeShaderNormalization_h
20
22#include "vtkRenderingOpenGL2Module.h"
23#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
24#include "vtk_glad.h"
25
26VTK_ABI_NAMESPACE_BEGIN
28
29#ifdef GL_COMPUTE_SHADER
30
33{
34public:
37 void PrintSelf(ostream& os, vtkIndent indent) override;
38
44 void Initialize(vtkOpenGLRenderWindow* context);
45
46 bool ConvertUShortToFloat(const void* sourceData, size_t numValues, int numComps,
47 unsigned int targetTexture, unsigned int width, unsigned int height) override;
48
49 bool ConvertShortToFloat(const void* sourceData, size_t numValues, int numComps,
50 unsigned int targetTexture, unsigned int width, unsigned int height) override;
51
52protected:
55
56 vtkOpenGLRenderWindow* Context = nullptr;
57 GLuint ComputeProgram = 0;
58 GLuint IntermediateStorageTexture = 0;
59
60 bool InitializeComputeProgram();
61 bool UploadToIntermediateTexture(const void* sourceData, size_t numValues, int numComps,
62 unsigned int width, unsigned int height, GLenum sourceFormat);
63 bool RunNormalizationCompute(
64 int numComps, unsigned int targetTexture, unsigned int width, unsigned int height);
65
66private:
69 void operator=(const vtkOpenGLTextureComputeShaderNormalization&) = delete;
70};
71
72#endif // GL_COMPUTE_SHADER
73
74VTK_ABI_NAMESPACE_END
75#endif // vtkOpenGLTextureComputeShaderNormalization_h
a simple class to control print indentation
Definition vtkIndent.h:108
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
OpenGL rendering window.
GPU compute shader implementation for 16-bit to float texture normalization.
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.
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.
#define VTK_MARSHALAUTO