Skip to content

Commit

Permalink
add dartcv_core_flutter, dartcv_videoio_flutter
Browse files Browse the repository at this point in the history
  • Loading branch information
rainyl committed Oct 8, 2024
1 parent ff6f43f commit e0ca18b
Show file tree
Hide file tree
Showing 428 changed files with 56,006 additions and 14,688 deletions.
61 changes: 61 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
cmake_minimum_required(VERSION 3.15)

project(opencv_dart_library VERSION 1.0.0 LANGUAGES C CXX)
set(LIBRARY_NAME "opencv_dart")

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS TRUE)

option(DARTCV_WITH_CORE
"Include core, calib3d, features2d, imgcodecs, imgproc, photo, stitching, video models of opencv"
ON
)
option(DARTCV_WITH_DNN "Include dnn module of opencv" ON)
option(DARTCV_WITH_OBJDETECT "Include objdetect module of opencv" ON)
option(DARTCV_WITH_VIDEO "Include video module of opencv" ON)
option(DARTCV_WITH_HIGHGUI "Include highgui module of opencv" OFF)
option(DARTCV_WITH_CONTRIB "Include contrib module of opencv" ON)
option(DARTCV_WITH_VIDEOIO "Include objdetect module of opencv" OFF)
option(DARTCV_WITH_GAPI "Include gapi of opencv" OFF) # TODO: not finished
option(DARTCV_WORLD "Include all modules" OFF)

option(BUILD_WITH_STATIC_CRT "Build with static CRT" ON)
option(DARTCV_DISABLE_DOWNLOAD_OPENCV "Download opencv sdk from opencv.full" OFF)

set(OPENCV_VERSION "4.10.0+9")

# Avoid warning about DOWNLOAD_EXTRACT_TIMESTAMP in CMake 3.24:
if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0")
cmake_policy(SET CMP0135 NEW)
endif()

# ============ download and prepare OpenCV =========
include(cmake/download_setup_opencv.cmake)

if(LINUX OR APPLE)
find_package(Iconv REQUIRED)
endif()

# ============ download and prepare OpenCV_DIR finished ==============
find_package(OpenCV REQUIRED)

if(DARTCV_WITH_HIGHGUI OR DARTCV_WITH_VIDEOIO)
find_package(FFMPEG REQUIRED)
endif()

set(OPENCV_DART_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src)

message(STATUS "OpenCV library status:")
message(STATUS " config: ${OpenCV_DIR}")
message(STATUS " version: ${OpenCV_VERSION}")
message(STATUS " libraries: ${OpenCV_LIBS}")
message(STATUS " include path: ${OpenCV_INCLUDE_DIRS}")
message(STATUS "Project version: ${PROJECT_VERSION}")

if(DARTCV_WORLD)
find_package(FFMPEG REQUIRED)
add_subdirectory(src/world)
else()
add_subdirectory(src)
endif()
2 changes: 1 addition & 1 deletion pkgs/dartcv_core/.pubignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ publish/
# Files and directories created by pub
.dart_tool/
.packages
build*/
build/
# If you're building an application, you may want to check-in your pubspec.lock
pubspec.lock

Expand Down
4 changes: 4 additions & 0 deletions pkgs/dartcv_core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.0.1-dev.2

* add dnn, contrib, objdetect to dartcv_core

## 0.0.1-dev.1

