typedef N_CDECL_PTR(void, tyProc_X9c6cdy4kb1kGBF9cECAg70A) (tyObject_TIplImage_CDRuqUq40kDTFB8ETZSvWg* img, tyObject_TPoint_eiQIpSY0i0sZHKdptoc1dg center, int radius, tyObject_TScalar_yQFN0CrcD1NsTHZ9b70VduA* color, int thickness, int lineType, int shift);
you can see that center: TPoint is still a struct value, but color: TScalar becomes a pointer
, thus the value color is not passed to c side correctly:
nim prints: color:(val: [3.0, 4.0, 255.0, 2.0])
gdb shows: (gdb) info args: color = {val = {0, 2.0746488398152286e-317, 3.1315132724983341e-294, 3}}
and this cause opencv failed to read the correct arguments and
failes for all drawing function like cvCircle and cvRectangle etc
this might be the right place to do bug reporting :smile:
type mangling error for object types when passing to C
in nim-opencv, there is two types:
TPoint
andTScalar
and this function
when it's translated to c, it becomes:
you can see that
center: TPoint
is still astruct value
, butcolor: TScalar
becomes apointer
, thus the valuecolor
is not passed to c side correctly:and this cause opencv failed to read the correct arguments and failes for all drawing function like
cvCircle
andcvRectangle
etc