Logo
ApraPipes 1.0
Loading...
Searching...
No Matches
ROIMetadata.h
1#pragma once
2
3#include "FrameMetadata.h"
4#include "opencv2/opencv.hpp"
5
7{
8public:
10
11 static cv::Rect &deserialize(void *buffer)
12 {
13 return *(reinterpret_cast<cv::Rect *>(buffer));
14 }
15
16 static void copyROI(cv::Rect& roi, void* dst)
17 {
18 auto& dstROI = deserialize(dst);
19 dstROI.x = roi.x;
20 dstROI.y = roi.y;
21 dstROI.width = roi.width;
22 dstROI.height = roi.height;
23 }
24
25 static bool isValid(cv::Rect& roi)
26 {
27 return !(roi.x == 0 && roi.y == 0 && roi.width == 0 && roi.height == 0);
28 }
29
30 size_t getDataSize()
31 {
32 return 16;
33 }
34
35};
Definition FrameMetadata.h:10
FrameType
Definition FrameMetadata.h:29
@ ROI
Definition FrameMetadata.h:45
Definition ROIMetadata.h:7
static bool isValid(cv::Rect &roi)
Definition ROIMetadata.h:25
size_t getDataSize()
Definition ROIMetadata.h:30
static cv::Rect & deserialize(void *buffer)
Definition ROIMetadata.h:11
ROIMetadata()
Definition ROIMetadata.h:9
static void copyROI(cv::Rect &roi, void *dst)
Definition ROIMetadata.h:16