Skip to content

Commit af8dbaa

Browse files
author
Flutterclutter
committed
Implement missing function "processImage"
1 parent 761f962 commit af8dbaa

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

lib/edge_detection.dart

+21
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,27 @@ class EdgeDetection {
107107
);
108108
}
109109

110+
static Future<bool> processImage(String path, EdgeDetectionResult result) async {
111+
DynamicLibrary nativeEdgeDetection = _getDynamicLibrary();
112+
113+
final processImage = nativeEdgeDetection
114+
.lookup<NativeFunction<process_image_function>>("process_image")
115+
.asFunction<ProcessImageFunction>();
116+
117+
118+
return processImage(
119+
Utf8.toUtf8(path),
120+
result.topLeft.dx,
121+
result.topLeft.dy,
122+
result.topRight.dx,
123+
result.topRight.dy,
124+
result.bottomLeft.dx,
125+
result.bottomLeft.dy,
126+
result.bottomRight.dx,
127+
result.bottomRight.dy
128+
) == 1;
129+
}
130+
110131
static DynamicLibrary _getDynamicLibrary() {
111132
final DynamicLibrary nativeEdgeDetection = Platform.isAndroid
112133
? DynamicLibrary.open("libnative_edge_detection.so")

0 commit comments

Comments
 (0)