nx_metadata_sdk 1.0 Metadata 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(Uuid trackId = Uuid(), int64_t timestampUs = -1, Rect boundingBox = Rect());
17
18 virtual Flags flags() const override;
19 virtual int64_t timestampUs() const override;
20
21 virtual const char* imageUrl() const override;
22 virtual const char* imageData() const override;
23 virtual int imageDataSize() const override;
24 virtual const char* imageDataFormat() const override;
25
27 void setTrackId(const Uuid& trackId);
28
30 void setFlags(Flags flags);
31
33 void setTimestampUs(int64_t timestampUs);
34
36 void setBoundingBox(const Rect& boundingBox);
37
39 void setImageUrl(std::string imageUrl);
40
42 void setImageData(std::vector<char> imageData);
43
45 void setImageDataFormat(std::string imageDataFormat);
46
51 void setImage(std::string imageDataFormat, std::vector<char> imageData);
52
53 protected:
54 virtual const IAttribute* getAttribute(int index) const override;
55
56 public:
57 virtual int attributeCount() const override;
58
59 void addAttribute(Ptr<Attribute> attribute);
60 void addAttributes(const std::vector<Ptr<Attribute>>& value);
61
62 protected:
63 virtual void getTrackId(Uuid* outValue) const override;
64 virtual void getBoundingBox(Rect* outValue) const override;
65
66 private:
67 Uuid m_trackId;
68 Flags m_flags = Flags::none;
69 int64_t m_timestampUs = -1;
70 Rect m_boundingBox;
71
72 std::string m_imageUrl;
73 std::vector<char> m_imageData;
74 std::string m_imageDataFormat;
75
76 std::vector<Ptr<Attribute>> m_attributes;
77 };
78
79 } // 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:24
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