5 # ifndef VCCC_TYPE_SUPPORT_VTYPE_CONVERT_HPP
6 # define VCCC_TYPE_SUPPORT_VTYPE_CONVERT_HPP
38 template<
typename NewType,
template<
typename,
int...>
class CVType,
typename OldType,
int ...CVParams,
40 inline decltype(
auto)
vtype_convert(const CVType<OldType, CVParams...>& cv_type)
42 return convert_to<CVType<NewType, CVParams...>>(cv_type);
47 template<
typename NewType,
template<
typename,
int...>
class CVType,
int ...CVParams>
48 inline decltype(
auto)
vtype_convert(const CVType<NewType, CVParams...>& cv_type)
53 template<
typename NewType,
template<
typename,
int...>
class CVType,
int ...CVParams>
54 inline decltype(
auto)
vtype_convert(CVType<NewType, CVParams...>&& cv_type)
73 template<
typename NewType,
typename Func,
template<
typename...>
class Container,
typename OldType,
typename ...Params,
74 std::enable_if_t<is_range<Container<OldType, Params...>>
::value,
int> = 0>
75 decltype(
auto)
vtype_convert(const Container<OldType, Params...>& container, Func func)
77 Container<NewType, std::allocator<NewType>> res(container.size());
82 template<
typename NewType,
template<
typename...>
class Container,
typename ...Params,
typename UnaryOperation,
83 std::enable_if_t<is_range<Container<NewType, Params...>>
::value,
int> = 0>
84 inline decltype(
auto)
vtype_convert(const Container<NewType, Params...>& container, UnaryOperation func)
100 template<
typename NewType,
template<
typename...>
class Container,
typename OldType,
typename ...Params,
101 std::enable_if_t<is_range<Container<OldType, Params...>>
::value,
int> = 0>
102 decltype(
auto)
vtype_convert(const Container<OldType, Params...>& container)
104 return vtype_convert<NewType>(container, [](
auto &val) {
return cast<NewType>(val); });
108 template<
typename NewType,
template<
typename...>
class Container,
typename ...Params,
109 std::enable_if_t<is_range<Container<NewType, Params...>>
::value,
int> = 0>
110 inline decltype(
auto)
vtype_convert(const Container<NewType, Params...>& container)
115 template<
typename NewType,
template<
typename...>
class Container,
typename ...Params,
116 std::enable_if_t<is_range<Container<NewType, Params...>>
::value,
int> = 0>
117 inline decltype(
auto)
vtype_convert(Container<NewType, Params...>&& container)
119 return std::move(container);
134 template<
typename NewType,
typename OldType, std::size_t n,
typename UnaryOperation,
136 constexpr decltype(
auto)
139 std::array<NewType, n> res;
144 template<
typename NewType, std::
size_t n,
typename UnaryOperation>
145 constexpr decltype(
auto)
148 std::array<NewType, n> res;
153 template<
typename NewType, std::
size_t n,
typename UnaryOperation>
154 constexpr decltype(
auto)
164 template<
typename NewType,
typename OldType, std::size_t n,
166 constexpr decltype(
auto)
169 std::array<NewType, n> res;
171 [](
auto& val) {
return cast<NewType>(val); });
175 template<
typename NewType, std::
size_t n>
176 constexpr
inline decltype(
auto)
182 template<
typename NewType, std::
size_t n>
183 constexpr
inline decltype(
auto)
186 return std::move(container);
constexpr VCCC_INLINE_OR_STATIC detail::for_each_niebloid for_each
Definition: for_each.hpp:54
constexpr VCCC_INLINE_OR_STATIC detail::transform_niebloid transform
Definition: transform.hpp:61
constexpr VCCC_INLINE_OR_STATIC detail::begin_niebloid begin
returns an iterator to the beginning of a range
Definition: begin.hpp:116
constexpr VCCC_INLINE_OR_STATIC detail::end_niebloid end
returns a sentinel indicating the end of a range
Definition: end.hpp:120
std::enable_if_t< disjunction< is_tuple_like< To >, is_tuple_like< From > >::value, To > convert_to(const From &from)
Definition: convert_to.hpp:67
decltype(auto) vtype_convert(const CVType< OldType, CVParams... > &cv_type)
returns similar opencv type, but the value_type is different
Definition: vtype_convert.hpp:40
Definition: matrix.hpp:495
Definition: directory.h:12
constexpr VCCC_INLINE_OR_STATIC detail::element_niebloid< 1 > value
Definition: key_value.hpp:35