Closed ghost closed 5 years ago
Hello @andreasmuetzel-ametek ,
The XF_TNAME(SRC_T,NPC)
is always meant to resolve to unsigned type. This datatype is used as a container for the incoming/output data, but all the core processing happens after typecasting to appropriate data type. XF_16SC3
is not used currently in any functions and it will also be modified accordingly in the future release.
Hi, thanks for the explanation! Sorry, this whole "integer type number as a template parameter" is really confusing if you're used to directly using types as template parameters...
I am currently trying to instantiate an
xf::Sobel
kernel on single-channelxf::Mat
images with signed 16 bit integer values (i.e. of typeXF_16SC1
). However, there seems to be a bug that causes all operations to be instantiated with unsigned values instead.Digging deeper, the cause seems to be the macro
XF_TNAME(SRC_T,NPC)
that is used inxf::Sobel
(and lots of other places). It uses the specialization of theDataType<XF_16SC1,XF_NPPC1>
traits class ininclude/common/xf_types.h:128
. Almost all signed (XF_xxSCy) data types haveap_uint<xx>
as the name; only the specialization ofXF_16SC3
seems to use a signedap_int<xx>
type. Shouldn't the type for all signed types beap_int<xx>
instead, or am I missing something here?