Border functions

group Border functions

Functions

template<bool Active = true, typename T>
constexpr bool __host__ __device__ IsOutside(T c, T s)

Function to check if given coordinate is outside range defined by given size.

Template Parameters:
  • Active – Flag to turn this function active.

  • T – Type of the values given to this function.

Parameters:
  • c[in] Coordinate to check if it is outside the range [0, s).

  • s[in] Size that defines the inside range [0, s).

Returns:

True if given coordinate is outside given size.

template<NVCVBorderType B, bool Active = true, typename T>
constexpr T __host__ __device__ GetIndexWithBorder(T c, T s)

Function to get a border-aware index considering the range defined by given size.

Note

This function does not work for NVCV_BORDER_CONSTANT.

Template Parameters:
  • B – It is a NVCVBorderType indicating the border to be used.

  • Active – Flag to turn this function active.

  • T – Type of the values given to this function.

Parameters:
  • c[in] Coordinate (input index) to put back inside valid range [0, s).

  • s[in] Size that defines the valid range [0, s).

namespace detail

Typedefs

template<typename T, NVCVBorderType B>
using BorderVarShapeWrapImpl = BorderIWImpl<ImageBatchVarShapeWrap<T>, B>
template<typename T, NVCVBorderType B>
using BorderVarShapeWrapNHWCImpl = BorderIWImpl<ImageBatchVarShapeWrapNHWC<T>, B>
template<class FROM, class TO>
using CopyConstness_t = typename CopyConstness<FROM, TO>::type
template<class T, int C>
using MakeType_t = typename detail::MakeType<T, C>::type
template<class BT, class T>
using ConvertBaseTypeTo_t = typename ConvertBaseTypeTo<BT, T>::type

Functions