* support local build for ios and macos
Expand Down
123 changes: 78 additions & 45 deletions pkgs/dartcv_core/ffigen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,56 +11,88 @@ import:
- 'package:dartcv_core/src/g/types.yaml'
# ffi-native:
# assetId: 'package:dartcv_core/dartcv_core.dart' # Optional.
compiler-opts: "-Isrc"
compiler-opts: "-Isrc -I../../src"
sort: true
include-unused-typedefs: true
headers:
entry-points:
- src/core.h
- src/core_async.h
- src/exception.h
- src/svd.h
- src/svd_async.h
- src/vec.h
- src/version.h
- src/logging.h
- src/imgcodecs.h
- src/imgcodecs_async.h
- src/imgproc.h
- src/imgproc_async.h
- src/calib3d.h
- src/calib3d_async.h
- src/features2d.h
- src/features2d_async.h
- src/photo.h
- src/photo_async.h
- src/stitching.h
- src/stitching_async.h
- src/video.h
- src/video_async.h
- ../../src/core/core.h
- ../../src/core/core_async.h
- ../../src/core/exception.h
- ../../src/core/svd.h
- ../../src/core/svd_async.h
- ../../src/core/vec.h
- ../../src/core/version.h
- ../../src/core/logging.h
- ../../src/imgcodecs/imgcodecs.h
- ../../src/imgcodecs/imgcodecs_async.h
- ../../src/imgproc/imgproc.h
- ../../src/imgproc/imgproc_async.h
- ../../src/calib3d/calib3d.h
- ../../src/calib3d/calib3d_async.h
- ../../src/features2d/features2d.h
- ../../src/features2d/features2d_async.h
- ../../src/photo/photo.h
- ../../src/photo/photo_async.h
- ../../src/stitching/stitching.h
- ../../src/stitching/stitching_async.h
- ../../src/video/video.h
- ../../src/video/video_async.h
- ../../src/contrib/aruco.h
- ../../src/contrib/aruco_async.h
- ../../src/contrib/img_hash.h
- ../../src/contrib/img_hash_async.h
- ../../src/contrib/quality.h
- ../../src/contrib/quality_async.h
- ../../src/contrib/wechat_qrcode.h
- ../../src/contrib/ximgproc.h
- ../../src/contrib/ximgproc_async.h
- ../../src/contrib/xobjdetect.h
- ../../src/contrib/wechat_qrcode_async.h
- ../../src/dnn/asyncarray.h
- ../../src/dnn/dnn.h
- ../../src/dnn/dnn_async.h
- ../../src/objdetect/objdetect.h
- ../../src/objdetect/objdetect_async.h
include-directives:
- src/core.h
- src/core_async.h
- src/exception.h
- src/svd.h
- src/svd_async.h
- src/vec.h
- src/version.h
- src/logging.h
- src/imgcodecs.h
- src/imgcodecs_async.h
- src/imgproc.h
- src/imgproc_async.h
- src/calib3d.h
- src/calib3d_async.h
- src/features2d.h
- src/features2d_async.h
- src/photo.h
- src/photo_async.h
- src/stitching.h
- src/stitching_async.h
- src/video.h
- src/video_async.h
- ../../src/core/core.h
- ../../src/core/core_async.h
- ../../src/core/exception.h
- ../../src/core/svd.h
- ../../src/core/svd_async.h
- ../../src/core/vec.h
- ../../src/core/version.h
- ../../src/core/logging.h
- ../../src/imgcodecs/imgcodecs.h
- ../../src/imgcodecs/imgcodecs_async.h
- ../../src/imgproc/imgproc.h
- ../../src/imgproc/imgproc_async.h
- ../../src/calib3d/calib3d.h
- ../../src/calib3d/calib3d_async.h
- ../../src/features2d/features2d.h
- ../../src/features2d/features2d_async.h
- ../../src/photo/photo.h
- ../../src/photo/photo_async.h
- ../../src/stitching/stitching.h
- ../../src/stitching/stitching_async.h
- ../../src/video/video.h
- ../../src/video/video_async.h
- ../../src/contrib/aruco.h
- ../../src/contrib/aruco_async.h
- ../../src/contrib/img_hash.h
- ../../src/contrib/img_hash_async.h
- ../../src/contrib/quality.h
- ../../src/contrib/quality_async.h
- ../../src/contrib/wechat_qrcode.h
- ../../src/contrib/ximgproc.h
- ../../src/contrib/ximgproc_async.h
- ../../src/contrib/xobjdetect.h
- ../../src/contrib/wechat_qrcode_async.h
- ../../src/dnn/asyncarray.h
- ../../src/dnn/dnn.h
- ../../src/dnn/dnn_async.h
- ../../src/objdetect/objdetect.h
- ../../src/objdetect/objdetect_async.h
functions:
leaf:
include:
Expand Down Expand Up @@ -88,6 +120,7 @@ functions:
symbol-address:
include:
- ".*_Close.*"
- ".*_close.*"
# exclude: # If you only use exclude, then everything not excluded is generated.
# - "dispose"

Expand Down
4 changes: 2 additions & 2 deletions pkgs/dartcv_core/ffigen_const.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ sort: true
include-unused-typedefs: true
headers:
entry-points:
- src/constants.h
- ../../src/core/constants.h
include-directives:
- src/constants.h
- ../../src/core/constants.h

preamble: |
// dartcv_core - OpenCV bindings for Dart language
Expand Down
6 changes: 3 additions & 3 deletions pkgs/dartcv_core/ffigen_types.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ output:
import-path: 'package:dartcv_core/src/g/types.g.dart'
# ffi-native:
# assetId: 'package:dartcv_core/dartcv_core.dart' # Optional.
compiler-opts: "-Isrc"
compiler-opts: "-Isrc -I../../src"
sort: true
include-unused-typedefs: true
headers:
entry-points:
- src/types.h
- ../../src/core/types.h
include-directives:
- src/types.h
- ../../src/core/types.h

functions:
symbol-address:
Expand Down
15 changes: 15 additions & 0 deletions pkgs/dartcv_core/lib/dartcv_core.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ library cv.core;
export 'src/calib3d/calib3d.dart';
export 'src/calib3d/calib3d_async.dart';
export 'src/calib3d/fisheye.dart';
export 'src/contrib/aruco.dart';
export 'src/contrib/aruco_async.dart';
export 'src/contrib/aruco_dict.dart';
export 'src/contrib/img_hash.dart';
export 'src/contrib/quality.dart';
export 'src/contrib/wechat_qrcode.dart';
export 'src/contrib/wechat_qrcode_async.dart';
export 'src/contrib/ximgproc.dart';
export 'src/contrib/xobjdetect.dart';
export 'src/core/base.dart';
export 'src/core/contours.dart';
export 'src/core/core.dart';
Expand All @@ -30,6 +39,9 @@ export 'src/core/size.dart';
export 'src/core/svd.dart';
export 'src/core/termcriteria.dart';
export 'src/core/vec.dart';
export 'src/dnn/asyncarray.dart';
export 'src/dnn/dnn.dart';
export 'src/dnn/dnn_async.dart';
export 'src/features2d/features2d.dart';
export 'src/features2d/features2d_async.dart';
export 'src/g/constants.g.dart';
Expand All @@ -41,9 +53,12 @@ export 'src/imgproc/imgproc.dart';
export 'src/imgproc/imgproc_async.dart';
export 'src/imgproc/subdiv2d.dart';
export 'src/imgproc/subdiv2d_async.dart';
export 'src/objdetect/objdetect.dart';
export 'src/objdetect/objdetect_async.dart';
export 'src/photo/photo.dart';
export 'src/photo/photo_async.dart';
export 'src/stitching/stitching.dart';
export 'src/stitching/stitching_async.dart';
export 'src/video/video.dart';
export 'src/video/video_async.dart';

Loading

0 comments on commit e0ca18b

Please sign in to comment.