The below finalizer is for the %mat defcfun below that.
How do I update the finalizer below to be for the mat-data defcfun at the
bottom of the page. So where do I put the rows cols params, there seems
to be no place for them in the defstruct wwhere %mat is called. Any
help is appreciated
Code: Select all
(defstruct (cvmatrix (:constructor %make-cvmatrix))
(sap (%mat) :type sb-sys:system-area-pointer :read-only t))
(defun make-cvmatrix (&optional enable-finalizer)
(let* ((matrix (%make-cvmatrix))
(sap (cvmatrix-sap matrix)))
(when enable-finalizer
(tg:finalize matrix (lambda () (del-mat sap))))
sap))
(defcfun ("cv_create_Mat" %mat) (:pointer mat)
"MAT constructor")
;; 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) (:pointer mat)
(rows :int)
(cols :int)
(type :int)
(data :pointer))