Permalink
Browse files

Removed :use :cffi.

Removed cffi from the global namespace to be able to more easily
distinguish when we are using CFFI and when we are using FSBV.
  • Loading branch information...
1 parent 601b10f commit b42adf463bff653dc31b8294ce0aa5f96639cc78 J. Bromley committed Apr 1, 2011
Showing with 53 additions and 53 deletions.
  1. +4 −4 cl-opencv.lisp
  2. +15 −15 core.lisp
  3. +23 −23 highgui.lisp
  4. +10 −10 imgproc.lisp
  5. +1 −1 package.lisp
View
@@ -8,17 +8,17 @@
(when (member :darwin cl:*features*)
(pushnew #p"/opt/local/lib/" cffi:*foreign-library-directories*))
-(define-foreign-library highgui
+(cffi:define-foreign-library highgui
(:darwin (:or "libopencv_highgui.2.2.0.dylib" "libopencv_highgui.dylib"))
(:unix (:or "libhighgui.so.2.1.0" "libhighgui.so" ))
(t (:default "libhighgui")))
-(use-foreign-library highgui)
+(cffi:use-foreign-library highgui)
-(define-foreign-library cl-opencv-glue
+(cffi:define-foreign-library cl-opencv-glue
(:darwin "libcl-opencv-glue.dylib")
(:unix "libcl-opencv-glue.so")
(t (:default "libcl-opencv-glue")))
-(use-foreign-library cl-opencv-glue)
+(cffi:use-foreign-library cl-opencv-glue)
;;; General macros and functions
(defmacro defanonenum (&body enums)
View
@@ -69,7 +69,7 @@ will pack and unpack the structure into an INT64."
(t args))))
;; CvMat
-(defctype cv-matrix :pointer)
+(cffi:defctype cv-matrix :pointer)
;; IplImage
(defanonenum
@@ -83,26 +83,26 @@ will pack and unpack the structure into an INT64."
(+ipl-depth-16s+ -2147483632) ; IPL_DEPTH_SIGN | 16
(+ipl-depth-32s+ -2147483616)) ; IPL_DEPTH_SIGN | 32
-(defctype ipl-image :pointer)
+(cffi:defctype ipl-image :pointer)
;; CvArr
-(defctype cv-array :pointer)
+(cffi:defctype cv-array :pointer)
;;; Operations on Arrays
;; void cvAbsDiff(const CvArr* src1, const CvArr* src2, CvArr* dst)
-(defcfun ("cvAbsDiff" abs-diff) :void
+(cffi:defcfun ("cvAbsDiff" abs-diff) :void
"Calculate the absolute difference between elements in SRC1 and SRC2
and store them in DEST."
(src1 cv-array)
(src2 cv-array)
(dest cv-array))
;; void cvAbsDiffS(const CvArr* src, CvArr* dst, CvScalar value)
-(defcfun ("cvAbsDiffS_glue" %abs-diff-scalar-glue) :void
+(cffi:defcfun ("cvAbsDiffS_glue" %abs-diff-scalar-glue) :void
(src cv-array)
(dest cv-array)
(s1 :double)
@@ -116,7 +116,7 @@ and store them in DEST."
;; void cvAddWeighted(const CvArr* src1, double alpha, const CvArr* src2,
;; double beta, double gamma, CvArr* dst)
-(defcfun ("cvAddWeighted" add-weighted) :void
+(cffi:defcfun ("cvAddWeighted" add-weighted) :void
(src1 cv-array)
(alpha :double)
(src2 cv-array)
@@ -125,7 +125,7 @@ and store them in DEST."
(gamma :double))
;; void cvCopy(const CvArr* src, CvArr* dst, const CvArr* mask=NULL)
-(defcfun ("cvCopy" %copy) :void
+(cffi:defcfun ("cvCopy" %copy) :void
(src cv-array)
(dest cv-array)
(mask cv-array))
@@ -136,7 +136,7 @@ are copied."
(%copy src dest mask))
;; IplImage* cvCreateImage(CvSize size, int depth, int channels)
-(defcfun ("cvCreateImage" %create-image) ipl-image
+(cffi:defcfun ("cvCreateImage" %create-image) ipl-image
(size :int64)
(depth :int)
(channels :int))
@@ -148,7 +148,7 @@ channel, and CHANNELS number of channels."
(%create-image nsize depth channels)))
;; CvSize cvGetSize(const CvArr* arr)
-(defcfun ("cvGetSize" %get-size) :int64
+(cffi:defcfun ("cvGetSize" %get-size) :int64
(arr cv-array))
(defun get-size (arr)
@@ -158,7 +158,7 @@ dimensions."
(int64->cv-size nsize)))
;; void cvReleaseImage(IplImage** image)
-(defcfun ("cvReleaseImage" %release-image) :void
+(cffi:defcfun ("cvReleaseImage" %release-image) :void
(image-ptr :pointer))
(defun release-image (image)
@@ -168,13 +168,13 @@ dimensions."
(%release-image image-ptr)))
;; void cvResetImageROI(IplImage* image)
-(defcfun ("cvResetImageROI" reset-image-roi) :void
+(cffi:defcfun ("cvResetImageROI" reset-image-roi) :void
"Reset the ROI for IMAGE."
(image ipl-image))
;; void cvSetImageROI(IplImage* image, CvRect rect)
;; Note: the two int64 parameters actually represent a CvRect structure.
-(defcfun ("cvSetImageROI" %set-image-roi) :void
+(cffi:defcfun ("cvSetImageROI" %set-image-roi) :void
(image ipl-image)
(rect-i1 :int64)
(rect-i2 :int64))
@@ -186,7 +186,7 @@ dimensions."
;; void cvSub(const CvArr* src1, const CvArr* src2, CvArr* dst,
;; const CvArr* mask=NULL)
-(defcfun ("cvSub" %subtract) :void
+(cffi:defcfun ("cvSub" %subtract) :void
(src1 cv-array)
(src2 cv-array)
(dest cv-array)
@@ -200,7 +200,7 @@ limited range."
;; void cvSubS(const CvArr* src, CvScalar value, CvArr* dst,
;; const CvArr* mask=NULL)
-(defcfun ("cvSubS_glue" %subtract-scalar-glue) :void
+(cffi:defcfun ("cvSubS_glue" %subtract-scalar-glue) :void
(src cv-array)
(s1 :double)
(s2 :double)
@@ -218,7 +218,7 @@ non-zero."
;; void cvSubRS(const CvArr* src, CvScalar value, CvArr* dst,
;; const CvArr* mask=NULL)
-(defcfun ("cvSubRS_glue" %subtract-r-scalar-glue) :void
+(cffi:defcfun ("cvSubRS_glue" %subtract-r-scalar-glue) :void
(src cv-array)
(s1 :double)
(s2 :double)
View
@@ -8,10 +8,10 @@
;;; Types and structures
;; CvCapture
-(defctype cv-capture :pointer)
+(cffi:defctype cv-capture :pointer)
;; CvVideoWriter
-(defctype cv-video-writer :pointer)
+(cffi:defctype cv-video-writer :pointer)
@@ -23,7 +23,7 @@
(+cvtimg-swap-rb+ 2))
;; cvConvertImage(const CvArr *src, CvArr *dst, int flags)
-(defcfun ("cvConvertImage" %convert-image) :void
+(cffi:defcfun ("cvConvertImage" %convert-image) :void
(src ipl-image)
(dest ipl-image)
(flags :int))
@@ -38,11 +38,11 @@ switch as determined by FLAGS."
;; CvTrackbarCallback onChange)
;; void cvDestroyAllWindows(void)
-(defcfun ("cvDestroyAllWindows" destroy-all-windows) :void
+(cffi:defcfun ("cvDestroyAllWindows" destroy-all-windows) :void
"Destroy all named windows and free their resources.")
;; void cvDestroyWindow(const char* name)
-(defcfun ("cvDestroyWindow" destroy-window) :void
+(cffi:defcfun ("cvDestroyWindow" destroy-window) :void
"Destroy the named window with name NAME and free its resources."
(name :string))
@@ -51,7 +51,7 @@ switch as determined by FLAGS."
;; TODO int cvInitSystem(int argc, char** argv)
;; void cvMoveWindow(const char* name, int x, int y)
-(defcfun ("cvMoveWindow" move-window) :void
+(cffi:defcfun ("cvMoveWindow" move-window) :void
"Sets the position of the window NAME to X, Y."
(name :string)
(x :int)
@@ -64,7 +64,7 @@ switch as determined by FLAGS."
+window-normal+
+window-autosize+)
-(defcfun ("cvNamedWindow" %named-window) :int
+(cffi:defcfun ("cvNamedWindow" %named-window) :int
"Internal helper function for NAMED-WINDOW."
(name :string)
(flags :int))
@@ -76,7 +76,7 @@ contents. Note that current OpenCV only supports +WINDOW-AUTOSIZE+."
(%named-window name flags))
;; void cvResizeWindow(const char* name, int width, int height)¶
-(defcfun ("cvResizeWindow" resize-window) :void
+(cffi:defcfun ("cvResizeWindow" resize-window) :void
"Resize the window with name NAME to WIDTH by HEIGHT."
(name :string)
(width :int)
@@ -89,13 +89,13 @@ contents. Note that current OpenCV only supports +WINDOW-AUTOSIZE+."
;; const char* windowName, int pos)
;; void cvShowImage(const char* name, const CvArr* image)
-(defcfun ("cvShowImage" show-image) :void
+(cffi:defcfun ("cvShowImage" show-image) :void
"Show the picture IMAGE in the named window NAME."
(name :string)
(image ipl-image))
;; int cvWaitKey(int delay=0)
-(defcfun ("cvWaitKey" %wait-key) :int
+(cffi:defcfun ("cvWaitKey" %wait-key) :int
(delay :int))
(defun wait-key (&optional (delay 0))
@@ -117,7 +117,7 @@ pressed."
+load-image-anydepth+
(+load-image-anycolor+ 4))
-(defcfun ("cvLoadImage" %load-image) ipl-image
+(cffi:defcfun ("cvLoadImage" %load-image) ipl-image
(filename :string)
(is-color :int))
@@ -126,7 +126,7 @@ pressed."
"Load the image at path FILENAME using color options IS-COLOR."
(%load-image filename is-color))
-(defcfun ("cvLoadImageM" %load-image-m) cv-matrix
+(cffi:defcfun ("cvLoadImageM" %load-image-m) cv-matrix
(filename :string)
(is-color :int))
@@ -136,18 +136,18 @@ pressed."
(%load-image-m filename is-color))
;; int cvSaveImage(const char* filename, const CvArr* image)
-(defcfun ("cvSaveImage" save-image) :int
+(cffi:defcfun ("cvSaveImage" save-image) :int
"Save the image in IMAGE into the file FILENAME."
(filename :string)
(image ipl-image))
;; CvCapture* cvCreateCameraCapture(int index)
-(defcfun ("cvCreateCameraCapture" create-camera-capture) cv-capture
+(cffi:defcfun ("cvCreateCameraCapture" create-camera-capture) cv-capture
"Capture a video stream from the camera with index INDEX."
(index :int))
;; CvCapture* cvCreateFileCapture(const char* filename)
-(defcfun ("cvCreateFileCapture" create-file-capture) cv-capture
+(cffi:defcfun ("cvCreateFileCapture" create-file-capture) cv-capture
"Initializes capturing a video from the file FILENAME."
(filename :string))
@@ -174,32 +174,32 @@ pressed."
+cap-prop-rectification+); ? (only supported by DC1394 v 2.x backend)
;; double cvGetCaptureProperty(CvCapture* capture, int property_id)
-(defcfun ("cvGetCaptureProperty" get-capture-property) :double
+(cffi:defcfun ("cvGetCaptureProperty" get-capture-property) :double
"Retrieves that value of property PROPERTY-ID from the capture
stream CAPTURE."
(capture cv-capture)
(property-id :int))
;; int cvGrabFrame(CvCapture* capture)
-(defcfun ("cvGrabFrame" grab-frame) :int
+(cffi:defcfun ("cvGrabFrame" grab-frame) :int
"Grabs a frame from the video capture stream CAPTURE. The image is
stored internally. Use RETRIEVE-FRAME to retrieve the grabbed frame."
(capture cv-capture))
;; IplImage* cvQueryFrame(CvCapture* capture)
-(defcfun ("cvQueryFrame" query-frame) ipl-image
+(cffi:defcfun ("cvQueryFrame" query-frame) ipl-image
"Grab a frame from a video capture stream CAPTURE, decompress it and
return it."
(capture cv-capture))
-(defcfun ("cvReleaseCapture" %release-capture) :void
+(cffi:defcfun ("cvReleaseCapture" %release-capture) :void
(capture-ptr :pointer))
;; void cvReleaseCapture(CvCapture** capture)
(defun release-capture (capture)
"Release the resources use by the capture stream CAPTURE."
- (with-foreign-object (capture-ptr :pointer)
- (setf (mem-ref capture-ptr :pointer) capture)
+ (cffi:with-foreign-object (capture-ptr :pointer)
+ (setf (cffi:mem-ref capture-ptr :pointer) capture)
(%release-capture capture-ptr)))
(defmacro with-capture ((capture-var capture) &body body)
@@ -210,12 +210,12 @@ return it."
(release-capture ,capture-var))))
;; IplImage* cvRetrieveFrame(CvCapture* capture)
-(defcfun ("cvRetrieveFrame" retrieve-frame) ipl-image
+(cffi:defcfun ("cvRetrieveFrame" retrieve-frame) ipl-image
"Returns a pointer to the last image grabbed from CAPTURE-SRC with
GRAB-FRAME."
(capture cv-capture))
-(defcfun ("cvSetCaptureProperty" %set-capture-property) :int
+(cffi:defcfun ("cvSetCaptureProperty" %set-capture-property) :int
(capture cv-capture)
(property-id :int)
(value :double))
Oops, something went wrong.

0 comments on commit b42adf4

Please sign in to comment.