Hi, I’m
trying to make a Squeak interface to OpenCV, the computer vision library, and I
have a few newbie questions about FFI:
1)
I
managed to make an ExternalStructure for the IplImage and other simple structs
such as CvScalar, CvSize, etc. I have a problem when trying to make the
ExternalStructure for CvMat, which represents a matrix, because some members
are unions. What should I do to make an ExternalStructure with unions?
2)
To
finalize objects the OpenCV library defines some functions such as cvReleaseImage,
cvReleaseMat, etc. As far as I can tell, these functions receive a pointer-to-pointer
as argument. How can I declare such a method in Squeak? Having one object, how
can I get the pointer to that object? Should I use the #getHandle method?
3)
Some
OpenCV functions are declared as inline functions. I haven’t been able to
access those functions from Squeak. Is this an expected behavior?
So far, these
are the problems I encounter. As you may see from the questions above my
knowledge of Squeak, FFI and C is pretty limited, so I would be very thankful
if someone could give me a hand with these issues.
Thanks, bye