VTK  9.7.1
vtkOpenGLTextureCPUNormalization.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
15 #ifndef vtkOpenGLTextureCPUNormalization_h
16 #define vtkOpenGLTextureCPUNormalization_h
17 
19 #include "vtkRenderingOpenGL2Module.h"
20 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
21 #include "vtk_glad.h"
22 #include <vector>
23 
24 VTK_ABI_NAMESPACE_BEGIN
25 
26 class VTKRENDERINGOPENGL2_EXPORT VTK_MARSHALAUTO vtkOpenGLTextureCPUNormalization
28 {
29 public:
32  void PrintSelf(ostream& os, vtkIndent indent) override;
33 
34  bool ConvertUShortToFloat(const void* sourceData, size_t numValues, int numComps,
35  unsigned int targetTexture, unsigned int width, unsigned int height) override;
36 
37  bool ConvertShortToFloat(const void* sourceData, size_t numValues, int numComps,
38  unsigned int targetTexture, unsigned int width, unsigned int height) override;
39 
40 protected:
42  ~vtkOpenGLTextureCPUNormalization() override = default;
43 
44  // Reusable buffer to avoid repeated allocations
45  std::vector<float> ConversionBuffer;
46 
47 private:
49  void operator=(const vtkOpenGLTextureCPUNormalization&) = delete;
50 };
51 
52 VTK_ABI_NAMESPACE_END
53 #endif // vtkOpenGLTextureCPUNormalization_h
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
CPU-based fallback 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.