Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/blenkernel/intern/tracking.c')
-rw-r--r--source/blender/blenkernel/intern/tracking.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/tracking.c b/source/blender/blenkernel/intern/tracking.c
index 04766910df6..7461e057df5 100644
--- a/source/blender/blenkernel/intern/tracking.c
+++ b/source/blender/blenkernel/intern/tracking.c
@@ -2688,19 +2688,26 @@ ImBuf *BKE_tracking_stabilize(MovieTracking *tracking, int framenr, ImBuf *ibuf,
IMB_rectcpy(tmpibuf, ibuf, tloc[0]-(tscale-1.0f)*width/2.0f, tloc[1]-(tscale-1.0f)*height/2.0f, 0, 0, ibuf->x, ibuf->y);
} else {
float mat[4][4];
- int i, j;
+ int i, j, filter= tracking->stabilization.filter;
+ void (*interpolation) (struct ImBuf*, struct ImBuf*, float, float, int, int) = NULL;
BKE_tracking_stabdata_to_mat4(ibuf->x, ibuf->y, aspect, tloc, tscale, tangle, mat);
invert_m4(mat);
+ if(filter == TRACKING_FILTER_NEAREAST)
+ interpolation = neareast_interpolation;
+ else if(filter == TRACKING_FILTER_BILINEAR)
+ interpolation = bilinear_interpolation;
+ else if(filter == TRACKING_FILTER_BICUBIC)
+ interpolation = bicubic_interpolation;
+
for(j=0; j<tmpibuf->y; j++) {
for(i=0; i<tmpibuf->x;i++) {
float vec[3]= {i, j, 0};
mul_v3_m4v3(vec, mat, vec);
- /* TODO: add selector for interpolation method */
- neareast_interpolation(ibuf, tmpibuf, vec[0], vec[1], i, j);
+ interpolation(ibuf, tmpibuf, vec[0], vec[1], i, j);
}
}
}