SmartSpectra C++ SDK
Measure human vitals from video with SmartSpectra C++ SDK.
Loading...
Searching...
No Matches
background_container.hpp
1
2// background_container.h
3// Created by Greg on 4/29/2024.
4// Copyright (C) 2024 Presage Security, Inc.
5//
6// This program is free software; you can redistribute it and/or
7// modify it under the terms of the GNU Lesser General Public
8// License as published by the Free Software Foundation; either
9// version 3 of the License, or (at your option) any later version.
10//
11// This program is distributed in the hope that it will be useful,
12// but WITHOUT ANY WARRANTY; without even the implied warranty of
13// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14// Lesser General Public License for more details.
15//
16// You should have received a copy of the GNU Lesser General Public License
17// along with this program; if not, write to the Free Software Foundation,
18// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20
21#pragma once
22// === standard library includes (if any) ===
23// === third-party includes (if any) ===
24#include <mediapipe/framework/port/opencv_core_inc.h>
25// === local includes (if any) ===
26#include "container.hpp"
27
28
30
31template<
32 platform_independence::DeviceType TDeviceType,
33 settings::OperationMode TOperationMode,
34 settings::IntegrationMode TIntegrationMode
35>
40class BackgroundContainer : public Container<TDeviceType, TOperationMode, TIntegrationMode> {
41public:
44
46 explicit BackgroundContainer(SettingsType settings);
47
49 bool GraphIsRunning() const;
50 bool ContainerIsInitialized() const { return this->initialized; };
51
53 absl::Status Initialize() override;
54
56 absl::Status StartGraph();
57
59 absl::Status WaitUntilGraphIsIdle();
60
62 absl::Status SetRecording(bool on);
63
65 absl::Status AddFrameWithTimestamp(const cv::Mat& frame_rgb, int64_t frame_timestamp_μs);
66
68 physiology::StatusCode GetStatusCode() const { return previous_status_code; };
69
71 absl::Status StopGraph();
72
73private:
74 physiology::StatusCode previous_status_code = physiology::StatusCode::PROCESSING_NOT_STARTED;
75};
76
80
81template<platform_independence::DeviceType TDeviceType>
83
84} // namespace presage::smartspectra::container
Container for background thread processing.
Definition background_container.hpp:40
absl::Status StartGraph()
Definition background_container_impl.hpp:71
absl::Status AddFrameWithTimestamp(const cv::Mat &frame_rgb, int64_t frame_timestamp_μs)
Definition background_container_impl.hpp:209
absl::Status WaitUntilGraphIsIdle()
Definition background_container_impl.hpp:173
BackgroundContainer(SettingsType settings)
Definition background_container_impl.hpp:39
absl::Status Initialize() override
Definition background_container_impl.hpp:48
absl::Status SetRecording(bool on)
Definition background_container_impl.hpp:185
physiology::StatusCode GetStatusCode() const
Definition background_container.hpp:68
absl::Status StopGraph()
Definition background_container_impl.hpp:244
bool GraphIsRunning() const
Definition background_container_impl.hpp:43
Container(SettingsType settings)
Definition container_impl.hpp:52
Definition background_container.cpp:10