nx_server_plugin_sdk 1.0 Server Plugin SDK

object_track_best_shot_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_best_shot_packet.h>
8 #include <nx/sdk/helpers/attribute.h>
9 #include <nx/sdk/helpers/ref_countable.h>
10
11 namespace nx::sdk::analytics {
12
13 class ObjectTrackBestShotPacket: public RefCountable<IObjectTrackBestShotPacket>
14 {
15 public:
16 ObjectTrackBestShotPacket(
17 Uuid trackId = Uuid(),
18 int64_t timestampUs = -1,
19 Rect boundingBox = Rect());
20
21 virtual int64_t timestampUs() const override;
22 virtual void getTrackId(Uuid* outValue) const override;
23 virtual void getBoundingBox(Rect* outValue) 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 const IAttribute* getAttribute(int index) const override;
29 virtual int attributeCount() const override;
30 virtual Flags flags() const override;
31
33 void setTrackId(const Uuid& trackId);
34
36 void setTimestampUs(int64_t timestampUs);
37
39 void setBoundingBox(const Rect& boundingBox);
40
42 void setImageUrl(std::string imageUrl);
43
45 void setImageData(std::vector<char> imageData);
46
48 void setImageDataFormat(std::string imageDataFormat);
49
54 void setImage(std::string imageDataFormat, std::vector<char> imageData);
55
56 void addAttribute(Ptr<Attribute> attribute);
57 void addAttributes(const std::vector<Ptr<Attribute>>& value);
58
60 void setFlags(Flags flags);
61
62 private:
63 Uuid m_trackId;
64 Flags m_flags = Flags::none;
65 int64_t m_timestampUs = 0;
66 Rect m_boundingBox;
67
68 std::string m_imageUrl;
69 std::vector<char> m_imageData;
70 std::string m_imageDataFormat;
71
72 std::vector<Ptr<Attribute>> m_attributes;
73 };
74
75 } // namespace nx::sdk::analytics
nx::sdk::Ptr
Definition: ptr.h:18
nx::sdk::analytics::ObjectTrackBestShotPacket::setImage
void setImage(std::string imageDataFormat, std::vector< char > imageData)
Definition: object_track_best_shot_packet.cpp:97
nx::sdk::analytics::ObjectTrackBestShotPacket::setImageDataFormat
void setImageDataFormat(std::string imageDataFormat)
Definition: object_track_best_shot_packet.cpp:87
nx::sdk::analytics
Definition: consuming_device_agent.cpp:25
nx::sdk::Uuid
Definition: uuid.h:22
nx::sdk::IAttribute
Definition: i_attribute.h:9
nx::sdk::analytics::ObjectTrackBestShotPacket
Definition: object_track_best_shot_packet.h:13
nx::sdk::analytics::ObjectTrackBestShotPacket::setTrackId
void setTrackId(const Uuid &trackId)
Definition: object_track_best_shot_packet.cpp:62
nx::sdk::analytics::ObjectTrackBestShotPacket::setImageData
void setImageData(std::vector< char > imageData)
Definition: object_track_best_shot_packet.cpp:92
nx::sdk::analytics::ObjectTrackBestShotPacket::setBoundingBox
void setBoundingBox(const Rect &boundingBox)
Definition: object_track_best_shot_packet.cpp:77
nx::sdk::analytics::ObjectTrackBestShotPacket::setImageUrl
void setImageUrl(std::string imageUrl)
Definition: object_track_best_shot_packet.cpp:82
nx::sdk::RefCountable
Definition: ref_countable.h:83
nx::sdk::analytics::ObjectTrackBestShotPacket::setFlags
void setFlags(Flags flags)
Definition: object_track_best_shot_packet.cpp:67
nx::sdk::analytics::Rect
Definition: rect.h:9
nx::sdk::analytics::ObjectTrackBestShotPacket::setTimestampUs
void setTimestampUs(int64_t timestampUs)
Definition: object_track_best_shot_packet.cpp:72