plugin  0.1.0
input_data.h
1 /*
2 // Copyright (C) 2020-2024 Intel Corporation
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 */
16 
17 #pragma once
18 #include <opencv2/opencv.hpp>
19 
20 struct InputData {
21  virtual ~InputData() {}
22 
23  template <class T>
24  T& asRef() {
25  return dynamic_cast<T&>(*this);
26  }
27 
28  template <class T>
29  const T& asRef() const {
30  return dynamic_cast<const T&>(*this);
31  }
32 };
33 
34 struct ImageInputData : public InputData {
35  cv::Mat inputImage;
36 
37  ImageInputData() {}
38  ImageInputData(const cv::Mat& img) {
39  inputImage = img;
40  }
41 };
Definition: input_data.h:34
Definition: input_data.h:20