template<typename T>
constexpr T __host__ __device__ ReplicateBorderIndex(T c, T s)
template<typename T>
constexpr T __host__ __device__ WrapBorderIndex(T c, T s)
template<typename T>
constexpr T __host__ __device__ ReflectBorderIndex(T c, T s)
template<typename T>
constexpr T __host__ __device__ Reflect101BorderIndex(T c, T s)
template<typename U>
__host__ inline U RoundEvenImpl(U u)
template<typename T, typename U, int RM = FE_TONEAREST>
__host__ __device__ inline T RoundImpl(U u)
template<typename U>
__host__ __device__ inline U MinImpl(U a, U b)
template<typename U>
__host__ __device__ inline U MaxImpl(U a, U b)
template<typename U, typename S>
__host__ __device__ inline U PowImpl(U x, S y)
template<typename U>
__host__ __device__ inline U ExpImpl(U u)
template<typename U>
__host__ __device__ inline U SqrtImpl(U u)
template<typename U>
__host__ __device__ inline U AbsImpl(U u)
template<typename U, typename S>
__host__ __device__ inline U ClampImpl(U u, S lo, S hi)
template<typename T, typename U>
__host__ __device__ inline T RangeCastFloatingNarrow(U u)
template<typename T, typename U>
__host__ __device__ inline T RangeCastFloatingToSignedIntegral(U u)
template<typename T, typename U>
__host__ __device__ inline T RangeCastSignedIntegralToFloating(U u)
template<typename T, typename U>
__host__ __device__ inline T RangeCastFloatingToUnsignedIntegral(U u)
template<typename T, typename U>
__host__ __device__ inline T RangeCastUnsignedIntegralToFloating(U u)
template<typename T, typename U>
__host__ __device__ inline T RangeCastImpl(U u)
template<typename T, typename U, typename Min, typename Max>
__host__ __device__ inline T BoundedCast(U u, Min minValue, Max maxValue)
template<typename T, typename U>
__host__ __device__ inline T SaturateFloatingToIntegral(U u)
template<typename T, typename U>
__host__ __device__ inline T SaturateSignedSmallToUnsigned(U u)
template<typename T, typename U>
__host__ __device__ inline T SaturateIntegralNarrowSameSign(U u)
template<typename T, typename U>
__host__ __device__ inline T SaturateUnsignedToSigned(U u)
template<typename T, typename U>
__host__ __device__ inline T SaturateSignedBigToUnsigned(U u)
template<typename T, typename U>
__host__ __device__ inline T BaseSaturateCastImpl(U u)
template<typename T, typename U>
__host__ __device__ inline T SaturateCastImpl(U u)
template<>
__host__ __device__ __forceinline__ unsigned char SaturateCastImpl<unsigned char, signed char>(signed char u)
template<>
__host__ __device__ __forceinline__ unsigned char SaturateCastImpl<unsigned char, short>(short u)
template<>
__host__ __device__ __forceinline__ unsigned char SaturateCastImpl<unsigned char, unsigned short>(unsigned short u)
template<>
__host__ __device__ __forceinline__ unsigned char SaturateCastImpl<unsigned char, int>(int u)
template<>
__host__ __device__ __forceinline__ unsigned char SaturateCastImpl<unsigned char, unsigned int>(unsigned int u)
template<>
__host__ __device__ __forceinline__ unsigned char SaturateCastImpl<unsigned char, float>(float u)
template<>
__host__ __device__ __forceinline__ unsigned char SaturateCastImpl<unsigned char, double>(double u)
template<>
__host__ __device__ __forceinline__ signed char SaturateCastImpl<signed char, unsigned char>(unsigned char u)
template<>
__host__ __device__ __forceinline__ signed char SaturateCastImpl<signed char, short>(short u)
template<>
__host__ __device__ __forceinline__ signed char SaturateCastImpl<signed char, unsigned short>(unsigned short u)
template<>
__host__ __device__ __forceinline__ signed char SaturateCastImpl<signed char, int>(int u)
template<>
__host__ __device__ __forceinline__ signed char SaturateCastImpl<signed char, unsigned int>(unsigned int u)
template<>
__host__ __device__ __forceinline__ signed char SaturateCastImpl<signed char, float>(float u)
template<>
__host__ __device__ __forceinline__ signed char SaturateCastImpl<signed char, double>(double u)
template<>
__host__ __device__ __forceinline__ unsigned short SaturateCastImpl<unsigned short, signed char>(signed char u)
template<>
__host__ __device__ __forceinline__ unsigned short SaturateCastImpl<unsigned short, short>(short u)
template<>
__host__ __device__ __forceinline__ unsigned short SaturateCastImpl<unsigned short, int>(int u)
template<>
__host__ __device__ __forceinline__ unsigned short SaturateCastImpl<unsigned short, unsigned int>(unsigned int u)
template<>
__host__ __device__ __forceinline__ unsigned short SaturateCastImpl<unsigned short, float>(float u)
template<>
__host__ __device__ __forceinline__ unsigned short SaturateCastImpl<unsigned short, double>(double u)
template<>
__host__ __device__ __forceinline__ short SaturateCastImpl<short, unsigned short>(unsigned short u)
template<>
__host__ __device__ __forceinline__ short SaturateCastImpl<short, int>(int u)
template<>
__host__ __device__ __forceinline__ short SaturateCastImpl<short, unsigned int>(unsigned int u)
template<>
__host__ __device__ __forceinline__ short SaturateCastImpl<short, float>(float u)
template<>
__host__ __device__ __forceinline__ short SaturateCastImpl<short, double>(double u)
template<>
__host__ __device__ __forceinline__ int SaturateCastImpl<int, unsigned int>(unsigned int u)
template<>
__host__ __device__ __forceinline__ int SaturateCastImpl<int, float>(float u)
template<>
__host__ __device__ __forceinline__ int SaturateCastImpl<int, double>(double u)
template<>
__host__ __device__ __forceinline__ unsigned int SaturateCastImpl<unsigned int, signed char>(signed char u)
template<>
__host__ __device__ __forceinline__ unsigned int SaturateCastImpl<unsigned int, short>(short u)
template<>
__host__ __device__ __forceinline__ unsigned int SaturateCastImpl<unsigned int, int>(int u)
template<>
__host__ __device__ __forceinline__ unsigned int SaturateCastImpl<unsigned int, float>(float u)
template<>
__host__ __device__ __forceinline__ unsigned int SaturateCastImpl<unsigned int, double>(double u)
template<typename T, typename U, typename RT, RoundMode RM>
__host__ __device__ inline RT RoundImpl(U u)

