diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-04-07 20:59:06 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-04-07 20:59:06 +0400 |
commit | fec5221a65e9fe762f9bcbd2fd46317dc647a4ad (patch) | |
tree | d23b01a22b99a0265c20e9d24ad963cc7acec268 | |
parent | 7018345beecf0163ccae9077c150e7b74610a852 (diff) |
Disabling color channels for float images in clip editor now works fine.
-rw-r--r-- | source/blender/blenkernel/intern/tracking.c | 3 | ||||
-rw-r--r-- | source/blender/editors/space_clip/clip_draw.c | 11 |
2 files changed, 11 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/tracking.c b/source/blender/blenkernel/intern/tracking.c index 0af8f2cf625..7654c361d14 100644 --- a/source/blender/blenkernel/intern/tracking.c +++ b/source/blender/blenkernel/intern/tracking.c @@ -1125,6 +1125,9 @@ void BKE_tracking_disable_imbuf_channels(ImBuf *ibuf, int disable_red, int disab } } } + + if (ibuf->rect_float) + ibuf->userflags |= IB_RECT_INVALID; } static void disable_imbuf_channels(ImBuf *ibuf, MovieTrackingTrack *track, int grayscale) diff --git a/source/blender/editors/space_clip/clip_draw.c b/source/blender/editors/space_clip/clip_draw.c index 019b23c231b..bf8976035a8 100644 --- a/source/blender/editors/space_clip/clip_draw.c +++ b/source/blender/editors/space_clip/clip_draw.c @@ -216,6 +216,13 @@ static void draw_movieclip_notes(SpaceClip *sc, ARegion *ar) ED_region_info_draw(ar, str, block, 0.6f); } +static void verify_buffer_float(ImBuf *ibuf) +{ + if (ibuf->rect_float && (ibuf->rect == NULL || (ibuf->userflags & IB_RECT_INVALID))) { + IMB_rect_from_float(ibuf); + } +} + static void draw_movieclip_buffer(SpaceClip *sc, ARegion *ar, ImBuf *ibuf, int width, int height, float zoomx, float zoomy) { @@ -233,9 +240,7 @@ static void draw_movieclip_buffer(SpaceClip *sc, ARegion *ar, ImBuf *ibuf, glRectf(x, y, x + zoomx * width, y + zoomy * height); } else { - if (ibuf->rect_float && !ibuf->rect) { - IMB_rect_from_float(ibuf); - } + verify_buffer_float(ibuf); if (ibuf->rect) glaDrawPixelsSafe(x, y, ibuf->x, ibuf->y, ibuf->x, GL_RGBA, GL_UNSIGNED_BYTE, ibuf->rect); |