nx_server_plugin_sdk 1.0 Server Plugin SDK

object_track_title_packet.h
1 // Copyright 2018-present Network Optix, Inc. Licensed under MPL 2.0: www.mozilla.org/MPL/2.0/
2
3 #pragma once
4
5 #include <vector>
6
7 #include <nx/sdk/analytics/i_object_track_title_packet.h>
8 #include <nx/sdk/helpers/ref_countable.h>
9
10 namespace nx::sdk::analytics {
11
12 class ObjectTrackTitlePacket: public RefCountable<IObjectTrackTitlePacket>
13 {
14 public:
15 ObjectTrackTitlePacket(Uuid trackId = Uuid(),
16 int64_t timestampUs = -1,
17 Rect boundingBox = Rect(),
18 const std::string& text = "");
19
20 virtual int64_t timestampUs() const override;
21 virtual void getTrackId(Uuid* outValue) const override;
22 virtual void getBoundingBox(Rect* outValue) const override;
23 virtual const char* text() const override;
24 virtual const char* imageUrl() const override;
25 virtual const char* imageData() const override;
26 virtual int imageDataSize() const override;
27 virtual const char* imageDataFormat() const override;
28 virtual Flags flags() const override;
29
31 void setTrackId(const Uuid& trackId);
32
34 void setTimestampUs(int64_t timestampUs);
35
37 void setBoundingBox(const Rect& boundingBox);
38
40 void setText(std::string text);
41
43 void setImageUrl(std::string imageUrl);
44
46 void setImageData(std::vector<char> imageData);
47
49 void setImageDataFormat(std::string imageDataFormat);
50
55 void setImage(std::string imageDataFormat, std::vector<char> imageData);
56
58 void setFlags(Flags flags);
59
64 Rect boundingBox() const { Rect value; getBoundingBox(&value); return value; }
65
66 private:
67 Uuid m_trackId;
68 Flags m_flags = Flags::none;
69 int64_t m_timestampUs = 0;
70 Rect m_boundingBox;
71 std::string m_text;
72
73 std::string m_imageUrl;
74 std::vector<char> m_imageData;
75 std::string m_imageDataFormat;
76 };
77
78 } // namespace nx::sdk::analytics
nx::sdk::analytics::ObjectTrackTitlePacket::setText
void setText(std::string text)
Definition: object_track_title_packet.cpp:89
nx::sdk::analytics::ObjectTrackTitlePacket::setImageData
void setImageData(std::vector< char > imageData)
Definition: object_track_title_packet.cpp:104
nx::sdk::analytics::ObjectTrackTitlePacket::setImageDataFormat
void setImageDataFormat(std::string imageDataFormat)
Definition: object_track_title_packet.cpp:99
nx::sdk::analytics::ObjectTrackTitlePacket
Definition: object_track_title_packet.h:12
nx::sdk::analytics::ObjectTrackTitlePacket::setBoundingBox
void setBoundingBox(const Rect &boundingBox)
Definition: object_track_title_packet.cpp:79
nx::sdk::analytics
Definition: consuming_device_agent.cpp:25
nx::sdk::analytics::ObjectTrackTitlePacket::setImageUrl
void setImageUrl(std::string imageUrl)
Definition: object_track_title_packet.cpp:94
nx::sdk::Uuid
Definition: uuid.h:22
nx::sdk::analytics::ObjectTrackTitlePacket::boundingBox
Rect boundingBox() const
Definition: object_track_title_packet.h:64
nx::sdk::analytics::ObjectTrackTitlePacket::setImage
void setImage(std::string imageDataFormat, std::vector< char > imageData)
Definition: object_track_title_packet.cpp:109
nx::sdk::analytics::ObjectTrackTitlePacket::setFlags
void setFlags(Flags flags)
Definition: object_track_title_packet.cpp:69
nx::sdk::analytics::ObjectTrackTitlePacket::setTrackId
void setTrackId(const Uuid &trackId)
Definition: object_track_title_packet.cpp:84
nx::sdk::analytics::ObjectTrackTitlePacket::setTimestampUs
void setTimestampUs(int64_t timestampUs)
Definition: object_track_title_packet.cpp:74
nx::sdk::RefCountable
Definition: ref_countable.h:83
nx::sdk::analytics::Rect
Definition: rect.h:9