Skip to content

Commit 033b500

Browse files
authored
Add docs for VecVec* operator[] (#350)
* add docs for VecVec* operator [], format code * format code * dart format ✅
1 parent 57bd2c3 commit 033b500

22 files changed

+6199
-10008
lines changed

packages/dartcv/analysis_options.yaml

+1-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ analyzer:
3939
non_constant_identifier_names: ignore
4040
parameter_assignments: error
4141
formatter:
42-
pagewidth: 110
42+
page_width: 110
4343

4444
linter:
4545
rules:
@@ -217,7 +217,6 @@ linter:
217217
- unnecessary_this
218218
- unnecessary_to_list_in_spreads
219219
- unrelated_type_equality_checks
220-
- unsafe_html
221220
- use_build_context_synchronously
222221
- use_colored_box
223222
- use_decorated_box

packages/dartcv/lib/src/core/dmatch.dart

+4
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,10 @@ class VecVecDMatch extends VecUnmodifible<cvg.VecVecDMatch, VecDMatch> {
196196
@override
197197
ffi.Pointer<ffi.Void> asVoid() => ref.ptr.cast<ffi.Void>();
198198

199+
/// Returns a **reference**
200+
///
201+
/// Note: the memory of returned [VecDMatch] is owned by this [VecVecDMatch],
202+
/// explicitly call [VecDMatch.clone] if the parent [VecVecDMatch] may be disposed.
199203
@override
200204
VecDMatch operator [](int idx) =>
201205
VecDMatch.fromPointer(ccore.std_VecVecDMatch_get_p(ptr, idx), attach: false);

packages/dartcv/lib/src/core/point.dart

+12
Original file line numberDiff line numberDiff line change
@@ -635,6 +635,10 @@ class VecVecPoint extends VecUnmodifible<cvg.VecVecPoint, VecPoint> {
635635
@override
636636
ffi.Pointer<ffi.Void> asVoid() => ref.ptr.cast<ffi.Void>();
637637

638+
/// Returns a **reference**
639+
///
640+
/// Note: the memory of returned [VecPoint] is owned by this [VecVecPoint],
641+
/// explicitly call [VecPoint.clone] if the parent [VecVecPoint] may be disposed.
638642
@override
639643
VecPoint operator [](int idx) => VecPoint.fromPointer(ccore.std_VecVecPoint_get_p(ptr, idx), attach: false);
640644

@@ -711,6 +715,10 @@ class VecVecPoint2f extends VecUnmodifible<cvg.VecVecPoint2f, VecPoint2f> {
711715
@override
712716
ffi.Pointer<ffi.Void> asVoid() => ref.ptr.cast<ffi.Void>();
713717

718+
/// Returns a **reference**
719+
///
720+
/// Note: the memory of returned [VecPoint2f] is owned by this [VecVecPoint2f],
721+
/// explicitly call [VecPoint2f.clone] if the parent [VecVecPoint2f] may be disposed.
714722
@override
715723
VecPoint2f operator [](int idx) =>
716724
VecPoint2f.fromPointer(ccore.std_VecVecPoint2f_get_p(ptr, idx), attach: false);
@@ -789,6 +797,10 @@ class VecVecPoint3f extends VecUnmodifible<cvg.VecVecPoint3f, VecPoint3f> {
789797
@override
790798
ffi.Pointer<ffi.Void> asVoid() => ref.ptr.cast<ffi.Void>();
791799

800+
/// Returns a **reference**
801+
///
802+
/// Note: the memory of returned [VecPoint3f] is owned by this [VecVecPoint3f],
803+
/// explicitly call [VecPoint3f.clone] if the parent [VecVecPoint3f] may be disposed.
792804
@override
793805
VecPoint3f operator [](int idx) =>
794806
VecPoint3f.fromPointer(ccore.std_VecVecPoint3f_get_p(ptr, idx), attach: false);

packages/dartcv/lib/src/core/vec.dart

+4
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,10 @@ class VecVecChar extends VecUnmodifible<cvg.VecVecChar, VecChar> {
349349
@override
350350
ffi.Pointer<ffi.Void> asVoid() => throw UnsupportedError('Not supported');
351351

352+
/// Returns a **reference**
353+
///
354+
/// Note: the memory of returned [VecChar] is owned by this [VecVecChar],
355+
/// explicitly call [VecChar.clone] if the parent [VecVecChar] may be disposed.
352356
@override
353357
VecChar operator [](int idx) => VecChar.fromPointer(ccore.std_VecVecChar_get(ptr, idx), attach: false);
354358

0 commit comments

Comments
 (0)