rainyl / opencv_dart

OpenCV bindings for Dart language and Flutter.
https://pub.dev/packages/opencv_dart
Apache License 2.0
78 stars 10 forks source link

Add Mat.dataPtr to allow access data pointer #90

Closed rainyl closed 2 weeks ago

rainyl commented 2 weeks ago

Currently only Mat.data exists, which will return a Uint8List, but in some cases, users want to access data pointer directly for better performance, e.g., play videos and set the data of a texture with raw pointer.

TODO:

// get the data pinter of a Mat
// DO NOT free by yourself, the memory is managed by Mat
(int length, ffi.Pointer<ffi.Uint8> ptr) get dataPtr(){}