[racket] FFI & pointers

From: Aleksei Pastutsan (alex.pastut at gmail.com)
Date: Sat Oct 29 06:32:42 EDT 2011

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

;; /* stop capturing/reading and free resources */
;; CVAPI(void) cvReleaseCapture( CvCapture** capture );
(define cvReleaseCapture
  (get-ffi-obj "cvReleaseCapture" libhighgui (_fun _pointer -> _void)))

(define capture (cvCreateCameraCapture 0)

How I can release the capture (how to emulate CvCapture**  for

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20111029/026df526/attachment.html>

Posted on the users mailing list.