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/helpers/attribute.h>
8 #include <nx/sdk/helpers/ref_countable.h>
9 #include <nx/sdk/analytics/i_object_track_best_shot_packet.h>
10
11 namespace nx {
12 namespace sdk {
13 namespace analytics {
14
15 class ObjectTrackBestShotPacket: public RefCountable<IObjectTrackBestShotPacket>
16 {
17 public:
18 ObjectTrackBestShotPacket(Uuid trackId = Uuid(), int64_t timestampUs = -1, Rect boundingBox = Rect());
19
20 virtual Flags flags() const override;
21 virtual int64_t timestampUs() const override;
22
23 virtual const char* imageUrl() const override;
24 virtual const char* imageData() const override;
25 virtual int imageDataSize() const override;
26 virtual const char* imageDataFormat() const override;
27
29 void setTrackId(const Uuid& trackId);
30
32 void setFlags(Flags flags);
33
35 void setTimestampUs(int64_t timestampUs);
36
38 void setBoundingBox(const Rect& boundingBox);
39
41 void setImageUrl(std::string imageUrl);
42
44 void setImageData(std::vector<char> imageData);
45
47 void setImageDataFormat(std::string imageDataFormat);
48
53 void setImage(std::string imageDataFormat, std::vector<char> imageData);
54
55 protected:
56 virtual const IAttribute* getAttribute(int index) const override;
57
58 public:
59 virtual int attributeCount() const override;
60
61 void addAttribute(Ptr<Attribute> attribute);
62 void addAttributes(const std::vector<Ptr<Attribute>>& value);
63
64 protected:
65 virtual void getTrackId(Uuid* outValue) const override;
66 virtual void getBoundingBox(Rect* outValue) const override;
67
68 private:
69 Uuid m_trackId;
70 Flags m_flags = Flags::none;
71 int64_t m_timestampUs = -1;
72 Rect m_boundingBox;
73
74 std::string m_imageUrl;
75 std::vector<char> m_imageData;
76 std::string m_imageDataFormat;
77
78 std::vector<Ptr<Attribute>> m_attributes;
79 };
80
81 } // namespace analytics
82 } // namespace sdk
83 } // namespace nx
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:99
nx::sdk::analytics::ObjectTrackBestShotPacket::setImageDataFormat
void setImageDataFormat(std::string imageDataFormat)
Definition: object_track_best_shot_packet.cpp:89
nx::sdk::Uuid
Definition: uuid.h:22
nx::sdk::IAttribute
Definition: i_attribute.h:10
nx::sdk::analytics::ObjectTrackBestShotPacket
Definition: object_track_best_shot_packet.h:15
nx::sdk::analytics::ObjectTrackBestShotPacket::setTrackId
void setTrackId(const Uuid &trackId)
Definition: object_track_best_shot_packet.cpp:64
nx
Definition: apple_utils.h:6
nx::sdk::analytics::ObjectTrackBestShotPacket::setImageData
void setImageData(std::vector< char > imageData)
Definition: object_track_best_shot_packet.cpp:94
nx::sdk::analytics::ObjectTrackBestShotPacket::setBoundingBox
void setBoundingBox(const Rect &boundingBox)
Definition: object_track_best_shot_packet.cpp:79
nx::sdk::analytics::ObjectTrackBestShotPacket::setImageUrl
void setImageUrl(std::string imageUrl)
Definition: object_track_best_shot_packet.cpp:84
nx::sdk::RefCountable
Definition: ref_countable.h:84
nx::sdk::analytics::ObjectTrackBestShotPacket::setFlags
void setFlags(Flags flags)
Definition: object_track_best_shot_packet.cpp:69
nx::sdk::analytics::Rect
Definition: rect.h:11
nx::sdk::analytics::ObjectTrackBestShotPacket::setTimestampUs
void setTimestampUs(int64_t timestampUs)
Definition: object_track_best_shot_packet.cpp:74