Blender
V3.3
|
#include "atomic_ops.h"
#include <stdlib.h>
#include "MEM_guardedalloc.h"
#include "DNA_movieclip_types.h"
#include "DNA_object_types.h"
#include "BLI_listbase.h"
#include "BLI_math.h"
#include "BLI_task.h"
#include "BLI_threads.h"
#include "BLI_utildefines.h"
#include "PIL_time.h"
#include "BKE_global.h"
#include "BKE_movieclip.h"
#include "BKE_tracking.h"
#include "IMB_imbuf.h"
#include "IMB_imbuf_types.h"
#include "libmv-capi.h"
#include "tracking_private.h"
Go to the source code of this file.
Classes | |
struct | AutoTrackClip |
struct | AutoTrackTrack |
struct | AutoTrackMarker |
struct | AutoTrackTrackingResult |
struct | AutoTrackContext |
struct | AutoTrackTLS |
Typedefs | |
typedef struct AutoTrackClip | AutoTrackClip |
typedef struct AutoTrackTrack | AutoTrackTrack |
typedef struct AutoTrackMarker | AutoTrackMarker |
typedef struct AutoTrackTrackingResult | AutoTrackTrackingResult |
typedef struct AutoTrackContext | AutoTrackContext |
Threaded context step (tracking process). | |
typedef struct AutoTrackTLS | AutoTrackTLS |
static void | autotrack_context_step_cb (void *__restrict userdata, const int marker_index, const TaskParallelTLS *__restrict tls) |
static void | autotrack_context_reduce (const void *__restrict UNUSED(userdata), void *__restrict chunk_join, void *__restrict chunk) |
bool | BKE_autotrack_context_step (AutoTrackContext *context) |
typedef struct AutoTrackClip AutoTrackClip |
typedef struct AutoTrackContext AutoTrackContext |
typedef struct AutoTrackMarker AutoTrackMarker |
typedef struct AutoTrackTLS AutoTrackTLS |
typedef struct AutoTrackTrack AutoTrackTrack |
typedef struct AutoTrackTrackingResult AutoTrackTrackingResult |
|
static |
Definition at line 459 of file tracking_auto.c.
References autotrack_count_all_usable_markers(), autotrack_is_marker_usable(), AutoTrackTrack::clip_index, blender::compositor::context, dna_marker_to_libmv_marker(), AutoTrackClip::height, libmv_autoTrackNew(), libmv_autoTrackSetMarkers(), MovieTrackingTrack::markers, MovieTrackingTrack::markersnr, MEM_freeN, MEM_malloc_arrayN, AutoTrackTrack::track, and AutoTrackClip::width.
Referenced by BKE_autotrack_context_new().
|
static |
Definition at line 340 of file tracking_auto.c.
References BKE_movieclip_get_size(), and blender::compositor::context.
Referenced by BKE_autotrack_context_new().
|
static |
Definition at line 400 of file tracking_auto.c.
References BLI_assert, blender::compositor::context, MAX_ACCESSOR_CLIP, MEM_freeN, MEM_malloc_arrayN, tracking_image_accessor_new(), and tracks.
Referenced by BKE_autotrack_context_new().
|
static |
Definition at line 502 of file tracking_auto.c.
References autotrack_count_trackable_markers(), BKE_movieclip_remap_scene_to_clip_frame(), BKE_tracking_marker_get(), AutoTrackClip::clip, AutoTrackTrack::clip_index, blender::compositor::context, dna_marker_to_libmv_marker(), AutoTrackClip::height, AutoTrackTrack::is_trackable, AutoTrackMarker::libmv_marker, MEM_calloc_arrayN, and AutoTrackClip::width.
Referenced by BKE_autotrack_context_new().
|
static |
Definition at line 390 of file tracking_auto.c.
References autotrack_context_init_tracks_for_clip(), BLI_assert, and blender::compositor::context.
Referenced by BKE_autotrack_context_new().
|
static |
Definition at line 357 of file tracking_auto.c.
References autotrack_is_track_trackable(), BKE_tracking_get_active_tracks(), BLI_assert, BLI_listbase_count(), AutoTrackClip::clip, AutoTrackTrack::clip_index, blender::compositor::context, AutoTrackTrack::is_trackable, LISTBASE_FOREACH, MEM_reallocN, NULL, AutoTrackTrack::track, AutoTrackTrack::track_region_options, MovieClip::tracking, and tracking_configure_tracker().
Referenced by autotrack_context_init_tracks().
|
static |
Definition at line 692 of file tracking_auto.c.
References BLI_listbase_is_empty(), BLI_movelisttolist(), and AutoTrackTLS::results.
Referenced by BKE_autotrack_context_step().
|
static |
Definition at line 628 of file tracking_auto.c.
References BLI_addtail(), BLI_assert, blender::compositor::context, libmv_Marker::frame, if(), libmv_autoTrackGetMarker(), libmv_autoTrackMarker(), AutoTrackTrackingResult::libmv_marker, AutoTrackTrackingResult::libmv_result, MEM_mallocN, libmv_Marker::reference_frame, AutoTrackTLS::results, AutoTrackTrackingResult::success, TRACK_MATCH_KEYFRAME, TRACK_MATCH_PREVIOS_FRAME, and tracking_check_marker_margin().
Referenced by BKE_autotrack_context_step().
|
static |
Definition at line 426 of file tracking_auto.c.
References autotrack_is_marker_usable(), blender::compositor::context, MovieTrackingTrack::markers, and MovieTrackingTrack::markersnr.
Referenced by autotrack_context_init_autotrack().
|
static |
Definition at line 442 of file tracking_auto.c.
References blender::compositor::context, and AutoTrackTrack::is_trackable.
Referenced by autotrack_context_init_markers().
|
static |
Definition at line 316 of file tracking_auto.c.
References MovieTrackingMarker::flag, and MARKER_DISABLED.
Referenced by autotrack_context_init_autotrack(), autotrack_count_all_usable_markers(), and autotrack_is_track_trackable().
|
static |
Definition at line 324 of file tracking_auto.c.
References autotrack_is_marker_usable(), BKE_movieclip_remap_scene_to_clip_frame(), BKE_tracking_marker_get(), AutoTrackClip::clip, AutoTrackTrack::clip_index, blender::compositor::context, MovieTrackingTrack::flag, AutoTrackTrack::track, TRACK_HIDDEN, TRACK_LOCKED, and TRACK_SELECTED.
Referenced by autotrack_context_init_tracks_for_clip().
void BKE_autotrack_context_finish | ( | AutoTrackContext * | context | ) |
Definition at line 836 of file tracking_auto.c.
References BKE_movieclip_remap_scene_to_clip_frame(), BKE_tracking_get_active_plane_tracks(), BKE_tracking_plane_track_has_point_track(), BKE_tracking_track_plane_from_existing_motion(), AutoTrackClip::clip, blender::compositor::context, AutoTrackTrack::is_trackable, LISTBASE_FOREACH, PLANE_TRACK_AUTOKEY, AutoTrackTrack::track, and MovieClip::tracking.
Referenced by track_markers_endjob().
void BKE_autotrack_context_free | ( | AutoTrackContext * | context | ) |
Definition at line 878 of file tracking_auto.c.
References BLI_freelistN(), BLI_spin_end(), blender::compositor::context, libmv_autoTrackDestroy(), MEM_freeN, MEM_SAFE_FREE, NULL, release_keyframed_image_buffers(), and tracking_image_accessor_destroy().
Referenced by track_markers_freejob().
AutoTrackContext* BKE_autotrack_context_new | ( | MovieClip * | clip, |
MovieClipUser * | user, | ||
const bool | is_backwards | ||
) |
Definition at line 542 of file tracking_auto.c.
References autotrack_context_init_autotrack(), autotrack_context_init_clips(), autotrack_context_init_image_accessor(), autotrack_context_init_markers(), autotrack_context_init_tracks(), BLI_spin_init(), blender::compositor::context, MovieClipUser::framenr, and MEM_callocN.
Referenced by track_markers_initjob().
void BKE_autotrack_context_start | ( | AutoTrackContext * | context | ) |
Definition at line 611 of file tracking_auto.c.
References blender::compositor::context, and reference_keyframed_image_buffers().
Referenced by track_markers_startjob().
bool BKE_autotrack_context_step | ( | AutoTrackContext * | context | ) |
Definition at line 706 of file tracking_auto.c.
References autotrack_context_reduce(), autotrack_context_step_cb(), BLI_listbase_clear(), BLI_movelisttolist(), BLI_parallel_range_settings_defaults(), BLI_spin_lock(), BLI_spin_unlock(), BLI_task_parallel_range(), blender::compositor::context, TaskParallelSettings::func_reduce, libmv_autoTrackAddMarker(), LISTBASE_FOREACH, AutoTrackTLS::results, TaskParallelSettings::use_threading, TaskParallelSettings::userdata_chunk, and TaskParallelSettings::userdata_chunk_size.
Referenced by track_markers_startjob().
void BKE_autotrack_context_sync | ( | AutoTrackContext * | context | ) |
Definition at line 759 of file tracking_auto.c.
References BKE_movieclip_remap_clip_to_scene_frame(), BKE_movieclip_remap_scene_to_clip_frame(), BKE_tracking_dopesheet_tag_update(), BKE_tracking_marker_get_exact(), BKE_tracking_marker_insert(), BLI_assert, BLI_listbase_clear(), BLI_spin_lock(), BLI_spin_unlock(), libmv_Marker::clip, AutoTrackClip::clip, blender::compositor::context, MovieTrackingMarker::flag, MovieTrackingMarker::framenr, AutoTrackClip::height, libmv_marker_to_dna_marker(), LISTBASE_FOREACH_MUTABLE, MARKER_DISABLED, max_ii(), MEM_freeN, min_ii(), NULL, libmv_Marker::track, AutoTrackTrack::track, tracking_marker_insert_disabled(), and AutoTrackClip::width.
Referenced by track_markers_endjob(), and track_markers_updatejob().
void BKE_autotrack_context_sync_user | ( | AutoTrackContext * | context, |
MovieClipUser * | user | ||
) |
Definition at line 825 of file tracking_auto.c.
References blender::compositor::context, and MovieClipUser::framenr.
Referenced by clip_main_region_draw().
|
static |
Definition at line 181 of file tracking_auto.c.
References libmv_Marker::center, libmv_Marker::clip, libmv_Marker::disabled_channels, MovieTrackingMarker::flag, MovieTrackingTrack::flag, libmv_Marker::frame, MovieTrackingMarker::framenr, LIBMV_MARKER_CHANNEL_B, LIBMV_MARKER_CHANNEL_G, LIBMV_MARKER_CHANNEL_R, LIBMV_MARKER_MODEL_TYPE_POINT, LIBMV_MARKER_SOURCE_MANUAL, LIBMV_MARKER_SOURCE_TRACKED, LIBMV_MARKER_STATUS_UNKNOWN, MARKER_TRACKED, libmv_Marker::model_id, libmv_Marker::model_type, normalized_relative_to_libmv_frame(), normalized_to_libmv_frame(), libmv_Marker::patch, MovieTrackingMarker::pattern_corners, MovieTrackingTrack::pattern_match, MovieTrackingMarker::pos, libmv_Marker::reference_clip, libmv_Marker::reference_frame, MovieTrackingMarker::search_max, MovieTrackingMarker::search_min, libmv_Marker::search_region_max, libmv_Marker::search_region_min, libmv_Marker::source, libmv_Marker::status, libmv_Marker::track, TRACK_DISABLE_BLUE, TRACK_DISABLE_GREEN, TRACK_DISABLE_RED, TRACK_MATCH_KEYFRAME, tracking_get_keyframed_marker(), and libmv_Marker::weight.
Referenced by autotrack_context_init_autotrack(), and autotrack_context_init_markers().
|
static |
Definition at line 158 of file tracking_auto.c.
References result.
Referenced by libmv_marker_to_dna_marker().
|
static |
Definition at line 166 of file tracking_auto.c.
References result.
Referenced by libmv_marker_to_dna_marker().
|
static |
Definition at line 240 of file tracking_auto.c.
References libmv_Marker::center, MovieTrackingMarker::flag, libmv_Marker::frame, MovieTrackingMarker::framenr, libmv_frame_to_normalized(), libmv_frame_to_normalized_relative(), LIBMV_MARKER_SOURCE_TRACKED, MARKER_TRACKED, libmv_Marker::patch, MovieTrackingMarker::pattern_corners, MovieTrackingMarker::pos, MovieTrackingMarker::search_max, MovieTrackingMarker::search_min, libmv_Marker::search_region_max, libmv_Marker::search_region_min, and libmv_Marker::source.
Referenced by BKE_autotrack_context_sync().
|
static |
Definition at line 149 of file tracking_auto.c.
References normalized(), and result.
Referenced by dna_marker_to_libmv_marker().
|
static |
Definition at line 141 of file tracking_auto.c.
References normalized(), and result.
Referenced by dna_marker_to_libmv_marker().
|
static |
Definition at line 571 of file tracking_auto.c.
References BKE_movieclip_get_ibuf(), BKE_movieclip_remap_clip_to_scene_frame(), BKE_movieclip_user_set_frame(), libmv_Marker::clip, AutoTrackClip::clip, blender::compositor::context, IB_PERSISTENT, AutoTrackMarker::libmv_marker, MCLIP_PROXY_RENDER_SIZE_FULL, MEM_calloc_arrayN, MovieTrackingTrack::pattern_match, libmv_Marker::reference_frame, MovieClipUser::render_flag, MovieClipUser::render_size, libmv_Marker::track, AutoTrackTrack::track, TRACK_MATCH_KEYFRAME, and ImBuf::userflags.
Referenced by BKE_autotrack_context_start().
|
static |
Definition at line 864 of file tracking_auto.c.
References blender::compositor::context, IB_PERSISTENT, IMB_freeImBuf(), MEM_freeN, and ImBuf::userflags.
Referenced by BKE_autotrack_context_free().
|
static |
Definition at line 281 of file tracking_auto.c.
References libmv_Marker::center, INIT_MINMAX2, max_ff(), minmax_v2v2_v2(), and libmv_Marker::patch.
Referenced by autotrack_context_step_cb().