I need an interface from SBCL to a a set of "C" function in the OpenCV library. I don't think there is a bindings package available for opencv, so I need to carve my own. Currently cffi (transparently) with cl-opengl, so it appears to be working property.
Some questions to get me going in the right direction:
I have swig 2.0 built on my system which has some support for CFFI (although not very well documented - at least for beginners).
Should I go with the option of trying to use SWIG to generate some bindings or should I just dig into CFFI and hand-create the bindings that I need ? Also if anyone can send me references to any examples, I would appreciate. The functions that I need in OpenCV reference C structures representing images that have pointers in them to byte arrays as well as various flags and integer types - just to give you an idea...I'd like to stay in lisp as much as possible, but my lack of access to OpenCV is pushing more of this code into C.
thanks,
-K
On Wed, Jul 14, 2010 at 6:30 PM, Kevin Smith k2msmith@gmail.com wrote:
I need an interface from SBCL to a a set of "C" function in the OpenCV library. I don't think there is a bindings package available for opencv, so I need to carve my own.
Ryan Davis seems to have plans to write such a bindings package as well, and he has some prototype code over here: http://github.com/ryepup/cl-opencv. Perhaps you should get in touch with him.
Should I go with the option of trying to use SWIG to generate some bindings or should I just dig into CFFI and hand-create the bindings that I need ?
I personally prefer to write the FFI definitions as I go along, but this is not always practical if the library is too big and/or changes very often.
Also if anyone can send me references to any examples, I would appreciate.
CFFI's User Manual has a nice tutorial and its reference chapters also have a bunch of small examples. cl-opengl, iolib, and osicat are some libraries that use CFFI.
Hope that helps,