Variables

template<class T, class U, class = Require<HasTypeTraits<T, U>>>
constexpr bool IsSameCompound = IsCompound<T> && TypeTraits<T>::components == TypeTraits<U>::components
template<typename T, typename U, class = Require<HasTypeTraits<T, U>>>
constexpr bool OneIsCompound = (TypeTraits<T>::components == 0 && TypeTraits<U>::components >= 1) || (TypeTraits<T>::components >= 1 && TypeTraits<U>::components == 0) || IsSameCompound<T, U>
template<typename T, class = Require<HasTypeTraits<T>>>
constexpr bool IsIntegral = std::is_integral_v<typename TypeTraits<T>::base_type>
template<typename T, typename U, class = Require<HasTypeTraits<T, U>>>
constexpr bool OneIsCompoundAndBothAreIntegral = OneIsCompound<T, U> && IsIntegral<T> && IsIntegral<U>
template<typename T, class = Require<HasTypeTraits<T>>>
constexpr bool IsIntegralCompound = IsIntegral<T> && IsCompound<T>
template<class IW, NVCVBorderType B>
class BorderIWImpl
#include <BorderVarShapeWrap.hpp>

Subclassed by nvcv::cuda::BorderVarShapeWrap< T, B >, nvcv::cuda::BorderVarShapeWrap< T, NVCV_BORDER_CONSTANT >, nvcv::cuda::BorderVarShapeWrapNHWC< T, B >, nvcv::cuda::BorderVarShapeWrapNHWC< T, NVCV_BORDER_CONSTANT >

template<class TW, NVCVBorderType B, bool... ActiveDimensions>
class BorderWrapImpl
#include <BorderWrap.hpp>
template<class BT, class T>
struct ConvertBaseTypeTo
#include <Metaprogramming.hpp>
template<class BT, class T>
struct ConvertBaseTypeTo<BT, const T>
#include <Metaprogramming.hpp>
template<class BT, class T>
struct ConvertBaseTypeTo<BT, volatile const T>
#include <Metaprogramming.hpp>
template<class BT, class T>
struct ConvertBaseTypeTo<BT, volatile T>
#include <Metaprogramming.hpp>
template<class FROM, class TO>
struct CopyConstness
#include <Metaprogramming.hpp>
template<class FROM, class TO>
struct CopyConstness<const FROM, TO>
#include <Metaprogramming.hpp>
template<typename T, typename = void>
struct HasTypeTraits_t : public false_type
#include <Metaprogramming.hpp>
template<typename T>
struct HasTypeTraits_t<T, std::void_t<typename TypeTraits<T>::base_type>> : public true_type
#include <Metaprogramming.hpp>
template<typename T, NVCVBorderType B, NVCVInterpolationType I>
class InterpolationVarShapeWrapImpl
#include <InterpolationVarShapeWrap.hpp>

Subclassed by nvcv::cuda::InterpolationVarShapeWrap< T, B, I >

template<class BW, NVCVInterpolationType I>
class InterpolationWrapImpl
#include <InterpolationWrap.hpp>

Subclassed by nvcv::cuda::InterpolationWrap< BW, I >

