Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/tracking_stabilize.c
| Show All 36 Lines | |||||
| #include "BLI_sort_utils.h" | #include "BLI_sort_utils.h" | ||||
| #include "BLI_task.h" | #include "BLI_task.h" | ||||
| #include "BLI_utildefines.h" | #include "BLI_utildefines.h" | ||||
| #include "BKE_fcurve.h" | #include "BKE_fcurve.h" | ||||
| #include "BKE_movieclip.h" | #include "BKE_movieclip.h" | ||||
| #include "BKE_tracking.h" | #include "BKE_tracking.h" | ||||
| #include "IMB_colormanagement.h" | |||||
| #include "IMB_imbuf.h" | #include "IMB_imbuf.h" | ||||
| #include "IMB_imbuf_types.h" | #include "IMB_imbuf_types.h" | ||||
| #include "MEM_guardedalloc.h" | #include "MEM_guardedalloc.h" | ||||
| /* == Parameterization constants == */ | /* == Parameterization constants == */ | ||||
| /* When measuring the scale changes relative to the rotation pivot point, it | /* When measuring the scale changes relative to the rotation pivot point, it | ||||
| * might happen accidentally that a probe point (tracking point), which doesn't | * might happen accidentally that a probe point (tracking point), which doesn't | ||||
| ▲ Show 20 Lines • Show All 1,341 Lines • ▼ Show 20 Lines | if ((stab->flag & TRACKING_2D_STABILIZATION) == 0) { | ||||
| if (angle) { | if (angle) { | ||||
| *angle = 0.0f; | *angle = 0.0f; | ||||
| } | } | ||||
| return ibuf; | return ibuf; | ||||
| } | } | ||||
| /* Allocate frame for stabilization result. */ | /* Allocate frame for stabilization result, copy alpha mode and colorspace. */ | ||||
| ibuf_flags = 0; | ibuf_flags = 0; | ||||
| if (ibuf->rect) { | if (ibuf->rect) { | ||||
| ibuf_flags |= IB_rect; | ibuf_flags |= IB_rect; | ||||
| } | } | ||||
| if (ibuf->rect_float) { | if (ibuf->rect_float) { | ||||
| ibuf_flags |= IB_rectfloat; | ibuf_flags |= IB_rectfloat; | ||||
| } | } | ||||
| tmpibuf = IMB_allocImBuf(ibuf->x, ibuf->y, ibuf->planes, ibuf_flags); | tmpibuf = IMB_allocImBuf(ibuf->x, ibuf->y, ibuf->planes, ibuf_flags); | ||||
| IMB_colormanagegent_copy_settings(ibuf, tmpibuf); | |||||
| /* Calculate stabilization matrix. */ | /* Calculate stabilization matrix. */ | ||||
| BKE_tracking_stabilization_data_get(clip, framenr, width, height, tloc, &tscale, &tangle); | BKE_tracking_stabilization_data_get(clip, framenr, width, height, tloc, &tscale, &tangle); | ||||
| BKE_tracking_stabilization_data_to_mat4( | BKE_tracking_stabilization_data_to_mat4( | ||||
| ibuf->x, ibuf->y, pixel_aspect, tloc, tscale, tangle, mat); | ibuf->x, ibuf->y, pixel_aspect, tloc, tscale, tangle, mat); | ||||
| /* The following code visits each nominal target grid position | /* The following code visits each nominal target grid position | ||||
| * and picks interpolated data "backwards" from source. | * and picks interpolated data "backwards" from source. | ||||
| ▲ Show 20 Lines • Show All 84 Lines • Show Last 20 Lines | |||||