39 const float *pixel =
rgba + 4 * i;
41 gray[i] = weight_red * pixel[0] + weight_green * pixel[1] + weight_blue * pixel[2];
53 const unsigned char *pixel =
rgba + i * 4;
55 gray[i] = (weight_red * pixel[0] + weight_green * pixel[1] + weight_blue * pixel[2]) / 255.0f;
89 (
unsigned char *)searchibuf->
rect, gray_pixels,
width *
height, 0.2126f, 0.7152f, 0.0722f);
132 if (marker_keyed ==
NULL) {
136 keyed_framenr = marker_keyed->
framenr;
138 *r_marker_keyed = marker_keyed;
156 clip, user, clip_flag, track, curfra, backwards, reference_marker);
170 const bool is_backwards,
206 float *reference_search_area,
207 int reference_search_area_width,
208 int reference_search_area_height,
210 const bool is_backward,
211 double dst_pixel_x[5],
212 double dst_pixel_y[5])
215 double src_pixel_x[5], src_pixel_y[5];
223 int new_search_area_width, new_search_area_height;
224 int frame_width, frame_height;
228 frame_width = destination_ibuf->
x;
229 frame_height = destination_ibuf->
y;
236 destination_ibuf, track, marker, &new_search_area_width, &new_search_area_height);
244 frame_width, frame_height, reference_marker, src_pixel_x, src_pixel_y);
246 frame_width, frame_height, marker, dst_pixel_x, dst_pixel_y);
248 if (patch_new ==
NULL || reference_search_area ==
NULL) {
254 reference_search_area,
255 reference_search_area_width,
256 reference_search_area_height,
258 new_search_area_width,
259 new_search_area_height,
274 int *reference_framenr)
280 while (reference >= first_marker && reference <= last_marker &&
290 if (reference < first_marker || reference > last_marker) {
294 *reference_framenr = reference->
framenr;
304 ImBuf *reference_ibuf, *destination_ibuf;
306 int frame_width, frame_height;
307 int search_area_height, search_area_width;
309 int reference_framenr;
311 double dst_pixel_x[5], dst_pixel_y[5];
325 clip, &user, clip_flag, track, reference_framenr, backwards, &reference_marker);
326 if (reference_ibuf ==
NULL) {
331 if (reference_marker == marker) {
337 if (destination_ibuf ==
NULL) {
344 reference_ibuf, track, reference_marker, &search_area_width, &search_area_height);
367 frame_width, frame_height, marker, dst_pixel_x, dst_pixel_y);
#define MOVIECLIP_CACHE_SKIP
struct ImBuf * BKE_movieclip_get_ibuf_flag(struct MovieClip *clip, struct MovieClipUser *user, int flag, int cache_flag)
void BKE_movieclip_get_size(struct MovieClip *clip, struct MovieClipUser *user, int *width, int *height)
float BKE_movieclip_remap_clip_to_scene_frame(const struct MovieClip *clip, float framenr)
float * BKE_tracking_track_get_mask(int frame_width, int frame_height, struct MovieTrackingTrack *track, struct MovieTrackingMarker *marker)
struct ImBuf * BKE_tracking_get_search_imbuf(struct ImBuf *ibuf, struct MovieTrackingTrack *track, struct MovieTrackingMarker *marker, bool anchored, bool disable_channels)
struct MovieTrackingMarker * BKE_tracking_marker_get(struct MovieTrackingTrack *track, int framenr)
#define DNA_struct_default_get(struct_name)
@ TRACK_ALGORITHM_FLAG_USE_NORMALIZATION
@ TRACK_ALGORITHM_FLAG_USE_BRUTE
@ TRACK_ALGORITHM_FLAG_USE_MASK
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei height
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei width
Contains defines and structs used throughout the imbuf module.
Read Guarded memory(de)allocation.
CCL_NAMESPACE_BEGIN struct Options options
void IMB_freeImBuf(ImBuf *UNUSED(ibuf))
@ LIBMV_TRACK_REGION_FORWARD
@ LIBMV_TRACK_REGION_BACKWARD
ccl_gpu_kernel_postfix ccl_global float int num_pixels
void(* MEM_freeN)(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
ccl_device_inline float4 mask(const int4 &mask, const float4 &a)
static const pxr::TfToken rgba("rgba", pxr::TfToken::Immortal)
float minimum_correlation
MovieTrackingMarker * markers
int libmv_trackRegion(const libmv_TrackRegionOptions *, const float *, int, int, const float *, int, int, const double *x1, const double *y1, libmv_TrackRegionResult *result, double *x2, double *y2)
void BKE_tracking_refine_marker(MovieClip *clip, MovieTrackingTrack *track, MovieTrackingMarker *marker, bool backwards)
static float * track_get_search_floatbuf(ImBuf *ibuf, MovieTrackingTrack *track, MovieTrackingMarker *marker, int *r_width, int *r_height)
static ImBuf * tracking_context_get_frame_ibuf(MovieClip *clip, MovieClipUser *user, int clip_flag, int framenr)
static bool refine_marker_reference_frame_get(MovieTrackingTrack *track, MovieTrackingMarker *marker, bool backwards, int *reference_framenr)
static ImBuf * tracking_context_get_keyframed_ibuf(MovieClip *clip, MovieClipUser *user, int clip_flag, MovieTrackingTrack *track, int curfra, bool backwards, MovieTrackingMarker **r_marker_keyed)
static void uint8_rgba_to_float_gray(const unsigned char *rgba, float *gray, int num_pixels, float weight_red, float weight_green, float weight_blue)
static void float_rgba_to_gray(const float *rgba, float *gray, int num_pixels, float weight_red, float weight_green, float weight_blue)
static ImBuf * tracking_context_get_reference_ibuf(MovieClip *clip, MovieClipUser *user, int clip_flag, MovieTrackingTrack *track, int curfra, bool backwards, MovieTrackingMarker **reference_marker)
static bool configure_and_run_tracker(ImBuf *destination_ibuf, MovieTrackingTrack *track, MovieTrackingMarker *reference_marker, MovieTrackingMarker *marker, float *reference_search_area, int reference_search_area_width, int reference_search_area_height, float *mask, const bool is_backward, double dst_pixel_x[5], double dst_pixel_y[5])
void tracking_configure_tracker(const MovieTrackingTrack *track, float *mask, const bool is_backwards, libmv_TrackRegionOptions *options)
void tracking_get_marker_coords_for_tracking(int frame_width, int frame_height, const MovieTrackingMarker *marker, double search_pixel_x[5], double search_pixel_y[5])
MovieTrackingMarker * tracking_get_keyframed_marker(MovieTrackingTrack *track, int current_frame, bool backwards)
void tracking_set_marker_coords_from_tracking(int frame_width, int frame_height, MovieTrackingMarker *marker, const double search_pixel_x[5], const double search_pixel_y[5])