template<class T, int C>
struct MakeType
#include <Metaprogramming.hpp>
template<>
struct MakeType<char, 0>
#include <Metaprogramming.hpp>
template<>
struct MakeType<char, 1>
#include <Metaprogramming.hpp>
template<>
struct MakeType<char, 2>
#include <Metaprogramming.hpp>
template<>
struct MakeType<char, 3>
#include <Metaprogramming.hpp>
template<>
struct MakeType<char, 4>
#include <Metaprogramming.hpp>
template<class T, int C>
struct MakeType<const T, C>
#include <Metaprogramming.hpp>
template<class T, int C>
struct MakeType<volatile const T, C>
#include <Metaprogramming.hpp>
template<>
struct MakeType<double, 0>
#include <Metaprogramming.hpp>
template<>
struct MakeType<double, 1>
#include <Metaprogramming.hpp>
template<>
struct MakeType<double, 2>
#include <Metaprogramming.hpp>
template<>
struct MakeType<double, 3>
#include <Metaprogramming.hpp>
template<>
struct MakeType<double, 4>
#include <Metaprogramming.hpp>
template<>
struct MakeType<float, 0>
#include <Metaprogramming.hpp>
template<>
struct MakeType<float, 1>
#include <Metaprogramming.hpp>
template<>
struct MakeType<float, 2>
#include <Metaprogramming.hpp>
template<>
struct MakeType<float, 3>
#include <Metaprogramming.hpp>
template<>
struct MakeType<float, 4>
#include <Metaprogramming.hpp>
template<>
struct MakeType<int, 0>
#include <Metaprogramming.hpp>
template<>
struct MakeType<int, 1>
#include <Metaprogramming.hpp>
template<>
struct MakeType<int, 2>
#include <Metaprogramming.hpp>
template<>
struct MakeType<int, 3>
#include <Metaprogramming.hpp>
template<>
struct MakeType<int, 4>
#include <Metaprogramming.hpp>
template<>
struct MakeType<long long, 0>
#include <Metaprogramming.hpp>
template<>
struct MakeType<long long, 1>
#include <Metaprogramming.hpp>
template<>
struct MakeType<long long, 2>
#include <Metaprogramming.hpp>
template<>
struct MakeType<long long, 3>
#include <Metaprogramming.hpp>
template<>
struct MakeType<long long, 4>
#include <Metaprogramming.hpp>
template<>
struct MakeType<long, 0>
#include <Metaprogramming.hpp>
template<>
struct MakeType<long, 1>
#include <Metaprogramming.hpp>
template<>
struct MakeType<long, 2>
#include <Metaprogramming.hpp>
template<>
struct MakeType<long, 3>
#include <Metaprogramming.hpp>
template<>
struct MakeType<long, 4>
#include <Metaprogramming.hpp>
template<>
struct MakeType<short, 0>
#include <Metaprogramming.hpp>
template<>
struct MakeType<short, 1>
#include <Metaprogramming.hpp>
template<>
struct MakeType<short, 2>
#include <Metaprogramming.hpp>
template<>
struct MakeType<short, 3>
#include <Metaprogramming.hpp>
template<>
struct MakeType<short, 4>
#include <Metaprogramming.hpp>
template<>
struct MakeType<signed char, 0>
#include <Metaprogramming.hpp>
template<>
struct MakeType<signed char, 1>
#include <Metaprogramming.hpp>
template<>
struct MakeType<signed char, 2>
#include <Metaprogramming.hpp>
template<>
struct MakeType<signed char, 3>
#include <Metaprogramming.hpp>
template<>
struct MakeType<signed char, 4>
#include <Metaprogramming.hpp>
template<>
struct MakeType<unsigned char, 0>
#include <Metaprogramming.hpp>
template<>
struct MakeType<unsigned char, 1>
#include <Metaprogramming.hpp>
template<>
struct MakeType<unsigned char, 2>
#include <Metaprogramming.hpp>
template<>
struct MakeType<unsigned char, 3>
#include <Metaprogramming.hpp>
template<>
struct MakeType<unsigned char, 4>
#include <Metaprogramming.hpp>
template<>
struct MakeType<unsigned int, 0>
#include <Metaprogramming.hpp>
template<>
struct MakeType<unsigned int, 1>
#include <Metaprogramming.hpp>
template<>
struct MakeType<unsigned int, 2>
#include <Metaprogramming.hpp>
template<>
struct MakeType<unsigned int, 3>
#include <Metaprogramming.hpp>
template<>
struct MakeType<unsigned int, 4>
#include <Metaprogramming.hpp>
template<>
struct MakeType<unsigned long long, 0>
#include <Metaprogramming.hpp>
template<>
struct MakeType<unsigned long long, 1>
#include <Metaprogramming.hpp>
template<>
struct MakeType<unsigned long long, 2>
#include <Metaprogramming.hpp>
template<>
struct MakeType<unsigned long long, 3>
#include <Metaprogramming.hpp>
template<>
struct MakeType<unsigned long long, 4>
#include <Metaprogramming.hpp>
template<>
struct MakeType<unsigned long, 0>
#include <Metaprogramming.hpp>
template<>
struct MakeType<unsigned long, 1>
#include <Metaprogramming.hpp>
template<>
struct MakeType<unsigned long, 2>
#include <Metaprogramming.hpp>
template<>
struct MakeType<unsigned long, 3>
#include <Metaprogramming.hpp>
template<>
struct MakeType<unsigned long, 4>
#include <Metaprogramming.hpp>
template<>
struct MakeType<unsigned short, 0>
#include <Metaprogramming.hpp>
template<>
struct MakeType<unsigned short, 1>
#include <Metaprogramming.hpp>
template<>
struct MakeType<unsigned short, 2>
#include <Metaprogramming.hpp>
template<>
struct MakeType<unsigned short, 3>
#include <Metaprogramming.hpp>
template<>
struct MakeType<unsigned short, 4>
#include <Metaprogramming.hpp>
template<class T, int C>
struct MakeType<volatile T, C>
#include <Metaprogramming.hpp>
template<class T>
struct TypeTraits
#include <Metaprogramming.hpp>

