CustusX  22.04-rc5
An IGT application
cxVideoRecorder.h
Go to the documentation of this file.
1 /*=========================================================================
2 This file is part of CustusX, an Image Guided Therapy Application.
3 
4 Copyright (c) SINTEF Department of Medical Technology.
5 All rights reserved.
6 
7 CustusX is released under a BSD 3-Clause license.
8 
9 See Lisence.txt (https://github.com/SINTEFMedtek/CustusX/blob/master/License.txt) for details.
10 =========================================================================*/
11 
12 
13 /*
14  * sscVideoRecorder.h
15  *
16  * Created on: Dec 17, 2010
17  * Author: christiana
18  */
19 
20 #ifndef CXVIDEORECORDER_H_
21 #define CXVIDEORECORDER_H_
22 
23 #include "cxResourceExport.h"
24 
25 #include "vtkSmartPointer.h"
26 #include <boost/shared_ptr.hpp>
27 #include <QObject>
28 #include <QDateTime>
29 #include "cxVideoSource.h"
30 #include <map>
31 
32 typedef vtkSmartPointer<class vtkImageData> vtkImageDataPtr;
33 
34 namespace cx
35 {
36 
46 class cxResource_EXPORT VideoRecorder : public QObject
47 {
48  Q_OBJECT
49 public:
50  typedef std::map<double, vtkImageDataPtr> DataType;
51 public:
52  VideoRecorder(VideoSourcePtr source, bool sync = true);
53  virtual ~VideoRecorder();
54 
55  virtual void startRecord();
56  virtual void stopRecord();
57  virtual DataType getRecording(double start, double stop);
58 
59  private slots:
60  void newFrameSlot();
61 private:
62  DataType mData;
63  VideoSourcePtr mSource;
64 
65  bool mSynced;
66  double mSyncShift;
67 };
68 
69 typedef boost::shared_ptr<VideoRecorder> VideoRecorderPtr;
70 
71 }
72 
73 #endif /* CXVIDEORECORDER_H_ */
vtkSmartPointer< class vtkImageData > vtkImageDataPtr
std::map< double, vtkImageDataPtr > DataType
<timestamp, frame>
boost::shared_ptr< class VideoSource > VideoSourcePtr
Recorder for a VideoSource.
boost::shared_ptr< VideoRecorder > VideoRecorderPtr
Namespace for all CustusX production code.