32 #define GL_BGR GL_BGR_EXT
36 : m_stepper(NULL), m_renderer(NULL), m_width(0), m_height(0), m_initialized(false), m_FrameRate(20)
44 MovieGenerator *rawPtr = ::itk::ObjectFactory<MovieGenerator>::Create();
68 m_renderer->GetRenderWindow()->MakeCurrent();
78 int imgSize = 3 * m_width * m_height;
79 printf(
"Video size = %i x %i\n", m_width, m_height);
80 GLbyte *data =
new GLbyte[imgSize];
83 unsigned int numOfSteps = m_stepper->GetSteps();
84 if (m_stepper->GetPingPong())
87 for (
unsigned int i = 0; i < numOfSteps; i++)
90 m_renderer->GetRenderWindow()->MakeCurrent();
92 glReadPixels(5, 5, m_width, m_height,
GL_BGR, GL_UNSIGNED_BYTE, (
void *)data);
96 ok = TerminateGenerator();
106 m_renderer->GetRenderWindow()->MakeCurrent();
111 m_initialized = InitGenerator();
115 TerminateGenerator();
118 int imgSize = 3 * m_width * m_height;
119 GLbyte *data =
new GLbyte[imgSize];
122 glReadPixels(5, 5, m_width, m_height,
GL_BGR, GL_UNSIGNED_BYTE, (
void *)data);
131 TerminateGenerator();
132 m_initialized =
false;
itk::SmartPointer< Self > Pointer
virtual void ReleaseMovieWriter()
releases a movie writer after usage of WriteCurrentFrameToMovie()
char m_fileName[1024]
stores the movie filename
virtual bool WriteMovie()
uses given stepper and filename to create a movie from the active OpenGL context
virtual void SetFrameRate(unsigned int rate)
MovieGenerator()
default constructor
static RenderingManager * GetInstance()
void ForceImmediateUpdate(vtkRenderWindow *renderWindow)
virtual bool WriteCurrentFrameToMovie()
alternative way, which does not use a stepper;
unsigned int GetFrameRate()