VTK  9.6.20260515
vtkOpenGLTextureNormalizationHelper.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
25
26#ifndef vtkOpenGLTextureNormalizationHelper_h
27#define vtkOpenGLTextureNormalizationHelper_h
28
29#include "vtkObject.h"
30#include "vtkRenderingOpenGL2Module.h" // For export macro
31#include "vtkSmartPointer.h" // For ivar
32#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
33
34VTK_ABI_NAMESPACE_BEGIN
36
38 : public vtkObject
39{
40public:
42 void PrintSelf(ostream& os, vtkIndent indent) override;
43
44 enum class ConversionMode
45 {
46 CPU, // CPU conversion (fallback)
47 ComputeShader, // Compute shader (fastest if available)
48 CopyTexImage, // Framebuffer blit with shader conversion
49 Unsupported // No conversion available
50 };
51
57 vtkOpenGLRenderWindow* context);
58
62 ConversionMode GetConversionMode() const { return this->Mode; }
63
68 {
69 return this->Mode != ConversionMode::CPU && this->Mode != ConversionMode::Unsupported;
70 }
71
83 virtual bool ConvertUShortToFloat(const void* sourceData, size_t numValues, int numComps,
84 unsigned int targetTexture, unsigned int width, unsigned int height) = 0;
85
97 virtual bool ConvertShortToFloat(const void* sourceData, size_t numValues, int numComps,
98 unsigned int targetTexture, unsigned int width, unsigned int height) = 0;
99
100protected:
103
105
106private:
108 void operator=(const vtkOpenGLTextureNormalizationHelper&) = delete;
109};
110
111VTK_ABI_NAMESPACE_END
112#endif // vtkOpenGLTextureNormalizationHelper_h
a simple class to control print indentation
Definition vtkIndent.h:108
OpenGL rendering window.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
~vtkOpenGLTextureNormalizationHelper() override=default
static vtkSmartPointer< vtkOpenGLTextureNormalizationHelper > Create(vtkOpenGLRenderWindow *context)
Create a helper instance appropriate for the given OpenGL context.
vtkAbstractTypeMacro(vtkOpenGLTextureNormalizationHelper, vtkObject)
ConversionMode GetConversionMode() const
Get the preferred conversion mode for this context.
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.
bool IsGPUConversionAvailable() const
Check if GPU-assisted conversion is available.
Hold a reference to a vtkObjectBase instance.
#define VTK_MARSHALAUTO