Download include/opencv2/gapi/gtransform.hpp from dlxjj/opencv: direct link, hf CLI and curl.
- Browser
- Download file 3.52 kB
-
https://huggingface.co/datasets/dlxjj/opencv/resolve/main/include/opencv2/gapi/gtransform.hpp
- Command line
-
hf download hf://datasets/dlxjj/opencv/include/opencv2/gapi/gtransform.hpp
-
curl -L -o gtransform.hpp https://huggingface.co/datasets/dlxjj/opencv/resolve/main/include/opencv2/gapi/gtransform.hpp
3.52 kB
| // This file is part of OpenCV project. | |
| // It is subject to the license terms in the LICENSE file found in the top-level directory | |
| // of this distribution and at http://opencv.org/license.html. | |
| // | |
| // Copyright (C) 2019 Intel Corporation | |
| namespace cv | |
| { | |
| struct GAPI_EXPORTS GTransform | |
| { | |
| // FIXME: consider another simplified | |
| // class instead of GComputation | |
| using F = std::function<GComputation()>; | |
| std::string description; | |
| F pattern; | |
| F substitute; | |
| GTransform(const std::string& d, const F &p, const F &s) : description(d), pattern(p), substitute(s) {} | |
| }; | |
| namespace detail | |
| { | |
| template <typename, typename, typename> | |
| struct TransHelper; | |
| template <typename K, typename... Ins, typename Out> | |
| struct TransHelper<K, std::tuple<Ins...>, Out> | |
| { | |
| template <typename Callable, int... IIs, int... OIs> | |
| static GComputation invoke(Callable f, Seq<IIs...>, Seq<OIs...>) | |
| { | |
| const std::tuple<Ins...> ins; | |
| const auto r = tuple_wrap_helper<Out>::get(f(std::get<IIs>(ins)...)); | |
| return GComputation(cv::GIn(std::get<IIs>(ins)...), | |
| cv::GOut(std::get<OIs>(r)...)); | |
| } | |
| static GComputation get_pattern() | |
| { | |
| return invoke(K::pattern, typename MkSeq<sizeof...(Ins)>::type(), | |
| typename MkSeq<std::tuple_size<typename tuple_wrap_helper<Out>::type>::value>::type()); | |
| } | |
| static GComputation get_substitute() | |
| { | |
| return invoke(K::substitute, typename MkSeq<sizeof...(Ins)>::type(), | |
| typename MkSeq<std::tuple_size<typename tuple_wrap_helper<Out>::type>::value>::type()); | |
| } | |
| }; | |
| } // namespace detail | |
| template <typename, typename> | |
| class GTransformImpl; | |
| template <typename K, typename R, typename... Args> | |
| class GTransformImpl<K, std::function<R(Args...)>> : public cv::detail::TransHelper<K, std::tuple<Args...>, R>, | |
| public cv::detail::TransformTag | |
| { | |
| public: | |
| // FIXME: currently there is no check that transformations' signatures are unique | |
| // and won't be any intersection in graph compilation stage | |
| using API = K; | |
| static GTransform transformation() | |
| { | |
| return GTransform(K::descr(), &K::get_pattern, &K::get_substitute); | |
| } | |
| }; | |
| } // namespace cv | |