SmartSpectra C++ SDK
Measure human vitals from video with SmartSpectra C++ SDK.
Loading...
Searching...
No Matches
opencv_label.hpp
1//
2// Created by greg on 6/17/25.
3// Copyright (c) 2025 Presage Technologies
4//
5// SPDX-License-Identifier: LGPL-3.0-or-later
6
7#pragma once
8// === standard library includes (if any) ===
9#include <string>
10// === third-party includes (if any) ===
11#include <opencv2/imgproc.hpp>
12#include <absl/status/status.h>
13// === local includes (if any) ===
14
15namespace presage::smartspectra::gui {
16
17class OpenCvLabel {
18public:
19 OpenCvLabel(int x, int y, int width, int height, std::string default_text = "", int character_count = 10);
20 ~OpenCvLabel() = default;
21 absl::Status Render(cv::Mat& image, const std::string& text, cv::Scalar color) const;
22 absl::Status Render(cv::Mat& image, cv::Scalar color) const;
23private:
24 cv::Rect2i label_area;
25 double font_scale;
26 cv::Point2i text_origin;
27 const int font_face = cv::FONT_HERSHEY_DUPLEX;
28 std::string default_text;
29};
30
31} // namespace presage::smartspectra::gui