Blender  V3.3
Classes | Typedefs
tracking_auto.c File Reference
#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
 

Functions

Marker coordinate system conversion.
static void normalized_to_libmv_frame (const float normalized[2], const int frame_dimensions[2], float result[2])
 
static void normalized_relative_to_libmv_frame (const float normalized[2], const float origin[2], const int frame_dimensions[2], float result[2])
 
static void libmv_frame_to_normalized (const float frame_coord[2], const int frame_dimensions[2], float result[2])
 
static void libmv_frame_to_normalized_relative (const float frame_coord[2], const float origin[2], const int frame_dimensions[2], float result[2])
 
Conversion of markers between Blender's DNA and Libmv.
static void dna_marker_to_libmv_marker (MovieTrackingTrack *track, const MovieTrackingMarker *marker, int clip, int track_index, int frame_width, int frame_height, bool backwards, libmv_Marker *libmv_marker)
 
static void libmv_marker_to_dna_marker (libmv_Marker *libmv_marker, int frame_width, int frame_height, MovieTrackingMarker *marker)
 
General helpers.

TODO(sergey): Should be moved to tracking_util.c

static bool tracking_check_marker_margin (const libmv_Marker *libmv_marker, int margin, int frame_width, int frame_height)
 
Autotrack context initialization.
static bool autotrack_is_marker_usable (const MovieTrackingMarker *marker)
 
static bool autotrack_is_track_trackable (const AutoTrackContext *context, const AutoTrackTrack *autotrack_track)
 
static void autotrack_context_init_clips (AutoTrackContext *context, MovieClip *clip, MovieClipUser *user)
 
static void autotrack_context_init_tracks_for_clip (AutoTrackContext *context, int clip_index)
 
static void autotrack_context_init_tracks (AutoTrackContext *context)
 
static void autotrack_context_init_image_accessor (AutoTrackContext *context)
 
static size_t autotrack_count_all_usable_markers (AutoTrackContext *context)
 
static int autotrack_count_trackable_markers (AutoTrackContext *context)
 
static void autotrack_context_init_autotrack (AutoTrackContext *context)
 
static void autotrack_context_init_markers (AutoTrackContext *context)
 
AutoTrackContextBKE_autotrack_context_new (MovieClip *clip, MovieClipUser *user, const bool is_backwards)
 
Context tracking start.

Called from possible job once before performing tracking steps.

static void reference_keyframed_image_buffers (AutoTrackContext *context)
 
void BKE_autotrack_context_start (AutoTrackContext *context)
 
Context data synchronization.

Used to copy tracking result to Blender side, while the tracking is still happening in its thread.

void BKE_autotrack_context_sync (AutoTrackContext *context)
 
void BKE_autotrack_context_sync_user (AutoTrackContext *context, MovieClipUser *user)
 
Finalization.
void BKE_autotrack_context_finish (AutoTrackContext *context)
 
static void release_keyframed_image_buffers (AutoTrackContext *context)
 
void BKE_autotrack_context_free (AutoTrackContext *context)
 

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 Documentation

◆ AutoTrackClip

typedef struct AutoTrackClip AutoTrackClip

◆ AutoTrackContext

◆ AutoTrackMarker

◆ AutoTrackTLS

typedef struct AutoTrackTLS AutoTrackTLS

◆ AutoTrackTrack

◆ AutoTrackTrackingResult

Function Documentation

◆ autotrack_context_init_autotrack()

static void autotrack_context_init_autotrack ( AutoTrackContext context)
static

◆ autotrack_context_init_clips()

static void autotrack_context_init_clips ( AutoTrackContext context,
MovieClip clip,
MovieClipUser user 
)
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().

◆ autotrack_context_init_image_accessor()

static void autotrack_context_init_image_accessor ( AutoTrackContext context)
static

◆ autotrack_context_init_markers()

static void autotrack_context_init_markers ( AutoTrackContext context)
static

◆ autotrack_context_init_tracks()

static void autotrack_context_init_tracks ( AutoTrackContext context)
static

◆ autotrack_context_init_tracks_for_clip()

