@ -6983,7 +6983,7 @@ const char* typeToStr(int type)
{
" uchar " , " uchar2 " , " uchar3 " , " uchar4 " , 0 , 0 , 0 , " uchar8 " , 0 , 0 , 0 , 0 , 0 , 0 , 0 , " uchar16 " ,
" char " , " char2 " , " char3 " , " char4 " , 0 , 0 , 0 , " char8 " , 0 , 0 , 0 , 0 , 0 , 0 , 0 , " char16 " ,
" ushort " , " ushort2 " , " ushort3 " , " ushort4 " , 0 , 0 , 0 , " ushort8 " , 0 , 0 , 0 , 0 , 0 , 0 , 0 , " ushort16 " ,
" ushort " , " ushort2 " , " ushort3 " , " ushort4 " , 0 , 0 , 0 , " ushort8 " , 0 , 0 , 0 , 0 , 0 , 0 , 0 , " ushort16 " ,
" short " , " short2 " , " short3 " , " short4 " , 0 , 0 , 0 , " short8 " , 0 , 0 , 0 , 0 , 0 , 0 , 0 , " short16 " ,
" int " , " int2 " , " int3 " , " int4 " , 0 , 0 , 0 , " int8 " , 0 , 0 , 0 , 0 , 0 , 0 , 0 , " int16 " ,
" float " , " float2 " , " float3 " , " float4 " , 0 , 0 , 0 , " float8 " , 0 , 0 , 0 , 0 , 0 , 0 , 0 , " float16 " ,
@ -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
} ;
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 ) ;
return result ;
}
@ -7003,7 +7003,7 @@ const char* memopTypeToStr(int type)
{
" uchar " , " uchar2 " , " uchar3 " , " uchar4 " , 0 , 0 , 0 , " uchar8 " , 0 , 0 , 0 , 0 , 0 , 0 , 0 , " uchar16 " ,
" char " , " char2 " , " char3 " , " char4 " , 0 , 0 , 0 , " char8 " , 0 , 0 , 0 , 0 , 0 , 0 , 0 , " char16 " ,
" ushort " , " ushort2 " , " ushort3 " , " ushort4 " , 0 , 0 , 0 , " ushort8 " , 0 , 0 , 0 , 0 , 0 , 0 , 0 , " ushort16 " ,
" ushort " , " ushort2 " , " ushort3 " , " ushort4 " , 0 , 0 , 0 , " ushort8 " , 0 , 0 , 0 , 0 , 0 , 0 , 0 , " ushort16 " ,
" short " , " short2 " , " short3 " , " short4 " , 0 , 0 , 0 , " short8 " , 0 , 0 , 0 , 0 , 0 , 0 , 0 , " short16 " ,
" int " , " int2 " , " int3 " , " int4 " , 0 , 0 , 0 , " int8 " , 0 , 0 , 0 , 0 , 0 , 0 , 0 , " int16 " ,
" int " , " int2 " , " int3 " , " int4 " , 0 , 0 , 0 , " int8 " , 0 , 0 , 0 , 0 , 0 , 0 , 0 , " int16 " ,
@ -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
} ;
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 ) ;
return result ;
}
@ -7039,6 +7039,9 @@ const char* vecopTypeToStr(int type)
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 )
return " noconvert " ;
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_16U & & sdepth = = CV_8U ) )
{
sprintf ( buf , " convert_%s " , typestr ) ;
sn printf ( buf , buf_max , " convert_%s " , typestr ) ;
}
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
sprintf ( buf , " convert_%s_sat " , typestr ) ;
sn printf ( buf , buf_max , " convert_%s_sat " , typestr ) ;
return buf ;
}