Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkMovieGeneratorOpenCV.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,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef MovieGeneratorOpenCV_H_HEADER_INCLUDED
18 #define MovieGeneratorOpenCV_H_HEADER_INCLUDED
19 
20 #include "mitkMovieGenerator.h"
21 #include <MitkOpenCVVideoSupportExports.h>
22 #include <memory.h>
23 #include <string.h>
24 
25 // OpenCV includes
26 #include "cv.h"
27 #include "highgui.h"
28 
29 
30 namespace mitk {
31 
32 
33 class MITKOPENCVVIDEOSUPPORT_EXPORT MovieGeneratorOpenCV : public MovieGenerator
34 {
35 
36 public:
37 
39  itkFactorylessNewMacro(Self)
40  itkCloneMacro(Self)
41 
42  virtual void SetFileName( const char *fileName ) override;
43 
44  void SetFourCCCodec(char* codec)
45  {
46  m_FourCCCodec = codec;
47  }
48 
49  virtual void SetFrameRate(int rate);
50 
56  void SetRemoveColouredFrame(bool);
57 protected:
58 
60 
62  virtual bool InitGenerator() override;
63 
65  virtual bool AddFrame( void *data ) override;
66 
68  virtual bool TerminateGenerator() override;
69 
71  std::string m_sFile;
72 
74  int m_dwRate;
75 
76 
77 private:
78 
79  CvVideoWriter* m_aviWriter;
80  IplImage * m_currentFrame;
81 
82  char * m_FourCCCodec;
83 
85  long m_lFrame;
86 
87  bool m_RemoveColouredFrame;
88 };
89 
90 } // namespace mitk
91 
92 #endif /* MovieGeneratorOpenCV_H_HEADER_INCLUDED */
DataCollection - Class to facilitate loading/accessing structured data.
std::string m_sFile
name of output file
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:44