Libmv: Add C-API function to set all markers within AutoTrack structure
authorSergey Sharybin <sergey.vfx@gmail.com>
Fri, 15 Dec 2017 11:51:17 +0000 (12:51 +0100)
committerSergey Sharybin <sergey.vfx@gmail.com>
Fri, 15 Dec 2017 11:51:17 +0000 (12:51 +0100)
intern/libmv/intern/autotrack.cc
intern/libmv/intern/autotrack.h
intern/libmv/intern/stub.cc

index 3b7c9c5a010fcbe7870f19b4e21a40d13c8e686b..980504ed163036e48c6b1847148ec9d765a0a0d2 100644 (file)
@@ -82,6 +82,21 @@ void libmv_autoTrackAddMarker(libmv_AutoTrack* libmv_autotrack,
   ((AutoTrack*) libmv_autotrack)->AddMarker(marker);
 }
 
   ((AutoTrack*) libmv_autotrack)->AddMarker(marker);
 }
 
+void libmv_autoTrackSetMarkers(libmv_AutoTrack* libmv_autotrack,
+                               const libmv_Marker* libmv_marker,
+                               size_t num_markers) {
+  if (num_markers == 0) {
+    // Early output.
+    return;
+  }
+  libmv::vector<Marker> markers;
+  markers.resize(num_markers);
+  for (size_t i = 0; i < num_markers; ++i) {
+    libmv_apiMarkerToMarker(libmv_marker[i], &markers[i]);
+  }
+  ((AutoTrack*) libmv_autotrack)->SetMarkers(&markers);
+}
+
 int libmv_autoTrackGetMarker(libmv_AutoTrack* libmv_autotrack,
                              int clip,
                              int frame,
 int libmv_autoTrackGetMarker(libmv_AutoTrack* libmv_autotrack,
                              int clip,
                              int frame,
index 2a4a8f3c97fcdfd68e158c63bb0e43a372422e53..9a073ff249b7d8acc6b2b0b96de948d2adbfb9f0 100644 (file)
@@ -58,6 +58,10 @@ int libmv_autoTrackMarker(libmv_AutoTrack* libmv_autotrack,
 void libmv_autoTrackAddMarker(libmv_AutoTrack* libmv_autotrack,
                               const libmv_Marker* libmv_marker);
 
 void libmv_autoTrackAddMarker(libmv_AutoTrack* libmv_autotrack,
                               const libmv_Marker* libmv_marker);
 
+void libmv_autoTrackSetMarkers(libmv_AutoTrack* libmv_autotrack,
+                               const libmv_Marker* libmv_marker,
+                               size_t num_markers);
+
 int libmv_autoTrackGetMarker(libmv_AutoTrack* libmv_autotrack,
                              int clip,
                              int frame,
 int libmv_autoTrackGetMarker(libmv_AutoTrack* libmv_autotrack,
                              int clip,
                              int frame,
index 8603cc03153dcca5c781081334402db2766dbd35..fa2509ffcf62b329de7a90664cfd28909aac9425 100644 (file)
@@ -361,6 +361,12 @@ void libmv_autoTrackAddMarker(libmv_AutoTrack* /*libmv_autotrack*/,
 {
 }
 
 {
 }
 
+void libmv_autoTrackSetMarkers(libmv_AutoTrack* /*libmv_autotrack*/,
+                               const libmv_Marker* /*libmv_marker-*/,
+                               size_t /*num_markers*/)
+{
+}
+
 int libmv_autoTrackGetMarker(libmv_AutoTrack* /*libmv_autotrack*/,
                              int /*clip*/,
                              int /*frame*/,
 int libmv_autoTrackGetMarker(libmv_AutoTrack* /*libmv_autotrack*/,
                              int /*clip*/,
                              int /*frame*/,