Open3D (C++ API)
AzureKinectRecorder.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - Open3D: www.open3d.org -
3 // ----------------------------------------------------------------------------
4 // The MIT License (MIT)
5 //
6 // Copyright (c) 2019 www.open3d.org
7 //
8 // Permission is hereby granted, free of charge, to any person obtaining a copy
9 // of this software and associated documentation files (the "Software"), to deal
10 // in the Software without restriction, including without limitation the rights
11 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 // copies of the Software, and to permit persons to whom the Software is
13 // furnished to do so, subject to the following conditions:
14 //
15 // The above copyright notice and this permission notice shall be included in
16 // all copies or substantial portions of the Software.
17 //
18 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
24 // IN THE SOFTWARE.
25 // ----------------------------------------------------------------------------
26 
27 #pragma once
28 
29 #include <atomic>
30 #include <memory>
31 #include <string>
32 
36 
37 struct _k4a_record_t; // typedef _k4a_record_t* k4a_record_t;
38 
39 namespace open3d {
40 
41 namespace geometry {
42 class RGBDImage;
43 class Image;
44 } // namespace geometry
45 
46 namespace io {
47 
52 public:
53  AzureKinectRecorder(const AzureKinectSensorConfig& sensor_config,
54  size_t sensor_index);
55  ~AzureKinectRecorder() override;
56 
58  bool InitSensor() override;
62  bool OpenRecord(const std::string& filename) override;
64  bool CloseRecord() override;
70  std::shared_ptr<geometry::RGBDImage> RecordFrame(
71  bool write, bool enable_align_depth_to_color) override;
72 
74  bool IsRecordCreated() { return is_record_created_; }
75 
76 protected:
78  _k4a_record_t* recording_;
79  size_t device_index_;
80 
81  bool is_record_created_ = false;
82 };
83 
84 } // namespace io
85 } // namespace open3d
Definition: AzureKinectRecorder.h:51
Definition: AzureKinectSensorConfig.h:45
bool IsRecordCreated()
Check if the mkv file is created.
Definition: AzureKinectRecorder.h:74
Definition: RGBDRecorder.h:34
AzureKinectSensor sensor_
Definition: AzureKinectRecorder.h:77
_k4a_record_t * recording_
Definition: AzureKinectRecorder.h:78
Definition: AzureKinectSensor.h:53
Definition: Open3DViewer.h:29
size_t device_index_
Definition: AzureKinectRecorder.h:79