@ -6992,7 +6992,7 @@ const char* typeToStr(int type)
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0
} ;
} ;
int cn = CV_MAT_CN ( type ) , depth = CV_MAT_DEPTH ( type ) ;
int cn = CV_MAT_CN ( type ) , depth = CV_MAT_DEPTH ( type ) ;
const char * result = cn > 16 ? 0 : tab [ depth * 16 + cn - 1 ] ;
const char * result = cn > 16 ? nullptr : tab [ depth * 16 + cn - 1 ] ;
CV_Assert ( result ) ;
CV_Assert ( result ) ;
return result ;
return result ;
}
}
@ -7012,7 +7012,7 @@ const char* memopTypeToStr(int type)
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0
} ;
} ;
int cn = CV_MAT_CN ( type ) , depth = CV_MAT_DEPTH ( type ) ;
int cn = CV_MAT_CN ( type ) , depth = CV_MAT_DEPTH ( type ) ;
const char * result = cn > 16 ? 0 : tab [ depth * 16 + cn - 1 ] ;
const char * result = cn > 16 ? nullptr : tab [ depth * 16 + cn - 1 ] ;
CV_Assert ( result ) ;
CV_Assert ( result ) ;
return result ;
return result ;
}
}
@ -7039,6 +7039,9 @@ const char* vecopTypeToStr(int type)
const char * convertTypeStr ( int sdepth , int ddepth , int cn , char * buf )
const char * convertTypeStr ( int sdepth , int ddepth , int cn , char * buf )
{
{
// Since the size of buf is not given, we assume 50 because that's what all callers use.
constexpr size_t buf_max = 50 ;
if ( sdepth = = ddepth )
if ( sdepth = = ddepth )
return " noconvert " ;
return " noconvert " ;
const char * typestr = typeToStr ( CV_MAKETYPE ( ddepth , cn ) ) ;
const char * typestr = typeToStr ( CV_MAKETYPE ( ddepth , cn ) ) ;
@ -7047,12 +7050,12 @@ const char* convertTypeStr(int sdepth, int ddepth, int cn, char* buf)
( ddepth = = CV_16S & & sdepth < = CV_8S ) | |
( ddepth = = CV_16S & & sdepth < = CV_8S ) | |
( ddepth = = CV_16U & & sdepth = = CV_8U ) )
( ddepth = = CV_16U & & sdepth = = CV_8U ) )
{
{
sprintf ( buf , " convert_%s " , typestr ) ;
sn printf ( buf , buf_max , " convert_%s " , typestr ) ;
}
}
else if ( sdepth > = CV_32F )
else if ( sdepth > = CV_32F )
sprintf ( buf , " convert_%s%s_rte " , typestr , ( ddepth < CV_32S ? " _sat " : " " ) ) ;
sn printf ( buf , buf_max , " convert_%s%s_rte " , typestr , ( ddepth < CV_32S ? " _sat " : " " ) ) ;
else
else
sprintf ( buf , " convert_%s_sat " , typestr ) ;
sn printf ( buf , buf_max , " convert_%s_sat " , typestr ) ;
return buf ;
return buf ;
}
}