Subclassed by nvcv::cuda::detail::TypeTraits< const T >, nvcv::cuda::detail::TypeTraits< const volatile T >, nvcv::cuda::detail::TypeTraits< volatile T >

template<>
struct TypeTraits<char>
#include <Metaprogramming.hpp>
template<>
struct TypeTraits<char1>
#include <Metaprogramming.hpp>
template<>
struct TypeTraits<char2>
#include <Metaprogramming.hpp>
template<>
struct TypeTraits<char3>
#include <Metaprogramming.hpp>
template<>
struct TypeTraits<char4>
#include <Metaprogramming.hpp>
template<class T>
struct TypeTraits<const T> : public nvcv::cuda::detail::TypeTraits<T>
#include <Metaprogramming.hpp>
template<class T>
struct TypeTraits<volatile const T> : public nvcv::cuda::detail::TypeTraits<T>
#include <Metaprogramming.hpp>
template<>
struct TypeTraits<dim3>
#include <Metaprogramming.hpp>
template<>
struct TypeTraits<double>
#include <Metaprogramming.hpp>
template<>
struct TypeTraits<double1>
#include <Metaprogramming.hpp>
template<>
struct TypeTraits<double2>
#include <Metaprogramming.hpp>
template<>
struct TypeTraits<double3>
#include <Metaprogramming.hpp>
template<>
struct TypeTraits<double4_16a>
#include <Metaprogramming.hpp>
template<>
struct TypeTraits<float>
#include <Metaprogramming.hpp>
template<>
struct TypeTraits<float1>
#include <Metaprogramming.hpp>
template<>
struct TypeTraits<float2>
#include <Metaprogramming.hpp>
template<>
struct TypeTraits<float3>
#include <Metaprogramming.hpp>
template<>
struct TypeTraits<float4>
#include <Metaprogramming.hpp>
template<>
struct TypeTraits<int>
#include <Metaprogramming.hpp>
template<>
struct TypeTraits<int1>
#include <Metaprogramming.hpp>
template<>
struct TypeTraits<int2>
#include <Metaprogramming.hpp>
template<>
struct TypeTraits<int3>
#include <Metaprogramming.hpp>
template<>
struct TypeTraits<int4>
#include <Metaprogramming.hpp>
template<>
struct TypeTraits<long>
#include <Metaprogramming.hpp>
template<>
struct TypeTraits<long long>
#include <Metaprogramming.hpp>
template<>
struct TypeTraits<long1>
#include <Metaprogramming.hpp>
template<>
struct TypeTraits<long2>
#include <Metaprogramming.hpp>
template<>
struct TypeTraits<long3>
#include <Metaprogramming.hpp>
template<>
struct TypeTraits<long4_16a>
#include <Metaprogramming.hpp>
template<>
struct TypeTraits<longlong1>
#include <Metaprogramming.hpp>
template<>
struct TypeTraits<longlong2>
#include <Metaprogramming.hpp>
template<>
struct TypeTraits<longlong3>
#include <Metaprogramming.hpp>
template<>
struct TypeTraits<longlong4_16a>
#include <Metaprogramming.hpp>
template<>
struct TypeTraits<short>
#include <Metaprogramming.hpp>
template<>
struct TypeTraits<short1>
#include <Metaprogramming.hpp>
template<>
struct TypeTraits<short2>
#include <Metaprogramming.hpp>
template<>
struct TypeTraits<short3>
#include <Metaprogramming.hpp>
template<>
struct TypeTraits<short4>
#include <Metaprogramming.hpp>
template<>
struct TypeTraits<signed char>
#include <Metaprogramming.hpp>
template<>
struct TypeTraits<uchar1>
#include <Metaprogramming.hpp>
template<>
struct TypeTraits<uchar2>
#include <Metaprogramming.hpp>
template<>
struct TypeTraits<uchar3>
#include <Metaprogramming.hpp>
template<>
struct TypeTraits<uchar4>
#include <Metaprogramming.hpp>
template<>
struct TypeTraits<uint1>
#include <Metaprogramming.hpp>
template<>
struct TypeTraits<uint2>
#include <Metaprogramming.hpp>
template<>
struct TypeTraits<uint3>
#include <Metaprogramming.hpp>
template<>
struct TypeTraits<uint4>
#include <Metaprogramming.hpp>
template<>
struct TypeTraits<ulong1>
#include <Metaprogramming.hpp>
template<>
struct TypeTraits<ulong2>
#include <Metaprogramming.hpp>
template<>
struct TypeTraits<ulong3>
#include <Metaprogramming.hpp>
template<>
struct TypeTraits<ulong4_16a>
#include <Metaprogramming.hpp>
template<>
struct TypeTraits<ulonglong1>
#include <Metaprogramming.hpp>
template<>
struct TypeTraits<ulonglong2>
#include <Metaprogramming.hpp>
template<>
struct TypeTraits<ulonglong3>
#include <Metaprogramming.hpp>
template<>
struct TypeTraits<ulonglong4_16a>
#include <Metaprogramming.hpp>
template<>
struct TypeTraits<unsigned char>
#include <Metaprogramming.hpp>
template<>
struct TypeTraits<unsigned int>
#include <Metaprogramming.hpp>
template<>
struct TypeTraits<unsigned long>
#include <Metaprogramming.hpp>
template<>
struct TypeTraits<unsigned long long>
#include <Metaprogramming.hpp>
template<>
struct TypeTraits<unsigned short>
#include <Metaprogramming.hpp>
template<>
struct TypeTraits<ushort1>
#include <Metaprogramming.hpp>
template<>
struct TypeTraits<ushort2>
#include <Metaprogramming.hpp>
template<>
struct TypeTraits<ushort3>
#include <Metaprogramming.hpp>
template<>
struct TypeTraits<ushort4>
#include <Metaprogramming.hpp>
template<class T>
struct TypeTraits<volatile T> : public nvcv::cuda::detail::TypeTraits<T>
#include <Metaprogramming.hpp>