[racket] FFI & pointers
I try to use computer vision library with racket.
;; API
(define libhighgui (ffi-lib "libhighgui" '("2.1" "4")))
(define-cpointer-type _cv-capture)
;; /* start capturing frames from camera: index = camera_index +
domain_offset (CV_CAP_*) */
;; CVAPI(CvCapture*) cvCreateCameraCapture( int index );
(define cvCreateCameraCapture
(get-ffi-obj "cvCreateCameraCapture" libhighgui (_fun _int -> (_or-null
_cv-capture))))
;; /* stop capturing/reading and free resources */
;; CVAPI(void) cvReleaseCapture( CvCapture** capture );
(define cvReleaseCapture
(get-ffi-obj "cvReleaseCapture" libhighgui (_fun _pointer -> _void)))
;;application
(define capture (cvCreateCameraCapture 0)
How I can release the capture (how to emulate CvCapture** for
cvReleaseCapture)?
Alex.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20111029/026df526/attachment.html>