Blender V4.3
tracking_private.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2011 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
12#pragma once
13
14#include "BLI_threads.h"
15
16#ifdef __cplusplus
17extern "C" {
18#endif
19
20struct GHash;
21struct MovieTracking;
23
25
26/*********************** Tracks map *************************/
27
28typedef struct TracksMap {
30
33
34 struct GHash *hash;
35
36 int ptr;
37
38 /* Spin lock is used to sync context during tracking. */
41
42struct TracksMap *tracks_map_new(const char *object_name, int num_tracks);
43int tracks_map_get_size(struct TracksMap *map);
44void tracks_map_insert(struct TracksMap *map, struct MovieTrackingTrack *track);
45void tracks_map_free(struct TracksMap *map);
46void tracks_map_merge(struct TracksMap *map, struct MovieTracking *tracking);
47
48/*********************** Space transformation functions *************************/
49
51 int frame_height,
52 const struct MovieTrackingMarker *marker,
53 float frame_pixel[2]);
54
62 int frame_height,
63 const struct MovieTrackingMarker *marker,
64 double search_pixel_x[5],
65 double search_pixel_y[5]);
66
71 int frame_height,
72 struct MovieTrackingMarker *marker,
73 const double search_pixel_x[5],
74 const double search_pixel_y[5]);
75
87void tracking_principal_point_normalized_to_pixel(const float principal_point_normalized[2],
88 int frame_width,
89 int frame_height,
90 float r_principal_point_pixel[2]);
91void tracking_principal_point_pixel_to_normalized(const float principal_point_pixel[2],
92 int frame_width,
93 int frame_height,
94 float r_principal_point_normalized[2]);
95
96/*********************** General purpose utility functions *************************/
97
108 const struct MovieTrackingMarker *ref_marker,
109 bool before,
110 bool overwrite);
111
116 struct MovieTracking *tracking,
117 int calibration_width,
118 int calibration_height,
119 struct libmv_CameraIntrinsicsOptions *camera_intrinsics_options);
120
122 struct MovieTracking *tracking,
123 const struct libmv_CameraIntrinsicsOptions *camera_intrinsics_options);
124
126
131 float *mask,
132 bool is_backwards,
134
139 int current_frame,
140 bool backwards);
141
142/*********************** Masking *************************/
143
147float *tracking_track_get_mask_for_region(const int frame_width,
148 const int frame_height,
149 const float region_min[2],
150 const float region_max[2],
151 const MovieTrackingTrack *track);
152
153/*********************** Frame Accessor *************************/
154
156
157#define MAX_ACCESSOR_CLIP 64
158typedef struct TrackingImageAccessor {
161
162 /* Array of tracks which are being tracked.
163 * Points to actual track from the `MovieClip` (or multiple of them).
164 * This accessor owns the array, but not the tracks themselves. */
167
171
180 int num_clips,
181 MovieTrackingTrack **tracks,
182 int num_tracks);
184
185#ifdef __cplusplus
186}
187#endif
pthread_spinlock_t SpinLock
#define MAX_NAME
Definition DNA_defs.h:50
CCL_NAMESPACE_BEGIN struct Options options
struct libmv_FrameAccessor libmv_FrameAccessor
struct MovieTrackingTrack ** tracks
struct MovieClip * clips[MAX_ACCESSOR_CLIP]
struct libmv_FrameAccessor * libmv_accessor
char object_name[MAX_NAME]
struct GHash * hash
MovieTrackingTrack * tracks
SpinLock spin_lock
void tracking_trackingCameraFromIntrinscisOptions(struct MovieTracking *tracking, const struct libmv_CameraIntrinsicsOptions *camera_intrinsics_options)
struct TracksMap TracksMap
int tracks_map_get_size(struct TracksMap *map)
struct MovieTrackingMarker * tracking_get_keyframed_marker(struct MovieTrackingTrack *track, int current_frame, bool backwards)
void tracking_marker_insert_disabled(struct MovieTrackingTrack *track, const struct MovieTrackingMarker *ref_marker, bool before, bool overwrite)
void tracks_map_free(struct TracksMap *map)
struct TrackingImageAccessor TrackingImageAccessor
void tracks_map_insert(struct TracksMap *map, struct MovieTrackingTrack *track)
void tracks_map_merge(struct TracksMap *map, struct MovieTracking *tracking)
#define MAX_ACCESSOR_CLIP
void tracking_configure_tracker(const MovieTrackingTrack *track, float *mask, bool is_backwards, struct libmv_TrackRegionOptions *options)
TrackingImageAccessor * tracking_image_accessor_new(MovieClip *clips[MAX_ACCESSOR_CLIP], int num_clips, MovieTrackingTrack **tracks, int num_tracks)
void tracking_principal_point_normalized_to_pixel(const float principal_point_normalized[2], int frame_width, int frame_height, float r_principal_point_pixel[2])
float * tracking_track_get_mask_for_region(const int frame_width, const int frame_height, const float region_min[2], const float region_max[2], const MovieTrackingTrack *track)
Definition tracking.cc:1136
void tracking_image_accessor_destroy(TrackingImageAccessor *accessor)
void tracking_cameraIntrinscisOptionsFromTracking(struct MovieTracking *tracking, int calibration_width, int calibration_height, struct libmv_CameraIntrinsicsOptions *camera_intrinsics_options)
void tracking_set_marker_coords_from_tracking(int frame_width, int frame_height, struct MovieTrackingMarker *marker, const double search_pixel_x[5], const double search_pixel_y[5])
void tracking_principal_point_pixel_to_normalized(const float principal_point_pixel[2], int frame_width, int frame_height, float r_principal_point_normalized[2])
void tracking_get_search_origin_frame_pixel(int frame_width, int frame_height, const struct MovieTrackingMarker *marker, float frame_pixel[2])
struct TracksMap * tracks_map_new(const char *object_name, int num_tracks)
void tracking_get_marker_coords_for_tracking(int frame_width, int frame_height, const struct MovieTrackingMarker *marker, double search_pixel_x[5], double search_pixel_y[5])