Camera tracking integration
authorSergey Sharybin <sergey.vfx@gmail.com>
Thu, 20 Oct 2011 09:52:13 +0000 (09:52 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Thu, 20 Oct 2011 09:52:13 +0000 (09:52 +0000)
===========================

Naming refactor: avoid using acquire from movie clip related functions.
This stuff doesn't need releasing, all locks happens in getters,
so using get instead of acquire makes more sense here.

15 files changed:
source/blender/blenkernel/BKE_movieclip.h
source/blender/blenkernel/BKE_tracking.h
source/blender/blenkernel/intern/movieclip.c
source/blender/blenkernel/intern/tracking.c
source/blender/editors/include/ED_clip.h
source/blender/editors/space_clip/clip_buttons.c
source/blender/editors/space_clip/clip_draw_graph.c
source/blender/editors/space_clip/clip_draw_main.c
source/blender/editors/space_clip/clip_editor.c
source/blender/editors/space_clip/space_clip.c
source/blender/editors/space_clip/tracking_ops.c
source/blender/editors/space_view3d/view3d_draw.c
source/blender/makesrna/intern/rna_movieclip.c
source/blender/nodes/composite/nodes/node_composite_movieclip.c
source/blender/nodes/composite/nodes/node_composite_moviedistortion.c

index f648c9b058f4367b919bab913f967fa7a85e005b..e3ab42b7be54479e6a8f71258b892ef569a7f65d 100644 (file)
@@ -48,10 +48,10 @@ void unlink_movieclip(struct Main *bmain, struct MovieClip *clip);
 struct MovieClip *BKE_add_movieclip_file(const char *name);
 void BKE_movieclip_reload(struct MovieClip *clip);
 
-struct ImBuf *BKE_movieclip_acquire_ibuf(struct MovieClip *clip, struct MovieClipUser *user);
-struct ImBuf *BKE_movieclip_acquire_stable_ibuf(struct MovieClip *clip, struct MovieClipUser *user, float loc[2], float *scale, float *angle);
-struct ImBuf *BKE_movieclip_acquire_ibuf_flag(struct MovieClip *clip, struct MovieClipUser *user, int flag);
-void BKE_movieclip_acquire_size(struct MovieClip *clip, struct MovieClipUser *user, int *width, int *height);
+struct ImBuf *BKE_movieclip_get_ibuf(struct MovieClip *clip, struct MovieClipUser *user);
+struct ImBuf *BKE_movieclip_get_stable_ibuf(struct MovieClip *clip, struct MovieClipUser *user, float loc[2], float *scale, float *angle);
+struct ImBuf *BKE_movieclip_get_ibuf_flag(struct MovieClip *clip, struct MovieClipUser *user, int flag);
+void BKE_movieclip_get_size(struct MovieClip *clip, struct MovieClipUser *user, int *width, int *height);
 void BKE_movieclip_aspect(struct MovieClip *clip, float *aspx, float *aspy);
 int BKE_movieclip_has_frame(struct MovieClip *clip, struct MovieClipUser *user);
 void BKE_movieclip_user_set_frame(struct MovieClipUser *user, int framenr);
index 6cf00b704aca43581fd1a9adfc6f8cbb40b33ba9..dab72f78327d27c63a9744badc1411e57b7b3d8a 100644 (file)
@@ -63,9 +63,9 @@ int BKE_tracking_test_join_tracks(struct MovieTrackingTrack *dst_track, struct M
 void BKE_tracking_join_tracks(struct MovieTrackingTrack *dst_track, struct MovieTrackingTrack *src_track);
 void BKE_tracking_free(struct MovieTracking *tracking);
 
-struct ImBuf *BKE_tracking_acquire_pattern_imbuf(struct ImBuf *ibuf, struct MovieTrackingTrack *track,
+struct ImBuf *BKE_tracking_get_pattern_imbuf(struct ImBuf *ibuf, struct MovieTrackingTrack *track,
                        struct MovieTrackingMarker *marker, int margin, int anchored, float pos[2], int origin[2]);
-struct ImBuf *BKE_tracking_acquire_search_imbuf(struct ImBuf *ibuf, struct MovieTrackingTrack *track,
+struct ImBuf *BKE_tracking_get_search_imbuf(struct ImBuf *ibuf, struct MovieTrackingTrack *track,
                        struct MovieTrackingMarker *marker, int margin, int anchored, float pos[2], int origin[2]);
 
 struct MovieTrackingContext *BKE_tracking_context_new(struct MovieClip *clip, struct MovieClipUser *user,
index f556ae43c239fca670cece4e49007ed625a2f11c..a9aa73ae1b5c7db30258fa6d296b58fc833b7fca 100644 (file)
@@ -447,7 +447,7 @@ MovieClip *BKE_add_movieclip_file(const char *name)
        else clip->source= MCLIP_SRC_SEQUENCE;
 
        user.framenr= 1;
-       BKE_movieclip_acquire_size(clip, &user, &width, &height);
+       BKE_movieclip_get_size(clip, &user, &width, &height);
        if(width && height) {
                clip->tracking.camera.principal[0]= ((float)width)/2;
                clip->tracking.camera.principal[1]= ((float)height)/2;
@@ -572,7 +572,7 @@ static ImBuf *put_undistorted_cache(MovieClip *clip, MovieClipUser *user, ImBuf
        return cache->undistibuf;
 }
 
-ImBuf *BKE_movieclip_acquire_ibuf(MovieClip *clip, MovieClipUser *user)
+ImBuf *BKE_movieclip_get_ibuf(MovieClip *clip, MovieClipUser *user)
 {
        ImBuf *ibuf= NULL;
        int framenr= user?user->framenr:clip->lastframe;
@@ -626,7 +626,7 @@ ImBuf *BKE_movieclip_acquire_ibuf(MovieClip *clip, MovieClipUser *user)
        return ibuf;
 }
 
-ImBuf *BKE_movieclip_acquire_ibuf_flag(MovieClip *clip, MovieClipUser *user, int flag)
+ImBuf *BKE_movieclip_get_ibuf_flag(MovieClip *clip, MovieClipUser *user, int flag)
 {
        ImBuf *ibuf= NULL;
        int framenr= user?user->framenr:clip->lastframe;
@@ -673,12 +673,12 @@ ImBuf *BKE_movieclip_acquire_ibuf_flag(MovieClip *clip, MovieClipUser *user, int
        return ibuf;
 }
 
-ImBuf *BKE_movieclip_acquire_stable_ibuf(MovieClip *clip, MovieClipUser *user, float loc[2], float *scale, float *angle)
+ImBuf *BKE_movieclip_get_stable_ibuf(MovieClip *clip, MovieClipUser *user, float loc[2], float *scale, float *angle)
 {
        ImBuf *ibuf, *stableibuf= NULL;
        int framenr= user?user->framenr:clip->lastframe;
 
-       ibuf= BKE_movieclip_acquire_ibuf(clip, user);
+       ibuf= BKE_movieclip_get_ibuf(clip, user);
 
        if(!ibuf)
                return NULL;
@@ -745,7 +745,7 @@ ImBuf *BKE_movieclip_acquire_stable_ibuf(MovieClip *clip, MovieClipUser *user, f
 
 int BKE_movieclip_has_frame(MovieClip *clip, MovieClipUser *user)
 {
-       ImBuf *ibuf= BKE_movieclip_acquire_ibuf(clip, user);
+       ImBuf *ibuf= BKE_movieclip_get_ibuf(clip, user);
 
        if(ibuf) {
                IMB_freeImBuf(ibuf);
@@ -755,13 +755,13 @@ int BKE_movieclip_has_frame(MovieClip *clip, MovieClipUser *user)
        return 0;
 }
 
-void BKE_movieclip_acquire_size(MovieClip *clip, MovieClipUser *user, int *width, int *height)
+void BKE_movieclip_get_size(MovieClip *clip, MovieClipUser *user, int *width, int *height)
 {
        if(!user || user->framenr==clip->lastframe) {
                *width= clip->lastsize[0];
                *height= clip->lastsize[1];
        } else {
-               ImBuf *ibuf= BKE_movieclip_acquire_ibuf(clip, user);
+               ImBuf *ibuf= BKE_movieclip_get_ibuf(clip, user);
 
                if(ibuf && ibuf->x && ibuf->y) {
                        real_ibuf_size(clip, user, ibuf, width, height);
@@ -883,7 +883,7 @@ void BKE_movieclip_update_scopes(MovieClip *clip, MovieClipUser *user, MovieClip
                        if(marker->flag&MARKER_DISABLED) {
                                scopes->track_disabled= 1;
                        } else {
-                               ImBuf *ibuf= BKE_movieclip_acquire_ibuf(clip, user);
+                               ImBuf *ibuf= BKE_movieclip_get_ibuf(clip, user);
 
                                scopes->track_disabled= 0;
 
@@ -895,7 +895,7 @@ void BKE_movieclip_update_scopes(MovieClip *clip, MovieClipUser *user, MovieClip
                                                int width, height;
                                                float aspy= 1.f/clip->tracking.camera.pixel_aspect;;
 
-                                               BKE_movieclip_acquire_size(clip, user, &width, &height);
+                                               BKE_movieclip_get_size(clip, user, &width, &height);
 
                                                undist_marker.pos[0]*= width;
                                                undist_marker.pos[1]*= height*aspy;
@@ -906,7 +906,7 @@ void BKE_movieclip_update_scopes(MovieClip *clip, MovieClipUser *user, MovieClip
                                                undist_marker.pos[1]/= height*aspy;
                                        }
 
-                                       tmpibuf= BKE_tracking_acquire_pattern_imbuf(ibuf, track, &undist_marker, 1, 1, scopes->track_pos, NULL);
+                                       tmpibuf= BKE_tracking_get_pattern_imbuf(ibuf, track, &undist_marker, 1, 1, scopes->track_pos, NULL);
 
                                        if(tmpibuf->rect_float)
                                                IMB_rect_from_float(tmpibuf);
@@ -975,7 +975,7 @@ void BKE_movieclip_build_proxy_frame(MovieClip *clip, struct MovieDistortion *di
 
        user.framenr= cfra;
 
-       ibuf= BKE_movieclip_acquire_ibuf_flag(clip, &user, 0);
+       ibuf= BKE_movieclip_get_ibuf_flag(clip, &user, 0);
 
        if(ibuf) {
                ImBuf *tmpibuf= ibuf;
index aaeaae936b0686abbaf2457874530d6af8e32bb7..13a6b251f9b4329027775f8e2ad6c10e7538d3ee 100644 (file)
@@ -537,7 +537,7 @@ MovieTrackingContext *BKE_tracking_context_new(MovieClip *clip, MovieClipUser *u
        if(context->num_tracks) {
                int width, height;
 
-               BKE_movieclip_acquire_size(clip, user, &width, &height);
+               BKE_movieclip_get_size(clip, user, &width, &height);
 
                /* create tracking data */
                context->track_context= MEM_callocN(sizeof(TrackContext)*context->num_tracks, "tracking track_context");
@@ -648,7 +648,7 @@ static void disable_imbuf_channels(ImBuf *ibuf, MovieTrackingTrack *track)
        }
 }
 
-static ImBuf *acquire_area_imbuf(ImBuf *ibuf, MovieTrackingTrack *track, MovieTrackingMarker *marker,
+static ImBuf *get_area_imbuf(ImBuf *ibuf, MovieTrackingTrack *track, MovieTrackingMarker *marker,
                        float min[2], float max[2], int margin, int anchored, float pos[2], int origin[2])
 {
        ImBuf *tmpibuf;
@@ -693,20 +693,20 @@ static ImBuf *acquire_area_imbuf(ImBuf *ibuf, MovieTrackingTrack *track, MovieTr
        return tmpibuf;
 }
 
-ImBuf *BKE_tracking_acquire_pattern_imbuf(ImBuf *ibuf, MovieTrackingTrack *track, MovieTrackingMarker *marker,
+ImBuf *BKE_tracking_get_pattern_imbuf(ImBuf *ibuf, MovieTrackingTrack *track, MovieTrackingMarker *marker,
                        int margin, int anchored, float pos[2], int origin[2])
 {
-       return acquire_area_imbuf(ibuf, track, marker, track->pat_min, track->pat_max, margin, anchored, pos, origin);
+       return get_area_imbuf(ibuf, track, marker, track->pat_min, track->pat_max, margin, anchored, pos, origin);
 }
 
-ImBuf *BKE_tracking_acquire_search_imbuf(ImBuf *ibuf, MovieTrackingTrack *track, MovieTrackingMarker *marker,
+ImBuf *BKE_tracking_get_search_imbuf(ImBuf *ibuf, MovieTrackingTrack *track, MovieTrackingMarker *marker,
                        int margin, int anchored, float pos[2], int origin[2])
 {
-       return acquire_area_imbuf(ibuf, track, marker, track->search_min, track->search_max, margin, anchored, pos, origin);
+       return get_area_imbuf(ibuf, track, marker, track->search_min, track->search_max, margin, anchored, pos, origin);
 }
 
 #ifdef WITH_LIBMV
-static float *acquire_search_floatbuf(ImBuf *ibuf, MovieTrackingTrack *track, MovieTrackingMarker *marker,
+static float *get_search_floatbuf(ImBuf *ibuf, MovieTrackingTrack *track, MovieTrackingMarker *marker,
                        int *width_r, int *height_r, float pos[2], int origin[2])
 {
        ImBuf *tmpibuf;
@@ -716,7 +716,7 @@ static float *acquire_search_floatbuf(ImBuf *ibuf, MovieTrackingTrack *track, Mo
        width= (track->search_max[0]-track->search_min[0])*ibuf->x;
        height= (track->search_max[1]-track->search_min[1])*ibuf->y;
 
-       tmpibuf= BKE_tracking_acquire_search_imbuf(ibuf, track, marker, 0, 0, pos, origin);
+       tmpibuf= BKE_tracking_get_search_imbuf(ibuf, track, marker, 0, 0, pos, origin);
        disable_imbuf_channels(tmpibuf, track);
 
        *width_r= width;
@@ -746,7 +746,7 @@ static float *acquire_search_floatbuf(ImBuf *ibuf, MovieTrackingTrack *track, Mo
        return pixels;
 }
 
-static unsigned char *acquire_search_bytebuf(ImBuf *ibuf, MovieTrackingTrack *track, MovieTrackingMarker *marker,
+static unsigned char *get_search_bytebuf(ImBuf *ibuf, MovieTrackingTrack *track, MovieTrackingMarker *marker,
                        int *width_r, int *height_r, float pos[2], int origin[2])
 {
        ImBuf *tmpibuf;
@@ -756,7 +756,7 @@ static unsigned char *acquire_search_bytebuf(ImBuf *ibuf, MovieTrackingTrack *tr
        width= (track->search_max[0]-track->search_min[0])*ibuf->x;
        height= (track->search_max[1]-track->search_min[1])*ibuf->y;
 
-       tmpibuf= BKE_tracking_acquire_search_imbuf(ibuf, track, marker, 0, 0, pos, origin);
+       tmpibuf= BKE_tracking_get_search_imbuf(ibuf, track, marker, 0, 0, pos, origin);
        disable_imbuf_channels(tmpibuf, track);
 
        *width_r= width;
@@ -786,21 +786,21 @@ static unsigned char *acquire_search_bytebuf(ImBuf *ibuf, MovieTrackingTrack *tr
        return pixels;
 }
 
-static ImBuf *acquire_frame_ibuf(MovieTrackingContext *context, int framenr)
+static ImBuf *get_frame_ibuf(MovieTrackingContext *context, int framenr)
 {
        ImBuf *ibuf;
        int framenr_old= context->user.framenr;
 
        context->user.framenr= framenr;
 
-       ibuf= BKE_movieclip_acquire_ibuf_flag(context->clip, &context->user, 0);
+       ibuf= BKE_movieclip_get_ibuf_flag(context->clip, &context->user, 0);
 
        context->user.framenr= framenr_old;
 
        return ibuf;
 }
 
-static ImBuf *acquire_keyframed_ibuf(MovieTrackingContext *context, MovieTrackingTrack *track,
+static ImBuf *get_keyframed_ibuf(MovieTrackingContext *context, MovieTrackingTrack *track,
                        MovieTrackingMarker *marker, MovieTrackingMarker **marker_keyed)
 {
        int framenr= marker->framenr;
@@ -819,18 +819,18 @@ static ImBuf *acquire_keyframed_ibuf(MovieTrackingContext *context, MovieTrackin
                else a--;
        }
 
-       return acquire_frame_ibuf(context, framenr);
+       return get_frame_ibuf(context, framenr);
 }
 
-static ImBuf *acquire_adjust_ibuf(MovieTrackingContext *context, MovieTrackingTrack *track, MovieTrackingMarker *marker,
+static ImBuf *get_adjust_ibuf(MovieTrackingContext *context, MovieTrackingTrack *track, MovieTrackingMarker *marker,
                        int curfra, MovieTrackingMarker **marker_keyed)
 {
        ImBuf *ibuf= NULL;
 
        if(context->settings.adjframes == 0) {
-               ibuf= acquire_keyframed_ibuf(context, track, marker, marker_keyed);
+               ibuf= get_keyframed_ibuf(context, track, marker, marker_keyed);
        } else {
-               ibuf= acquire_frame_ibuf(context, curfra);
+               ibuf= get_frame_ibuf(context, curfra);
 
                /* use current marker as keyframed position */
                *marker_keyed= marker;
@@ -839,7 +839,7 @@ static ImBuf *acquire_adjust_ibuf(MovieTrackingContext *context, MovieTrackingTr
        return ibuf;
 }
 
-static void acquire_warped(TrackContext *track_context, int x, int y, int width, unsigned char *image)
+static void get_warped(TrackContext *track_context, int x, int y, int width, unsigned char *image)
 {
        int i, j;
 
@@ -960,7 +960,7 @@ int BKE_tracking_next(MovieTrackingContext *context)
        if(context->backwards) context->user.framenr--;
        else context->user.framenr++;
 
-       ibuf_new= BKE_movieclip_acquire_ibuf_flag(context->clip, &context->user, 0);
+       ibuf_new= BKE_movieclip_get_ibuf_flag(context->clip, &context->user, 0);
        if(!ibuf_new)
                return 0;
 
@@ -999,17 +999,17 @@ int BKE_tracking_next(MovieTrackingContext *context)
 
                                if(need_readjust) {
                                        /* calculate patch for keyframed position */
-                                       ibuf= acquire_adjust_ibuf(context, track, marker, curfra, &marker_keyed);
+                                       ibuf= get_adjust_ibuf(context, track, marker, curfra, &marker_keyed);
 
                                        if(track_context->patch)
                                                MEM_freeN(track_context->patch);
 
-                                       track_context->patch= acquire_search_floatbuf(ibuf, track, marker_keyed, &width, &height, pos, origin);
+                                       track_context->patch= get_search_floatbuf(ibuf, track, marker_keyed, &width, &height, pos, origin);
 
                                        IMB_freeImBuf(ibuf);
                                }
 
-                               patch_new= acquire_search_floatbuf(ibuf_new, track, marker, &width, &height, pos, origin);
+                               patch_new= get_search_floatbuf(ibuf_new, track, marker, &width, &height, pos, origin);
 
                                x1= pos[0];
                                y1= pos[1];
@@ -1034,9 +1034,9 @@ int BKE_tracking_next(MovieTrackingContext *context)
                                        unsigned char *image;
 
                                        /* calculate pattern for keyframed position */
-                                       ibuf= acquire_adjust_ibuf(context, track, marker, curfra, &marker_keyed);
+                                       ibuf= get_adjust_ibuf(context, track, marker, curfra, &marker_keyed);
 
-                                       image= acquire_search_bytebuf(ibuf, track, marker_keyed, &width, &height, pos, origin);
+                                       image= get_search_bytebuf(ibuf, track, marker_keyed, &width, &height, pos, origin);
 
                                        memset(warp, 0, sizeof(warp));
                                        warp[0][0]= 1;
@@ -1056,18 +1056,18 @@ int BKE_tracking_next(MovieTrackingContext *context)
                                        IMB_freeImBuf(ibuf);
                                }
 
-                               image_new= acquire_search_bytebuf(ibuf_new, track, marker, &width, &height, pos, origin);
+                               image_new= get_search_bytebuf(ibuf_new, track, marker, &width, &height, pos, origin);
 
                                if(track_context->warped==NULL) {
                                        unsigned char *image_old;
 
-                                       ibuf= acquire_frame_ibuf(context, curfra);
+                                       ibuf= get_frame_ibuf(context, curfra);
 
                                        if(track_context->warped==NULL)
                                                track_context->warped= MEM_callocN(sizeof(unsigned char)*track_context->patsize*track_context->patsize, "trackking warped");
 
-                                       image_old= acquire_search_bytebuf(ibuf, track, marker, &width, &height, pos, origin);
-                                       acquire_warped(track_context, pos[0], pos[1], width, image_old);
+                                       image_old= get_search_bytebuf(ibuf, track, marker, &width, &height, pos, origin);
+                                       get_warped(track_context, pos[0], pos[1], width, image_old);
                                        IMB_freeImBuf(ibuf);
                                        MEM_freeN(image_old);
                                }
@@ -1086,7 +1086,7 @@ int BKE_tracking_next(MovieTrackingContext *context)
                                tracked= corr>=context->settings.corr;
 
                                if(tracked)
-                                       acquire_warped(track_context, x2, y2, width, image_new);
+                                       get_warped(track_context, x2, y2, width, image_new);
 
                                MEM_freeN(image_new);
                        }
@@ -1498,7 +1498,7 @@ void BKE_tracking_invert_intrinsics(MovieTracking *tracking, float co[2], float
 }
 
 #ifdef WITH_LIBMV
-static unsigned char *acquire_ucharbuf(ImBuf *ibuf)
+static unsigned char *get_ucharbuf(ImBuf *ibuf)
 {
        int x, y;
        unsigned char *pixels, *fp;
@@ -1602,7 +1602,7 @@ void BKE_tracking_detect_fast(MovieTracking *tracking, ImBuf *ibuf,
 {
 #ifdef WITH_LIBMV
        struct libmv_Features *features;
-       unsigned char *pixels= acquire_ucharbuf(ibuf);
+       unsigned char *pixels= get_ucharbuf(ibuf);
 
        features= libmv_detectFeaturesFAST(pixels, ibuf->x, ibuf->y, ibuf->x, margin, min_trackness, min_distance);
 
@@ -1619,7 +1619,7 @@ void BKE_tracking_detect_moravec(MovieTracking *tracking, ImBuf *ibuf,
 {
 #ifdef WITH_LIBMV
        struct libmv_Features *features;
-       unsigned char *pixels= acquire_ucharbuf(ibuf);
+       unsigned char *pixels= get_ucharbuf(ibuf);
 
        features= libmv_detectFeaturesMORAVEC(pixels, ibuf->x, ibuf->y, ibuf->x, margin, count, min_distance);
 
index e277be4f3be4c07d732fc8e391ee11c6df905524..24a89fd917b1d7439eb52c5f56a78bb6bc343bdd 100644 (file)
@@ -50,8 +50,8 @@ void ED_space_clip_size(struct SpaceClip *sc, int *width, int *height);
 void ED_space_clip_zoom(struct SpaceClip *sc, ARegion *ar, float *zoomx, float *zoomy);
 void ED_space_clip_aspect(struct SpaceClip *sc, float *aspx, float *aspy);
 
-struct ImBuf *ED_space_clip_acquire_buffer(struct SpaceClip *sc);
-struct ImBuf *ED_space_clip_acquire_stable_buffer(struct SpaceClip *sc, float loc[2], float *scale, float *angle);
+struct ImBuf *ED_space_clip_get_buffer(struct SpaceClip *sc);
+struct ImBuf *ED_space_clip_get_stable_buffer(struct SpaceClip *sc, float loc[2], float *scale, float *angle);
 
 void ED_clip_update_frame(const struct Main *mainp, int cfra);
 void ED_clip_view_selection(struct SpaceClip *sc, struct ARegion *ar, int fit);
index 38883796add1c79a171079f394e6aaa85706135f..96d6ba51e852e464428b889a1d40c29befd110f4 100644 (file)
@@ -212,7 +212,7 @@ static void marker_block_handler(bContext *C, void *arg_cb, int event)
        MovieTrackingMarker *marker;
        int width, height, ok= 0;
 
-       BKE_movieclip_acquire_size(cb->clip, cb->user, &width, &height);
+       BKE_movieclip_get_size(cb->clip, cb->user, &width, &height);
 
        marker= BKE_tracking_ensure_marker(cb->track, cb->framenr);
 
@@ -362,7 +362,7 @@ void uiTemplateMarker(uiLayout *layout, PointerRNA *ptr, const char *propname, P
                float pat_dim[2], pat_pos[2], search_dim[2], search_pos[2];
                uiLayout *col;
 
-               BKE_movieclip_acquire_size(clip, user, &width, &height);
+               BKE_movieclip_get_size(clip, user, &width, &height);
 
                if(track->flag&TRACK_LOCKED) {
                        uiLayoutSetActive(layout, 0);
index d7222d4f65ce9fd0a6b76f1b77d192cc6508b877..8b413bc1ba50468768ec8147cfaaedecef1354bc 100644 (file)
@@ -124,7 +124,7 @@ static void draw_clip_tracks_curves(SpaceClip *sc)
                                                                {0.f, 1.f, 0.f}};
 
 
-       BKE_movieclip_acquire_size(clip, &sc->user, &size[0], &size[1]);
+       BKE_movieclip_get_size(clip, &sc->user, &size[0], &size[1]);
 
        if(!size[0] || !size[1])
                return;
index 97e85b1e856138bf279978d91e5873bdd37b8fe2..910ae6e7ba966ad582a412e6dacdab18a4ee5d32 100644 (file)
@@ -1203,7 +1203,7 @@ void draw_clip_main(SpaceClip *sc, ARegion *ar, Scene *scene)
        if(sc->flag&SC_SHOW_STABLE) {
                float smat[4][4], ismat[4][4];
 
-               ibuf= ED_space_clip_acquire_stable_buffer(sc, sc->loc, &sc->scale, &sc->angle);
+               ibuf= ED_space_clip_get_stable_buffer(sc, sc->loc, &sc->scale, &sc->angle);
                BKE_tracking_stabdata_to_mat4(width, height, sc->loc, sc->scale, sc->angle, sc->stabmat);
 
                unit_m4(smat);
@@ -1213,7 +1213,7 @@ void draw_clip_main(SpaceClip *sc, ARegion *ar, Scene *scene)
 
                mul_serie_m4(sc->unistabmat, smat, sc->stabmat, ismat, NULL, NULL, NULL, NULL, NULL);
        } else {
-               ibuf= ED_space_clip_acquire_buffer(sc);
+               ibuf= ED_space_clip_get_buffer(sc);
 
                zero_v2(sc->loc);
                sc->scale= 1.f;
@@ -1246,7 +1246,7 @@ void draw_clip_grease_pencil(bContext *C, int onlyv2d)
                /* if manual calibration is used then grase pencil data is already
                    drawed in draw_distortion */
                if((sc->flag&SC_MANUAL_CALIBRATION)==0 || sc->mode!=SC_MODE_DISTORTION) {
-                       ibuf= ED_space_clip_acquire_buffer(sc);
+                       ibuf= ED_space_clip_get_buffer(sc);
 
                        if(ibuf) {
                                glPushMatrix();
index 8b1d80b7bb57b37e99f1b3d9240a26e1756f41d9..1440426363940ef2204c2cf55fe85b53cd965724 100644 (file)
@@ -81,12 +81,12 @@ MovieClip *ED_space_clip(SpaceClip *sc)
        return sc->clip;
 }
 
-ImBuf *ED_space_clip_acquire_buffer(SpaceClip *sc)
+ImBuf *ED_space_clip_get_buffer(SpaceClip *sc)
 {
        if(sc->clip) {
                ImBuf *ibuf;
 
-               ibuf= BKE_movieclip_acquire_ibuf(sc->clip, &sc->user);
+               ibuf= BKE_movieclip_get_ibuf(sc->clip, &sc->user);
 
                if(ibuf && (ibuf->rect || ibuf->rect_float))
                        return ibuf;
@@ -98,12 +98,12 @@ ImBuf *ED_space_clip_acquire_buffer(SpaceClip *sc)
        return NULL;
 }
 
-ImBuf *ED_space_clip_acquire_stable_buffer(SpaceClip *sc, float loc[2], float *scale, float *angle)
+ImBuf *ED_space_clip_get_stable_buffer(SpaceClip *sc, float loc[2], float *scale, float *angle)
 {
        if(sc->clip) {
                ImBuf *ibuf;
 
-               ibuf= BKE_movieclip_acquire_stable_ibuf(sc->clip, &sc->user, loc, scale, angle);
+               ibuf= BKE_movieclip_get_stable_ibuf(sc->clip, &sc->user, loc, scale, angle);
 
                if(ibuf && (ibuf->rect || ibuf->rect_float))
                        return ibuf;
@@ -121,7 +121,7 @@ void ED_space_clip_size(SpaceClip *sc, int *width, int *height)
                *width= 0;
                *height= 0;
        } else
-               BKE_movieclip_acquire_size(sc->clip, &sc->user, width, height);
+               BKE_movieclip_get_size(sc->clip, &sc->user, width, height);
 }
 
 void ED_space_clip_zoom(SpaceClip *sc, ARegion *ar, float *zoomx, float *zoomy)
index 961c1f3b5fe25ca75cbb05283325dda6ca7ca435..4b21d831db6565ad238d7a187db413a395854c62 100644 (file)
@@ -668,7 +668,7 @@ static void clip_main_area_draw(const bContext *C, ARegion *ar)
                ImBuf *tmpibuf= NULL;
 
                if(clip && clip->tracking.stabilization.flag&TRACKING_2D_STABILIZATION) {
-                       tmpibuf= ED_space_clip_acquire_stable_buffer(sc, NULL, NULL, NULL);
+                       tmpibuf= ED_space_clip_get_stable_buffer(sc, NULL, NULL, NULL);
                }
 
                ED_clip_view_selection(sc, ar, 0);
index c829b873bf17c3dd3196ad2280db0e272c903c5c..74d15e2cf5ded4f49db5a24ce1181d8a8b47e95b 100644 (file)
@@ -1506,7 +1506,7 @@ static int solve_camera_exec(bContext *C, wmOperator *op)
        }
 
        /* could fail if footage uses images with different sizes */
-       BKE_movieclip_acquire_size(clip, NULL, &width, &height);
+       BKE_movieclip_get_size(clip, NULL, &width, &height);
 
        error= BKE_tracking_solve_reconstruction(tracking, width, height);
 
@@ -2096,7 +2096,7 @@ static int set_center_principal_exec(bContext *C, wmOperator *UNUSED(op))
        MovieClip *clip= ED_space_clip(sc);
        int width, height;
 
-       BKE_movieclip_acquire_size(clip, &sc->user, &width, &height);
+       BKE_movieclip_get_size(clip, &sc->user, &width, &height);
 
        if(width==0 || height==0)
                return OPERATOR_CANCELLED;
@@ -2231,7 +2231,7 @@ static int detect_features_exec(bContext *C, wmOperator *op)
 {
        SpaceClip *sc= CTX_wm_space_clip(C);
        MovieClip *clip= ED_space_clip(sc);
-       ImBuf *ibuf= BKE_movieclip_acquire_ibuf_flag(clip, &sc->user, 0);
+       ImBuf *ibuf= BKE_movieclip_get_ibuf_flag(clip, &sc->user, 0);
        MovieTrackingTrack *track= clip->tracking.tracks.first;
        int detector= RNA_enum_get(op->ptr, "detector");
        int use_grease_pencil= RNA_boolean_get(op->ptr, "use_grease_pencil");
index 854bd3cdb249f1f9ae04b7e38453f782cf7acca4..5cbb445738cb974791d7fb858d377b484e92526d 100644 (file)
@@ -1501,7 +1501,7 @@ static void draw_bgpic(Scene *scene, ARegion *ar, View3D *v3d)
                                        continue;
 
                                BKE_movieclip_user_set_frame(&bgpic->cuser, CFRA);
-                               ibuf= BKE_movieclip_acquire_ibuf(clip, &bgpic->cuser);
+                               ibuf= BKE_movieclip_get_ibuf(clip, &bgpic->cuser);
 
                                /* working with ibuf from image and clip has got different workflow now.
                                   ibuf acquired from clip is referenced by cache system and should
index a89810f984b056e22833a0ff8ffdc3f287a10288..0c8325de3a04c174c5b5e580c6562147a10a409b 100644 (file)
@@ -73,7 +73,7 @@ static void rna_MovieClip_resolution_get(PointerRNA *ptr, float *values)
        MovieClip *clip= (MovieClip*)ptr->id.data;
        ImBuf *ibuf;
 
-       ibuf= BKE_movieclip_acquire_ibuf(clip, NULL);
+       ibuf= BKE_movieclip_get_ibuf(clip, NULL);
        if (ibuf) {
                values[0]= ibuf->ppm[0];
                values[1]= ibuf->ppm[1];
@@ -157,7 +157,7 @@ static void rna_def_movieclip_proxy(BlenderRNA *brna)
        RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, "rna_MovieClip_reload_update");
 }
 
-static void rna_def_moviecliUuser(BlenderRNA *brna)
+static void rna_def_moviecliUser(BlenderRNA *brna)
 {
        StructRNA *srna;
        PropertyRNA *prop;
@@ -273,7 +273,7 @@ void RNA_def_movieclip(BlenderRNA *brna)
 {
        rna_def_movieclip(brna);
        rna_def_movieclip_proxy(brna);
-       rna_def_moviecliUuser(brna);
+       rna_def_moviecliUser(brna);
        rna_def_movieClipScopes(brna);
 }
 
index a7e746cd3b1b4b9b3bf72f2edcb311906393b9f4..75bad087f4f9b67c46880e2a742d440bc4b3536c 100644 (file)
@@ -53,7 +53,7 @@ static CompBuf *node_composit_get_movieclip(RenderData *rd, MovieClip *clip, Mov
        float *rect;
        int alloc= FALSE;
 
-       ibuf= BKE_movieclip_acquire_ibuf(clip, user);
+       ibuf= BKE_movieclip_get_ibuf(clip, user);
 
        if(ibuf==NULL || (ibuf->rect==NULL && ibuf->rect_float==NULL)) {
                IMB_freeImBuf(ibuf);
index d1e6d0f0b998a2d1b03cc3b4b7a60761a71e5d02..11d2f225ee1e1e78ab518e400aad43aec99b25bb 100644 (file)
@@ -66,7 +66,7 @@ static void exec(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **
 
                                ibuf->rect_float= cbuf->rect;
 
-                               BKE_movieclip_acquire_size(clip, NULL, &width, &height);
+                               BKE_movieclip_get_size(clip, NULL, &width, &height);
 
                                if(!node->storage)
                                        node->storage= BKE_tracking_distortion_create();