Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Tetragramm
GitHub Repository: Tetragramm/opencv
Path: blob/master/modules/gapi/src/backends/cpu/gcpukernel.cpp
16344 views
1
// This file is part of OpenCV project.
2
// It is subject to the license terms in the LICENSE file found in the top-level directory
3
// of this distribution and at http://opencv.org/license.html.
4
//
5
// Copyright (C) 2018 Intel Corporation
6
7
8
#include "precomp.hpp"
9
10
#include <cassert>
11
12
#include "opencv2/gapi/cpu/gcpukernel.hpp"
13
14
const cv::gapi::own::Mat& cv::GCPUContext::inMat(int input)
15
{
16
return inArg<cv::gapi::own::Mat>(input);
17
}
18
19
cv::gapi::own::Mat& cv::GCPUContext::outMatR(int output)
20
{
21
return *util::get<cv::gapi::own::Mat*>(m_results.at(output));
22
}
23
24
const cv::gapi::own::Scalar& cv::GCPUContext::inVal(int input)
25
{
26
return inArg<cv::gapi::own::Scalar>(input);
27
}
28
29
cv::gapi::own::Scalar& cv::GCPUContext::outValR(int output)
30
{
31
return *util::get<cv::gapi::own::Scalar*>(m_results.at(output));
32
}
33
34
cv::detail::VectorRef& cv::GCPUContext::outVecRef(int output)
35
{
36
return util::get<cv::detail::VectorRef>(m_results.at(output));
37
}
38
39
cv::GCPUKernel::GCPUKernel()
40
{
41
}
42
43
cv::GCPUKernel::GCPUKernel(const GCPUKernel::F &f)
44
: m_f(f)
45
{
46
}
47
48
void cv::GCPUKernel::apply(GCPUContext &ctx)
49
{
50
GAPI_Assert(m_f);
51
m_f(ctx);
52
}
53
54