Use C++ Mat object

Esse commit está contido em:
Michael Maclean
2013-01-02 20:16:17 +00:00
commit 8847e8fea8
2 arquivos alterados com 4 adições e 3 exclusões
+2 -2
Ver Arquivo
@@ -37,7 +37,7 @@ static inline opencv_mat_object* opencv_mat_object_get(zval *zobj TSRMLS_DC) {
void opencv_mat_object_destroy(void *object TSRMLS_DC)
{
opencv_mat_object *mat = (opencv_mat_object *)object;
delete mat->cvptr;
zend_hash_destroy(mat->std.properties);
FREE_HASHTABLE(mat->std.properties);
@@ -85,7 +85,7 @@ PHP_METHOD(OpenCV_Mat, __construct)
PHP_OPENCV_RESTORE_ERRORS();
object = (opencv_mat_object *) zend_object_store_get_object(getThis() TSRMLS_CC);
object->cvptr = cvCreateMat(rows, cols, type);
object->cvptr = new Mat(rows, cols, type);
php_opencv_throw_exception();
}
/* }}} */
+2 -1
Ver Arquivo
@@ -61,6 +61,7 @@ extern zend_module_entry opencv_module_entry;
#include <opencv2/opencv.hpp>
#include <opencv2/highgui/highgui.hpp>
using namespace cv;
PHP_MINIT_FUNCTION(opencv);
PHP_MINIT_FUNCTION(opencv_error);
@@ -90,7 +91,7 @@ typedef struct _opencv_arr_object {
typedef struct _opencv_mat_object {
zend_object std;
zend_bool constructed;
CvMat *cvptr;
Mat *cvptr;
} opencv_mat_object;
typedef struct _opencv_image_object {