diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2011-12-30 14:20:29 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2011-12-30 14:20:29 +0400 |
commit | c21cfb4fcdea919e9dac50cd7784cd4902695f1d (patch) | |
tree | 0091e7fa14c72af959cf07fbb6013261824cf242 /source/blender/editors | |
parent | 90760b9f877beba7eeb159d369406feb91feff03 (diff) | |
parent | e98e8acf1a00ec4fb1adf0c4e30bc687cfc8efad (diff) |
Camera tracking: improvements of track preview widget
- Enable bicybic filtering fir image displayed in track preview
- Option to show grayscale content of track preview
- When some channels are disabled, display exactly the same
content of preview image which is sending to tracker library.
Merged from tomato branch using command:
svn merge -r42382:42383 -r42384:42385 -r42394:42395 \
-r42397:42398 -r42398:42399 -r42406:42407 \
-r42410:42411 -r42417:42418 -r42471:42472 \
^/branches/soc-2011-tomato
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/interface/interface_draw.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c index 7dd07db9b30..6ebb67af67a 100644 --- a/source/blender/editors/interface/interface_draw.c +++ b/source/blender/editors/interface/interface_draw.c @@ -1465,6 +1465,8 @@ static ImBuf *scale_trackpreview_ibuf(ImBuf *ibuf, float zoomx, float zoomy) { ImBuf *scaleibuf; int x, y, w= ibuf->x*zoomx, h= ibuf->y*zoomy; + const float max_x= ibuf->x-1.0f; + const float max_y= ibuf->y-1.0f; const float scalex= 1.0f/zoomx; const float scaley= 1.0f/zoomy; @@ -1472,15 +1474,13 @@ static ImBuf *scale_trackpreview_ibuf(ImBuf *ibuf, float zoomx, float zoomy) for(y= 0; y<scaleibuf->y; y++) { for (x= 0; x<scaleibuf->x; x++) { - int pixel= scaleibuf->x*y + x; - int orig_pixel= ibuf->x*(int)(scaley*(float)y) + (int)(scalex*(float)x); - char *rrgb= (char*)scaleibuf->rect + pixel*4; - char *orig_rrgb= (char*)ibuf->rect + orig_pixel*4; - - rrgb[0]= orig_rrgb[0]; - rrgb[1]= orig_rrgb[1]; - rrgb[2]= orig_rrgb[2]; - rrgb[3]= orig_rrgb[3]; + float src_x= scalex*x; + float src_y= scaley*y; + + CLAMP(src_x, 0, max_x); + CLAMP(src_y, 0, max_y); + + bicubic_interpolation(ibuf, scaleibuf, src_x, src_y, x, y); } } |