Skip to main content

OptiViewJsonOutput.h File

OptiView JSON UDP sender helpers. More...

Included Headers

#include <cstdint> #include <memory> #include <string> #include <vector>

Namespaces Index

namespacesimaai
namespaceneat

Classes Index

structOptiViewObject
structOptiViewChannelOptions
classOptiViewJsonOutput

Description

OptiView JSON UDP sender helpers.

File Listing

The file content with the documentation metadata removed is:

1
6#pragma once
7
8#include <cstdint>
9#include <memory>
10#include <string>
11#include <vector>
12
13namespace simaai::neat {
14
16 int x = 0;
17 int y = 0;
18 int w = 0;
19 int h = 0;
20 float score = 0.0f;
21 int class_id = -1;
22};
23
25 std::string host = "127.0.0.1";
26 int channel = 0;
27 int video_port_base = 9000;
28 int json_port_base = 9100;
29};
30
31std::vector<std::string> OptiViewDefaultLabels();
32
33std::string OptiViewMakeJson(int64_t timestamp_ms, const std::string& frame_id,
34 const std::vector<OptiViewObject>& objects,
35 const std::vector<std::string>& labels);
36
38public:
39 explicit OptiViewJsonOutput(const OptiViewChannelOptions& opt, std::string* err = nullptr);
44 OptiViewJsonOutput& operator=(OptiViewJsonOutput&&) noexcept;
45
46 bool ok() const;
47 const std::string& host() const;
48 int json_port() const;
49 int video_port() const;
50
51 bool send_json(const std::string& payload, std::string* err = nullptr) const;
52
53 bool send_detection(int64_t timestamp_ms, const std::string& frame_id,
54 const std::vector<OptiViewObject>& objects,
55 const std::vector<std::string>& labels, std::string* err = nullptr) const;
56
57private:
58 struct Impl;
59 std::unique_ptr<Impl> impl_;
60};
61
62} // namespace simaai::neat

Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.1.