@@ -56,14 +56,14 @@ void absDiffScalar(const GpuMat& src, cv::Scalar val, bool, GpuMat& dst, const G
56
56
57
57
namespace
58
58
{
59
- template <typename SrcType, typename ScalarType> struct AbsDiffScalarOp : unary_function<SrcType, SrcType >
59
+ template <typename SrcType, typename ScalarType, typename DstType > struct AbsDiffScalarOp : unary_function<SrcType, DstType >
60
60
{
61
61
ScalarType val;
62
62
63
- __device__ __forceinline__ SrcType operator ()(SrcType a) const
63
+ __device__ __forceinline__ DstType operator ()(SrcType a) const
64
64
{
65
65
abs_func<ScalarType> f;
66
- return saturate_cast<SrcType >(f (saturate_cast<ScalarType>(a) - val));
66
+ return saturate_cast<DstType >(f (saturate_cast<ScalarType>(a) - val));
67
67
}
68
68
};
69
69
@@ -84,7 +84,7 @@ namespace
84
84
85
85
cv::Scalar_<ScalarDepth> value_ = value;
86
86
87
- AbsDiffScalarOp<SrcType, ScalarType> op;
87
+ AbsDiffScalarOp<SrcType, ScalarType, SrcType > op;
88
88
op.val = VecTraits<ScalarType>::make (value_.val );
89
89
gridTransformUnary_< TransformPolicy<ScalarDepth> >(globPtr<SrcType>(src), globPtr<SrcType>(dst), op, stream);
90
90
}
@@ -96,22 +96,22 @@ void absDiffScalar(const GpuMat& src, cv::Scalar val, bool, GpuMat& dst, const G
96
96
static const func_t funcs[7 ][4 ] =
97
97
{
98
98
{
99
- absDiffScalarImpl<uchar, double >, absDiffScalarImpl<uchar2 , double >, absDiffScalarImpl<uchar3 , double >, absDiffScalarImpl<uchar4 , double >
99
+ absDiffScalarImpl<uchar, float >, absDiffScalarImpl<uchar2 , float >, absDiffScalarImpl<uchar3 , float >, absDiffScalarImpl<uchar4 , float >
100
100
},
101
101
{
102
- absDiffScalarImpl<schar, double >, absDiffScalarImpl<char2 , double >, absDiffScalarImpl<char3 , double >, absDiffScalarImpl<char4 , double >
102
+ absDiffScalarImpl<schar, float >, absDiffScalarImpl<char2 , float >, absDiffScalarImpl<char3 , float >, absDiffScalarImpl<char4 , float >
103
103
},
104
104
{
105
- absDiffScalarImpl<ushort, double >, absDiffScalarImpl<ushort2 , double >, absDiffScalarImpl<ushort3 , double >, absDiffScalarImpl<ushort4 , double >
105
+ absDiffScalarImpl<ushort, float >, absDiffScalarImpl<ushort2 , float >, absDiffScalarImpl<ushort3 , float >, absDiffScalarImpl<ushort4 , float >
106
106
},
107
107
{
108
- absDiffScalarImpl<short , double >, absDiffScalarImpl<short2 , double >, absDiffScalarImpl<short3 , double >, absDiffScalarImpl<short4 , double >
108
+ absDiffScalarImpl<short , float >, absDiffScalarImpl<short2 , float >, absDiffScalarImpl<short3 , float >, absDiffScalarImpl<short4 , float >
109
109
},
110
110
{
111
- absDiffScalarImpl<int , double >, absDiffScalarImpl<int2 , double >, absDiffScalarImpl<int3 , double >, absDiffScalarImpl<int4 , double >
111
+ absDiffScalarImpl<int , float >, absDiffScalarImpl<int2 , float >, absDiffScalarImpl<int3 , float >, absDiffScalarImpl<int4 , float >
112
112
},
113
113
{
114
- absDiffScalarImpl<float , double >, absDiffScalarImpl<float2 , double >, absDiffScalarImpl<float3 , double >, absDiffScalarImpl<float4 , double >
114
+ absDiffScalarImpl<float , float >, absDiffScalarImpl<float2 , float >, absDiffScalarImpl<float3 , float >, absDiffScalarImpl<float4 , float >
115
115
},
116
116
{
117
117
absDiffScalarImpl<double , double >, absDiffScalarImpl<double2 , double >, absDiffScalarImpl<double3 , double >, absDiffScalarImpl<double4 , double >
0 commit comments