(mat :t ....)
(mat :t 4 4 0) ...etc
Any guidance on this is very important and much, much appreciated:)
Code: Select all
;; Mat::Mat()
;; Mat* cv_create_Mat()
(defcfun ("cv_create_Mat" %mat) mat
"MAT constructor")
;; Mat::Mat()
;; Mat* cv_create_Mat()
(defcfun ("cv_create_Mat" %%mat) (mat :garbage-collect t)
"MAT constructor")
;; Mat::Mat(int rows, int cols, int type)
;; Mat* cv_create_Mat_typed(int rows, int cols, int type)
(defcfun ("cv_create_Mat_typed" %mat-typed) mat
"MAT constructor with a row, column and type parameter."
(rows :int)
(cols :int)
(type :int))
;; Mat::Mat(int rows, int cols, int type)
;; Mat* cv_create_Mat_typed(int rows, int cols, int type)
(defcfun ("cv_create_Mat_typed" %%mat-typed) (mat :garbage-collect t)
"MAT constructor with a row, column and type parameter."
(rows :int)
(cols :int)
(type :int))
(defun mat-typed (&rest args)
(cond ((eq (fourth args) nil) (%mat-typed (first args) (second args) (third args)))
((eq :t (car args)) (%%mat-typed (second args) (third args) (fourth args)))
(t nil)))
;; Mat::Mat(int rows, int cols, int type, const Scalar& s)
;; Mat* cv_create_Mat_with_value(int rows, int cols, int type, Scalar* s)
(defcfun ("cv_create_Mat_with_value" %mat-value) mat
(rows :int)
(cols :int)
(type :int)
(s scalar))
;; Mat::Mat(int rows, int cols, int type, const Scalar& s)
;; Mat* cv_create_Mat_with_value(int rows, int cols, int type, Scalar* s)
(defcfun ("cv_create_Mat_with_value" %%mat-value) (mat :garbage-collect t)
(rows :int)
(cols :int)
(type :int)
(s scalar))
;; Mat::Mat(int rows, int cols, int type, void* data)
;; Mat* cv_create_Mat_with_data(int rows, int cols, int type, void* data)
(defcfun ("cv_create_Mat_with_data" %mat-data) mat
(rows :int)
(cols :int)
(type :int)
(data :pointer))
;; Mat::Mat(int rows, int cols, int type, void* data)
;; Mat* cv_create_Mat_with_data(int rows, int cols, int type, void* data)
(defcfun ("cv_create_Mat_with_data" %%mat-data) (mat :garbage-collect t)
(rows :int)
(cols :int)
(type :int)
(data :pointer))
Code: Select all
(defun mat (&rest args)
(cond ((eq (first args) nil) (%mat))
((and (eq :t (first args)) (not (second args))) (%%mat))
((and (eq (fourth args) nil) (first args))
(%mat-typed (first args) (second args) (third args)))
((and (eq (first args) :t) (eq (fifth args) nil))
(%%mat-typed (second args) (third args) (fourth args)))
((eq (type-of (fourth args)) 'cv-scalar)
(%mat-value (first args) (second args) (third args) (fourth args)))
((and (eq (first args) :t) (eq (type-of (fifth args)) 'cv-scalar))
(%%mat-value (second args) (third args) (fourth args) (fifth args)))
((pointerp (fourth args))
(%mat-data (first args) (second args) (third args) (fourth args)))
((and (eq (first args) :t) (pointerp (fifth args)))
(%%mat-data (second args) (third args) (fourth args) (fifth args)))
(t nil)))