From d02926528dabd866c57737eeee86b78f028c48a8 Mon Sep 17 00:00:00 2001 From: Abdelaziz Mahdy Date: Wed, 27 Nov 2024 15:54:59 -0400 Subject: [PATCH 1/2] make file auto clone --- packages/dartcv/Makefile | 37 ++++++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/packages/dartcv/Makefile b/packages/dartcv/Makefile index 7239c42c..76b8a5ce 100644 --- a/packages/dartcv/Makefile +++ b/packages/dartcv/Makefile @@ -1,6 +1,10 @@ -.PHONY: ffigen ffigen_test +.PHONY: ffigen ffigen_test clone_repo clean_repo -ffigen: +REPO_URL=https://github.com/rainyl/dartcv.git +TEMP_DIR=temp_repo +SRC_DIR=src/dartcv + +ffigen: clone_repo dart run ffigen --config ffigen/ffigen_const.yaml dart run ffigen --config ffigen/ffigen_types.yaml dart run ffigen --config ffigen/ffigen_core.yaml @@ -17,7 +21,34 @@ ffigen: dart run ffigen --config ffigen/ffigen_stitching.yaml dart run ffigen --config ffigen/ffigen_video.yaml dart run ffigen --config ffigen/ffigen_videoio.yaml + $(MAKE) clean_repo + +# Clone the repo and move only the dartcv directory +clone_repo: + @if [ -d "$(SRC_DIR)" ]; then \ + echo "Directory $(SRC_DIR) exists. Deleting it."; \ + rm -rf $(SRC_DIR); \ + fi; \ + if [ -d "$(TEMP_DIR)" ]; then \ + rm -rf $(TEMP_DIR); \ + fi; \ + echo "Cloning repository..."; \ + git clone $(REPO_URL) $(TEMP_DIR); \ + echo "Moving dartcv directory to $(SRC_DIR)..."; \ + mkdir -p src; \ + mv $(TEMP_DIR)/dartcv $(SRC_DIR); \ + echo "Cleaning up temporary files..."; \ + rm -rf $(TEMP_DIR); + +copy_files: + mkdir -p src; \ + mv $(TEMP_DIR)/dartcv $(SRC_DIR); +# Clean up the dartcv directory from the src directory +clean_repo: + @rm -rf $(SRC_DIR) + @rm -rf $(TEMP_DIR) -ffigen_test: +ffigen_test: clone_repo dart run ffigen --config ffigen/ffigen_types.yaml dart run ffigen --config ffigen/ffigen_core.yaml + $(MAKE) clean_repo From bc98fd4a3a3929360e3374fd90761c722cd9a149 Mon Sep 17 00:00:00 2001 From: Abdelaziz Mahdy Date: Wed, 27 Nov 2024 21:09:15 -0400 Subject: [PATCH 2/2] updating the make file --- packages/dartcv/Makefile | 34 +++------------- packages/dartcv/lib/src/g/core.yaml | 8 ++-- packages/dartcv/lib/src/g/imgproc.g.dart | 51 ++++++++++++++++++++++++ packages/dartcv/lib/src/g/imgproc.yaml | 4 ++ packages/dartcv/src | 2 +- 5 files changed, 66 insertions(+), 33 deletions(-) diff --git a/packages/dartcv/Makefile b/packages/dartcv/Makefile index 76b8a5ce..3405feea 100644 --- a/packages/dartcv/Makefile +++ b/packages/dartcv/Makefile @@ -1,8 +1,5 @@ .PHONY: ffigen ffigen_test clone_repo clean_repo -REPO_URL=https://github.com/rainyl/dartcv.git -TEMP_DIR=temp_repo -SRC_DIR=src/dartcv ffigen: clone_repo dart run ffigen --config ffigen/ffigen_const.yaml @@ -21,34 +18,15 @@ ffigen: clone_repo dart run ffigen --config ffigen/ffigen_stitching.yaml dart run ffigen --config ffigen/ffigen_video.yaml dart run ffigen --config ffigen/ffigen_videoio.yaml - $(MAKE) clean_repo -# Clone the repo and move only the dartcv directory + clone_repo: - @if [ -d "$(SRC_DIR)" ]; then \ - echo "Directory $(SRC_DIR) exists. Deleting it."; \ - rm -rf $(SRC_DIR); \ - fi; \ - if [ -d "$(TEMP_DIR)" ]; then \ - rm -rf $(TEMP_DIR); \ - fi; \ - echo "Cloning repository..."; \ - git clone $(REPO_URL) $(TEMP_DIR); \ - echo "Moving dartcv directory to $(SRC_DIR)..."; \ - mkdir -p src; \ - mv $(TEMP_DIR)/dartcv $(SRC_DIR); \ - echo "Cleaning up temporary files..."; \ - rm -rf $(TEMP_DIR); - -copy_files: - mkdir -p src; \ - mv $(TEMP_DIR)/dartcv $(SRC_DIR); -# Clean up the dartcv directory from the src directory -clean_repo: - @rm -rf $(SRC_DIR) - @rm -rf $(TEMP_DIR) + echo "Getting submodules" + @git submodule update --init --recursive + + echo "Updating submodules" + @git submodule update --remote ffigen_test: clone_repo dart run ffigen --config ffigen/ffigen_types.yaml dart run ffigen --config ffigen/ffigen_core.yaml - $(MAKE) clean_repo diff --git a/packages/dartcv/lib/src/g/core.yaml b/packages/dartcv/lib/src/g/core.yaml index 7e977632..b1e87a0f 100644 --- a/packages/dartcv/lib/src/g/core.yaml +++ b/packages/dartcv/lib/src/g/core.yaml @@ -628,12 +628,12 @@ files: name: registerErrorCallback c:@F@setLogLevel: name: setLogLevel - c:@T@double_t: - name: double_t - c:@T@float_t: - name: float_t c:exception.h@T@ErrorCallback: name: ErrorCallback + c:math.h@T@double_t: + name: double_t + c:math.h@T@float_t: + name: float_t c:types.h@T@CvPoint: name: CvPoint c:types.h@T@CvRect: diff --git a/packages/dartcv/lib/src/g/imgproc.g.dart b/packages/dartcv/lib/src/g/imgproc.g.dart index d71616b4..37711f99 100644 --- a/packages/dartcv/lib/src/g/imgproc.g.dart +++ b/packages/dartcv/lib/src/g/imgproc.g.dart @@ -2714,6 +2714,43 @@ class CvNativeImgproc { ffi.Pointer Function( Mat, Mat, Mat, Mat, int, int, imp1.CvCallback_0)>(); + ffi.Pointer cv_intersectConvexConvex( + VecPoint p1, + VecPoint p2, + ffi.Pointer p12, + bool handleNested, + ffi.Pointer rval, + imp1.CvCallback_0 callback, + ) { + return _cv_intersectConvexConvex( + p1, + p2, + p12, + handleNested, + rval, + callback, + ); + } + + late final _cv_intersectConvexConvexPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + VecPoint, + VecPoint, + ffi.Pointer, + ffi.Bool, + ffi.Pointer, + imp1.CvCallback_0)>>('cv_intersectConvexConvex'); + late final _cv_intersectConvexConvex = + _cv_intersectConvexConvexPtr.asFunction< + ffi.Pointer Function( + VecPoint, + VecPoint, + ffi.Pointer, + bool, + ffi.Pointer, + imp1.CvCallback_0)>(); + ffi.Pointer cv_invertAffineTransform( Mat src, Mat dst, @@ -2734,6 +2771,20 @@ class CvNativeImgproc { _cv_invertAffineTransformPtr.asFunction< ffi.Pointer Function(Mat, Mat, imp1.CvCallback_0)>(); + bool cv_isContourConvex( + VecPoint contour, + ) { + return _cv_isContourConvex( + contour, + ); + } + + late final _cv_isContourConvexPtr = + _lookup>( + 'cv_isContourConvex'); + late final _cv_isContourConvex = + _cv_isContourConvexPtr.asFunction(); + ffi.Pointer cv_line( Mat img, CvPoint pt1, diff --git a/packages/dartcv/lib/src/g/imgproc.yaml b/packages/dartcv/lib/src/g/imgproc.yaml index 9dbe7fd8..f3a98401 100644 --- a/packages/dartcv/lib/src/g/imgproc.yaml +++ b/packages/dartcv/lib/src/g/imgproc.yaml @@ -206,8 +206,12 @@ files: name: cv_grabCut c:@F@cv_integral: name: cv_integral + c:@F@cv_intersectConvexConvex: + name: cv_intersectConvexConvex c:@F@cv_invertAffineTransform: name: cv_invertAffineTransform + c:@F@cv_isContourConvex: + name: cv_isContourConvex c:@F@cv_line: name: cv_line c:@F@cv_linearPolar: diff --git a/packages/dartcv/src b/packages/dartcv/src index 9394c165..75b1be38 160000 --- a/packages/dartcv/src +++ b/packages/dartcv/src @@ -1 +1 @@ -Subproject commit 9394c165f3404a696209eb316d3a3e49cb7a8526 +Subproject commit 75b1be38ac50c58a5c7e18d80a4826a0124c513f