You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+13-9Lines changed: 13 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,13 +11,18 @@
11
11
12
12
If you want to add new opencv API/Module,
13
13
14
-
1. build [libdartcv](https://github.com/rainyl/dartcv/blob/main/README.md) from source
15
-
2. add new C wrappers in `src` and make sure it is correctly build
16
-
3. add your `.h` file to ffigen in [dartcv4](https://github.com/rainyl/opencv_dart/tree/main/packages/dartcv) and run `dart run ffigen --config ffigen.yaml`
17
-
4. add corresponding dart code in [lib](https://github.com/rainyl/opencv_dart/tree/main/packages/dartcv/lib)
18
-
5. write testing code and test whether it works as expected
19
-
20
-
Note: C wrappers should be added to [dartcv](https://github.com/rainyl/dartcv) and dart bindings should be added to [dartcv4](https://github.com/rainyl/opencv_dart/tree/main/packages/dartcv)
14
+
1. take a look at OpenCV official documents and make sure the required functions/modules are absent in opencv_dart
15
+
2. the native C/C++ code is managed by CMake, you will find a `CMakeLists.txt` in `packages/dartcv/src`
16
+
3. add new C wrappers in `packages/dartcv/src/dartcv` and make sure it is correctly build, Note:
17
+
- take a look at the existed code, especially `packages/dartcv/src/dartcv/core/types.h` which defines basic structures
18
+
- if you want to add new modules, create a new directory in `packages/dartcv/src/dartcv`, e.g., `packages/dartcv/src/dartcv/cuda`
19
+
- nearly all C-wrappers of C++ class/struct are wrapped in a struct, you can define a C wrapper of a C++ class via `CVD_TYPEDEF`, e.g., `CVD_TYPEDEF(cv::Mat, Mat)`
20
+
4. add your `.h` file to ffigen in [dartcv4](https://github.com/rainyl/opencv_dart/tree/main/packages/dartcv/ffigen) and run `dart run ffigen --config ffigen.yaml`, this will generate corresponding dart:ffi wrappers.
21
+
5. add corresponding dart code in [lib](https://github.com/rainyl/opencv_dart/tree/main/packages/dartcv/lib)
22
+
6. write testing code and test whether it works as expected, you can refer to [OpencvSharp](https://github.com/shimat/opencvsharp) and [gocv](https://github.com/hybridgroup/gocv) to write tests.
23
+
24
+
~~Note: C wrappers should be added to [dartcv](https://github.com/rainyl/dartcv) and dart bindings should be added to [dartcv4](https://github.com/rainyl/opencv_dart/tree/main/packages/dartcv)~~
25
+
Since `2.x`, C/C++ code are embeded to this (opencv_dart) repo and no longer needed to develop separetely, just implement your C/C++ code in `packages/dartcv/src/dartcv` and it will be processed by dart native hooks.
0 commit comments