Medical Imaging Interaction Toolkit  2023.04.00
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 (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 mitkMovieGeneratorOpenCV_h
14 #define mitkMovieGeneratorOpenCV_h
15 
16 #include "mitkMovieGenerator.h"
17 #include <MitkOpenCVVideoSupportExports.h>
18 #include <memory.h>
19 #include <cstring>
20 
21 // OpenCV includes
22 #include <opencv2/core/types_c.h>
23 #include <opencv2/videoio.hpp>
24 
25 
26 namespace mitk {
27 
28 
29 class MITKOPENCVVIDEOSUPPORT_EXPORT MovieGeneratorOpenCV : public MovieGenerator
30 {
31 
32 public:
33 
35  itkFactorylessNewMacro(Self);
36  itkCloneMacro(Self);
37 
38  void SetFileName( const char *fileName ) override;
39 
40  void SetFourCCCodec(char* codec)
41  {
42  m_FourCCCodec = codec;
43  }
44 
45  void SetFrameRate(unsigned int rate) override;
46 
52  void SetRemoveColouredFrame(bool);
53 protected:
54 
56 
58  bool InitGenerator() override;
59 
61  bool AddFrame( void *data ) override;
62 
64  bool TerminateGenerator() override;
65 
67  std::string m_sFile;
68 
70  int m_dwRate;
71 
72 
73 private:
74 
75  CvVideoWriter* m_aviWriter;
76  IplImage * m_currentFrame;
77 
78  char * m_FourCCCodec;
79 
80  bool m_RemoveColouredFrame;
81 };
82 
83 } // namespace mitk
84 
85 #endif
mitk::MovieGeneratorOpenCV::SetFourCCCodec
void SetFourCCCodec(char *codec)
Definition: mitkMovieGeneratorOpenCV.h:40
mitk::MovieGeneratorOpenCV::m_sFile
std::string m_sFile
name of output file
Definition: mitkMovieGeneratorOpenCV.h:67
mitkMovieGenerator.h
mitk::MovieGeneratorOpenCV
Definition: mitkMovieGeneratorOpenCV.h:29
mitk
DataCollection - Class to facilitate loading/accessing structured data.
Definition: RenderingTests.dox:1
mitkClassMacro
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:36
mitk::MovieGenerator
Definition: mitkMovieGenerator.h:23
mitk::MovieGeneratorOpenCV::m_dwRate
int m_dwRate
frame rate
Definition: mitkMovieGeneratorOpenCV.h:70