nx_metadata_sdk  1.0
Metadata SDK
rect.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/analytics/point.h>
6 
7 namespace nx {
8 namespace sdk {
9 namespace analytics {
10 
11 struct Rect
12 {
13  Rect() = default;
14 
15  Rect(float x, float y, float width, float height): x(x), y(y), width(width), height(height) {}
16 
17  Rect(Point topLeft, float width, float height):
18  x(topLeft.x), y(topLeft.y), width(width), height(height)
19  {
20  }
21 
25  float x = -1;
26 
30  float y = -1;
31 
36  float width = -1;
37 
42  float height = -1;
43 
49  Point center() const { return Point(x + width / 2, y + height / 2); }
50 };
51 
52 } // namespace analytics
53 } // namespace sdk
54 } // namespace nx
float x
Definition: rect.h:25
float y
Definition: point.h:23
float width
Definition: rect.h:36
float y
Definition: rect.h:30
Point center() const
Definition: rect.h:49
float height
Definition: rect.h:42
Definition: apple_utils.h:6
Definition: point.h:9
float x
Definition: point.h:18
Definition: rect.h:11