\r
if (mask.empty())\r
{\r
+ if (s[0] == 0.0 && s[1] == 0.0 && s[2] == 0.0 && s[3] == 0.0)\r
+ {\r
+ cudaSafeCall( cudaMemset2D(data, step, 0, cols * elemSize(), rows) );\r
+ return *this;\r
+ }\r
+ if (depth() == CV_8U)\r
+ {\r
+ int cn = channels();\r
+\r
+ if (cn == 1 || (cn == 2 && s[0] == s[1]) || (cn == 3 && s[0] == s[1] && s[0] == s[2]) || (cn == 4 && s[0] == s[1] && s[0] == s[2] && s[0] == s[3]))\r
+ {\r
+ int val = saturate_cast<uchar>(s[0]);\r
+ cudaSafeCall( cudaMemset2D(data, step, val, cols, rows) );\r
+ return *this;\r
+ }\r
+ }\r
typedef void (*set_caller_t)(GpuMat& src, const Scalar& s);\r
static const set_caller_t set_callers[8][4] =\r
{\r