diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-06-19 18:26:29 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-06-19 18:26:29 +0400 |
commit | 4f044f4ec1b682fb5b13f5aa62201314d855477b (patch) | |
tree | 6e41f150492f3f64579162b5243e208a3022b2eb /source/blender/editors/space_clip/clip_editor.c | |
parent | 14a68d3a5f325373e575c28405064c4782a8ff97 (diff) |
Changes in clip editor's public api to make it's more clear
whether getting of some property happens or this property is
being changed.
Also made it more clear whether affecting property belongs
to clip or mask datablock.
Diffstat (limited to 'source/blender/editors/space_clip/clip_editor.c')
-rw-r--r-- | source/blender/editors/space_clip/clip_editor.c | 70 |
1 files changed, 35 insertions, 35 deletions
diff --git a/source/blender/editors/space_clip/clip_editor.c b/source/blender/editors/space_clip/clip_editor.c index aeddb24d84d..4dd2f82df02 100644 --- a/source/blender/editors/space_clip/clip_editor.c +++ b/source/blender/editors/space_clip/clip_editor.c @@ -91,7 +91,7 @@ int ED_space_clip_tracking_poll(bContext *C) SpaceClip *sc = CTX_wm_space_clip(C); if (sc && sc->clip) - return ED_space_clip_show_trackedit(sc); + return ED_space_clip_check_show_trackedit(sc); return FALSE; } @@ -101,7 +101,7 @@ int ED_space_clip_maskedit_poll(bContext *C) SpaceClip *sc = CTX_wm_space_clip(C); if (sc && sc->clip) { - return ED_space_clip_show_maskedit(sc); + return ED_space_clip_check_show_maskedit(sc); } return FALSE; @@ -124,7 +124,7 @@ int ED_space_clip_maskedit_mask_poll(bContext *C) /* ******** editing functions ******** */ -void ED_space_clip_set(bContext *C, bScreen *screen, SpaceClip *sc, MovieClip *clip) +void ED_space_clip_set_clip(bContext *C, bScreen *screen, SpaceClip *sc, MovieClip *clip) { MovieClip *old_clip; @@ -160,12 +160,12 @@ void ED_space_clip_set(bContext *C, bScreen *screen, SpaceClip *sc, MovieClip *c WM_event_add_notifier(C, NC_MOVIECLIP | NA_SELECTED, sc->clip); } -MovieClip *ED_space_clip(SpaceClip *sc) +MovieClip *ED_space_clip_get_clip(SpaceClip *sc) { return sc->clip; } -Mask *ED_space_clip_mask(SpaceClip *sc) +Mask *ED_space_clip_get_mask(SpaceClip *sc) { return sc->mask; } @@ -204,7 +204,7 @@ ImBuf *ED_space_clip_get_stable_buffer(SpaceClip *sc, float loc[2], float *scale return NULL; } -void ED_space_clip_size(SpaceClip *sc, int *width, int *height) +void ED_space_clip_get_clip_size(SpaceClip *sc, int *width, int *height) { if (!sc->clip) { *width = *height = 0; @@ -214,7 +214,7 @@ void ED_space_clip_size(SpaceClip *sc, int *width, int *height) } } -void ED_space_clip_mask_size(SpaceClip *sc, int *width, int *height) +void ED_space_clip_get_mask_size(SpaceClip *sc, int *width, int *height) { /* quite the same as ED_space_clip_size, but it also runs aspect correction on output resolution * this is needed because mask should be rasterized with exactly the same resolution as @@ -228,20 +228,20 @@ void ED_space_clip_mask_size(SpaceClip *sc, int *width, int *height) } else { float aspx, aspy; - ED_space_clip_size(sc, width, height); - ED_space_clip_aspect(sc, &aspx, &aspy); + ED_space_clip_get_clip_size(sc, width, height); + ED_space_clip_get_clip_aspect(sc, &aspx, &aspy); *width *= aspx; *height *= aspy; } } -void ED_space_clip_mask_aspect(SpaceClip *sc, float *aspx, float *aspy) +void ED_space_clip_get_mask_aspect(SpaceClip *sc, float *aspx, float *aspy) { int w, h; - ED_space_clip_aspect(sc, aspx, aspy); - ED_space_clip_size(sc, &w, &h); + ED_space_clip_get_clip_aspect(sc, aspx, aspy); + ED_space_clip_get_clip_size(sc, &w, &h); /* now this is not accounted for! */ #if 0 @@ -259,19 +259,19 @@ void ED_space_clip_mask_aspect(SpaceClip *sc, float *aspx, float *aspy) } } -void ED_space_clip_zoom(SpaceClip *sc, ARegion *ar, float *zoomx, float *zoomy) +void ED_space_clip_get_zoom(SpaceClip *sc, ARegion *ar, float *zoomx, float *zoomy) { int width, height; - ED_space_clip_size(sc, &width, &height); + ED_space_clip_get_clip_size(sc, &width, &height); *zoomx = (float)(ar->winrct.xmax - ar->winrct.xmin + 1) / (float)((ar->v2d.cur.xmax - ar->v2d.cur.xmin) * width); *zoomy = (float)(ar->winrct.ymax - ar->winrct.ymin + 1) / (float)((ar->v2d.cur.ymax - ar->v2d.cur.ymin) * height); } -void ED_space_clip_aspect(SpaceClip *sc, float *aspx, float *aspy) +void ED_space_clip_get_clip_aspect(SpaceClip *sc, float *aspx, float *aspy) { - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); if (clip) BKE_movieclip_aspect(clip, aspx, aspy); @@ -279,7 +279,7 @@ void ED_space_clip_aspect(SpaceClip *sc, float *aspx, float *aspy) *aspx = *aspy = 1.0f; } -void ED_space_clip_aspect_dimension_aware(SpaceClip *sc, float *aspx, float *aspy) +void ED_space_clip_get_clip_aspect_dimension_aware(SpaceClip *sc, float *aspx, float *aspy) { int w, h; @@ -290,8 +290,8 @@ void ED_space_clip_aspect_dimension_aware(SpaceClip *sc, float *aspx, float *asp * mainly this is sued for transformation stuff */ - ED_space_clip_aspect(sc, aspx, aspy); - ED_space_clip_size(sc, &w, &h); + ED_space_clip_get_clip_aspect(sc, aspx, aspy); + ED_space_clip_get_clip_size(sc, &w, &h); *aspx *= (float)w; *aspy *= (float)h; @@ -330,23 +330,23 @@ void ED_clip_update_frame(const Main *mainp, int cfra) } /* return current frame number in clip space */ -int ED_space_clip_clip_framenr(SpaceClip *sc) +int ED_space_clip_get_clip_frame_number(SpaceClip *sc) { - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); return BKE_movieclip_remap_scene_to_clip_frame(clip, sc->user.framenr); } static int selected_boundbox(SpaceClip *sc, float min[2], float max[2]) { - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); MovieTrackingTrack *track; int width, height, ok = FALSE; ListBase *tracksbase = BKE_tracking_get_active_tracks(&clip->tracking); INIT_MINMAX2(min, max); - ED_space_clip_size(sc, &width, &height); + ED_space_clip_get_clip_size(sc, &width, &height); track = tracksbase->first; while (track) { @@ -388,7 +388,7 @@ int ED_clip_view_selection(SpaceClip *sc, ARegion *ar, int fit) int w, h, frame_width, frame_height; float min[2], max[2]; - ED_space_clip_size(sc, &frame_width, &frame_height); + ED_space_clip_get_clip_size(sc, &frame_width, &frame_height); if (frame_width == 0 || frame_height == 0) return FALSE; @@ -408,7 +408,7 @@ int ED_clip_view_selection(SpaceClip *sc, ARegion *ar, int fit) int width, height; float zoomx, zoomy, newzoom, aspx, aspy; - ED_space_clip_aspect(sc, &aspx, &aspy); + ED_space_clip_get_clip_aspect(sc, &aspx, &aspy); width = ar->winrct.xmax - ar->winrct.xmin + 1; height = ar->winrct.ymax - ar->winrct.ymin + 1; @@ -430,11 +430,11 @@ void ED_clip_point_undistorted_pos(SpaceClip *sc, const float co[2], float r_co[ copy_v2_v2(r_co, co); if (sc->user.render_flag & MCLIP_PROXY_RENDER_UNDISTORT) { - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); float aspy = 1.0f / clip->tracking.camera.pixel_aspect; int width, height; - ED_space_clip_size(sc, &width, &height); + ED_space_clip_get_clip_size(sc, &width, &height); r_co[0] *= width; r_co[1] *= height * aspy; @@ -453,8 +453,8 @@ void ED_clip_point_stable_pos(const bContext *C, float x, float y, float *xr, fl int sx, sy, width, height; float zoomx, zoomy, pos[3], imat[4][4]; - ED_space_clip_zoom(sc, ar, &zoomx, &zoomy); - ED_space_clip_size(sc, &width, &height); + ED_space_clip_get_zoom(sc, ar, &zoomx, &zoomy); + ED_space_clip_get_clip_size(sc, &width, &height); UI_view2d_to_region_no_clip(&ar->v2d, 0.0f, 0.0f, &sx, &sy); @@ -469,7 +469,7 @@ void ED_clip_point_stable_pos(const bContext *C, float x, float y, float *xr, fl *yr = pos[1] / height; if (sc->user.render_flag & MCLIP_PROXY_RENDER_UNDISTORT) { - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); MovieTracking *tracking = &clip->tracking; float aspy = 1.0f / tracking->camera.pixel_aspect; float tmp[2] = {*xr * width, *yr * height * aspy}; @@ -493,8 +493,8 @@ void ED_clip_point_stable_pos__reverse(SpaceClip *sc, ARegion *ar, const float c int sx, sy; UI_view2d_to_region_no_clip(&ar->v2d, 0.0f, 0.0f, &sx, &sy); - ED_space_clip_size(sc, &width, &height); - ED_space_clip_zoom(sc, ar, &zoomx, &zoomy); + ED_space_clip_get_clip_size(sc, &width, &height); + ED_space_clip_get_zoom(sc, ar, &zoomx, &zoomy); ED_clip_point_undistorted_pos(sc, co, pos); pos[2] = 0.0f; @@ -552,7 +552,7 @@ int ED_space_clip_texture_buffer_supported(SpaceClip *sc) int ED_space_clip_load_movieclip_buffer(SpaceClip *sc, ImBuf *ibuf) { SpaceClipDrawContext *context = sc->draw_context; - MovieClip *clip = ED_space_clip(sc); + MovieClip *clip = ED_space_clip_get_clip(sc); int need_rebind = 0; context->last_texture = glaGetOneInteger(GL_TEXTURE_2D); @@ -657,7 +657,7 @@ void ED_space_clip_free_texture_buffer(SpaceClip *sc) /* ******** masking editing related functions ******** */ -int ED_space_clip_show_trackedit(SpaceClip *sc) +int ED_space_clip_check_show_trackedit(SpaceClip *sc) { if (sc) { return ELEM3(sc->mode, SC_MODE_TRACKING, SC_MODE_RECONSTRUCTION, SC_MODE_DISTORTION); @@ -666,7 +666,7 @@ int ED_space_clip_show_trackedit(SpaceClip *sc) return FALSE; } -int ED_space_clip_show_maskedit(SpaceClip *sc) +int ED_space_clip_check_show_maskedit(SpaceClip *sc) { if (sc) { return sc->mode == SC_MODE_MASKEDIT; |