VTK  9.3.1
vtkOpenGLMovieSphere.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 vtkOpenGLMovieSphere_h
24 #define vtkOpenGLMovieSphere_h
25 
26 #include "vtkNew.h" // for ivars
27 #include "vtkOpenGLSkybox.h"
28 #include "vtkRenderingFFMPEGOpenGL2Module.h" // For export macro
29 #include "vtkSmartPointer.h" // for ivars
30 #include <atomic> // for ivars
31 #include <mutex> // for ivars
32 
33 VTK_ABI_NAMESPACE_BEGIN
36 class vtkMutexLock;
37 class vtkOpenGLActor;
39 class vtkTextureObject;
40 
41 class VTKRENDERINGFFMPEGOPENGL2_EXPORT vtkOpenGLMovieSphere : public vtkOpenGLSkybox
42 {
43 public:
44  static vtkOpenGLMovieSphere* New();
46  void PrintSelf(ostream& os, vtkIndent indent) override;
47 
51  void Render(vtkRenderer* ren, vtkMapper* mapper) override;
52 
53  void SetVideoSource(vtkFFMPEGVideoSource* val);
54  vtkFFMPEGVideoSource* GetVideoSource();
55 
56 protected:
58  ~vtkOpenGLMovieSphere() override;
59 
60  void UpdateUniforms(vtkObject*, unsigned long, void*);
61 
64  int DrawIndex;
65  int YTexture;
66  int UTexture;
67  int VTexture;
68 
69  void VideoCallback(vtkFFMPEGVideoSourceVideoCallbackData const& cbd);
70 
71  std::mutex TextureUpdateMutex;
72  unsigned char* TextureData[6];
73  int ReadIndex; // access only within mutex
75 
76  std::atomic<int> NewData;
77  std::atomic<int> HaveData;
78 
79  int Height;
80  int Width;
81  int UVHeight;
82  int UVWidth;
84 
85 private:
87  void operator=(const vtkOpenGLMovieSphere&) = delete;
88 };
89 
90 VTK_ABI_NAMESPACE_END
91 #endif
PolyDataMapper using OpenGL to render.
abstract base class for most VTK objects
Definition: vtkObject.h:51
OpenGL MovieSphere, an optimized VR sphere for movies.
abstract specification for renderers
Definition: vtkRenderer.h:61
void UpdateUniforms(vtkObject *, unsigned long, void *)
void Render(vtkRenderer *ren, vtkMapper *mapper) override
Actual Skybox render method.
vtkSmartPointer< vtkFFMPEGVideoSource > VideoSource
std::atomic< int > NewData
OpenGL actor.
a simple class to control print indentation
Definition: vtkIndent.h:28
Reader for ffmpeg supported formats.
OpenGL Skybox.
abstract class specifies interface to map data to graphics primitives
Definition: vtkMapper.h:76
abstracts an OpenGL texture object.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static vtkOpenGLSkybox * New()
std::atomic< int > HaveData