static void autotrack_context_init_tracks_for_clip ( AutoTrackContext context,
int  clip_index 
)
static

◆ autotrack_context_reduce()

static void autotrack_context_reduce ( const void *__restrict   UNUSEDuserdata,
void *__restrict  chunk_join,
void *__restrict  chunk 
)
static

◆ autotrack_context_step_cb()

static void autotrack_context_step_cb ( void *__restrict  userdata,
const int  marker_index,
const TaskParallelTLS *__restrict  tls 
)
static

◆ autotrack_count_all_usable_markers()

static size_t autotrack_count_all_usable_markers ( AutoTrackContext context)
static

◆ autotrack_count_trackable_markers()

static int autotrack_count_trackable_markers ( AutoTrackContext context)
static

◆ autotrack_is_marker_usable()

static bool autotrack_is_marker_usable ( const MovieTrackingMarker marker)
static

◆ autotrack_is_track_trackable()

static bool autotrack_is_track_trackable ( const AutoTrackContext context,
const AutoTrackTrack autotrack_track 
)
static

◆ BKE_autotrack_context_finish()

void BKE_autotrack_context_finish ( AutoTrackContext context)

◆ BKE_autotrack_context_free()

void BKE_autotrack_context_free ( AutoTrackContext context)

◆ BKE_autotrack_context_new()

AutoTrackContext* BKE_autotrack_context_new ( MovieClip clip,
MovieClipUser user,
const bool  is_backwards 
)

◆ BKE_autotrack_context_start()

void BKE_autotrack_context_start ( AutoTrackContext context)

◆ BKE_autotrack_context_step()

bool BKE_autotrack_context_step ( AutoTrackContext context)

◆ BKE_autotrack_context_sync()

void BKE_autotrack_context_sync ( AutoTrackContext context)

◆ BKE_autotrack_context_sync_user()

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().

◆ dna_marker_to_libmv_marker()

static void dna_marker_to_libmv_marker ( MovieTrackingTrack track,
const MovieTrackingMarker marker,
int  clip,
int  track_index,
int  frame_width,
int  frame_height,
bool  backwards,
libmv_Marker libmv_marker 
)
static

◆ libmv_frame_to_normalized()

static void libmv_frame_to_normalized ( const float  frame_coord[2],
const int  frame_dimensions[2],
float  result[2] 
)
static

Definition at line 158 of file tracking_auto.c.

References result.

Referenced by libmv_marker_to_dna_marker().

◆ libmv_frame_to_normalized_relative()

static void libmv_frame_to_normalized_relative ( const float  frame_coord[2],
const float  origin[2],
const int  frame_dimensions[2],
float  result[2] 
)
static

Definition at line 166 of file tracking_auto.c.

References result.

Referenced by libmv_marker_to_dna_marker().

◆ libmv_marker_to_dna_marker()

static void libmv_marker_to_dna_marker ( libmv_Marker libmv_marker,
int  frame_width,
int  frame_height,
MovieTrackingMarker marker 
)
static

◆ normalized_relative_to_libmv_frame()

static void normalized_relative_to_libmv_frame ( const float  normalized[2],
const float  origin[2],
const int  frame_dimensions[2],
float  result[2] 
)
static

Definition at line 149 of file tracking_auto.c.

References normalized(), and result.

Referenced by dna_marker_to_libmv_marker().

◆ normalized_to_libmv_frame()

static void normalized_to_libmv_frame ( const float  normalized[2],
const int  frame_dimensions[2],
float  result[2] 
)
static

Definition at line 141 of file tracking_auto.c.

References normalized(), and result.

Referenced by dna_marker_to_libmv_marker().

◆ reference_keyframed_image_buffers()

static void reference_keyframed_image_buffers ( AutoTrackContext context)
static

◆ release_keyframed_image_buffers()

static void release_keyframed_image_buffers ( AutoTrackContext context)
static

◆ tracking_check_marker_margin()

static bool tracking_check_marker_margin ( const libmv_Marker libmv_marker,
int  margin,
int  frame_width,
int  frame_height 
)
static