nx_metadata_sdk 1.0 Metadata SDK

i_uncompressed_video_frame.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 <nx/sdk/interface.h>
6
7 #include <nx/sdk/i_list.h>
8 #include <nx/sdk/analytics/i_metadata_packet.h>
9 #include <nx/sdk/analytics/i_uncompressed_media_frame.h>
10
11 namespace nx {
12 namespace sdk {
13 namespace analytics {
14
15 class IUncompressedVideoFrame0:
16 public Interface<IUncompressedVideoFrame0, IUncompressedMediaFrame0>
17 {
18 public:
19 static auto interfaceId() { return makeId("nx::sdk::analytics::IUncompressedVideoFrame"); }
20
21 enum class PixelFormat: int
22 {
23 yuv420,
24 argb,
25 abgr,
26 rgba,
27 bgra,
28 rgb,
29 bgr,
30 count
31 };
32
33 struct PixelAspectRatio
34 {
35 int numerator;
36 int denominator;
37 };
38
42 virtual int width() const = 0;
43
47 virtual int height() const = 0;
48
50 protected: virtual void getPixelAspectRatio(PixelAspectRatio* outValue) const = 0;
54 public: PixelAspectRatio pixelAspectRatio() const
55 {
56 PixelAspectRatio value;
57 getPixelAspectRatio(&value);
58 return value;
59 }
60
61 virtual PixelFormat pixelFormat() const = 0;
62
67 virtual int lineSize(int plane) const = 0;
68 };
69
73 class IUncompressedVideoFrame: public Interface<IUncompressedVideoFrame, IUncompressedVideoFrame0>
74 {
75 public:
76 static auto interfaceId() { return makeId("nx::sdk::analytics::IUncompressedVideoFrame1"); }
77
79 protected: virtual IList<IMetadataPacket>* getMetadataList() const = 0;
80 public: Ptr<IList<IMetadataPacket>> metadataList() const
81 {
82 return toPtr(getMetadataList());
83 }
84 };
85 using IUncompressedVideoFrame1 = IUncompressedVideoFrame;
86
87 } // namespace analytics
88 } // namespace sdk
89 } // namespace nx
nx::sdk::analytics::IUncompressedVideoFrame0::getPixelAspectRatio
virtual void getPixelAspectRatio(PixelAspectRatio *outValue) const =0
nx::sdk::analytics::IUncompressedVideoFrame0::lineSize
virtual int lineSize(int plane) const =0
nx::sdk::Interface
Definition: interface.h:49
nx::sdk::analytics::IUncompressedVideoFrame0::pixelAspectRatio
PixelAspectRatio pixelAspectRatio() const
Definition: i_uncompressed_video_frame.h:54
nx::sdk::Ptr
Definition: ptr.h:18
nx::sdk::analytics::IUncompressedVideoFrame0::height
virtual int height() const =0
nx
Definition: apple_utils.h:6
nx::sdk::analytics::IUncompressedVideoFrame0::width
virtual int width() const =0
nx::sdk::analytics::IUncompressedVideoFrame0
Definition: i_uncompressed_video_frame.h:15
nx::sdk::analytics::IUncompressedVideoFrame
Definition: i_uncompressed_video_frame.h:73
nx::sdk::analytics::IUncompressedVideoFrame::getMetadataList
virtual IList< IMetadataPacket > * getMetadataList() const =0
nx::sdk::IList
Definition: i_list.h:9
nx::sdk::analytics::IUncompressedVideoFrame0::PixelAspectRatio
Definition: i_uncompressed_video_frame.h:33