Medical Imaging Interaction Toolkit  2018.4.99-bb4bf944
Medical Imaging Interaction Toolkit
mitkMovieGenerator.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef MOVIEGENERATOR_H_HEADER_INCLUDED
14 
15 #define MOVIEGENERATOR_H_HEADER_INCLUDED
16 
18 #include "mitkBaseRenderer.h"
19 #include "mitkCommon.h"
20 #include "mitkStepper.h"
21 
22 namespace mitk
23 {
24  class MITKALGORITHMSEXT_EXPORT MovieGenerator : public itk::LightObject
25  {
26  public:
27  mitkClassMacroItkParent(MovieGenerator, itk::LightObject);
28 
29  // delivers Win32 or Linux-versions of MovieGenerator
30  static Pointer New(void);
31 
33  virtual void SetStepper(Stepper *stepper) { m_stepper = stepper; }
35  virtual void SetRenderer(BaseRenderer *renderer) { m_renderer = renderer; }
37  virtual void SetFileName(const char *fileName) { strcpy(m_fileName, fileName); }
39  virtual bool WriteMovie();
40 
42  // it adds a single frame to a movie each time the function is called
43  // Initialization is done with first function call; Renderer and Filename have to be set up properly before.
44  virtual bool WriteCurrentFrameToMovie();
46  virtual void ReleaseMovieWriter();
47 
48  virtual void SetFrameRate(unsigned int rate);
49 
50  unsigned int GetFrameRate();
51 
52  protected:
55 
57  virtual bool InitGenerator() = 0;
58 
60  virtual bool AddFrame(void *data) = 0;
61 
63  virtual bool TerminateGenerator() = 0;
64 
66  char m_fileName[1024];
67 
70 
73 
75  int m_width, m_height;
76 
78 
79  unsigned int m_FrameRate;
80  };
81 
82 } // namespace mitk
83 
84 #endif /* MOVIEGENERATOR_H_HEADER_INCLUDED */
virtual void SetFileName(const char *fileName)
filename under which movie is saved
Organizes the rendering process.
DataCollection - Class to facilitate loading/accessing structured data.
#define MITKALGORITHMSEXT_EXPORT
virtual void SetStepper(Stepper *stepper)
stepper used to control movie generation
#define mitkClassMacroItkParent(className, SuperClassName)
Definition: mitkCommon.h:49
Helper class to step through a list.
Definition: mitkStepper.h:47
Stepper * m_stepper
stores the used stepper
virtual void SetRenderer(BaseRenderer *renderer)
renderer to record
int m_width
InitGenerator() stores movie size in those variables.
BaseRenderer * m_renderer
stores the uses renderer