diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-05-09 20:00:39 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-05-09 20:00:39 +0400 |
commit | c59f8506c0db0c004de21ca9a94b4e70265b27c6 (patch) | |
tree | a734052d9a24ad27a1c8c3d9816ef4a70e635dec /source | |
parent | 369f5b79eada9b119d191a730301e977612048c0 (diff) |
Camera tracking: exr frames used to be displayed in linear space
It was a regression since texture buffer merge from tomato, now ensure
all display happens in sRGB space as it used to be before.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/tracking.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_clip/clip_editor.c | 21 |
2 files changed, 9 insertions, 14 deletions
diff --git a/source/blender/blenkernel/intern/tracking.c b/source/blender/blenkernel/intern/tracking.c index f1100a1ae08..4e2b4be474b 100644 --- a/source/blender/blenkernel/intern/tracking.c +++ b/source/blender/blenkernel/intern/tracking.c @@ -1198,6 +1198,8 @@ static ImBuf *get_area_imbuf(ImBuf *ibuf, MovieTrackingTrack *track, MovieTracki else tmpibuf = IMB_allocImBuf(w + margin * 2, h + margin * 2, 32, IB_rect); + tmpibuf->profile = ibuf->profile; + IMB_rectcpy(tmpibuf, ibuf, 0, 0, x1 - margin, y1 - margin, w + margin * 2, h + margin * 2); if (pos != NULL) { diff --git a/source/blender/editors/space_clip/clip_editor.c b/source/blender/editors/space_clip/clip_editor.c index 94422e51891..b3ac535ab9d 100644 --- a/source/blender/editors/space_clip/clip_editor.c +++ b/source/blender/editors/space_clip/clip_editor.c @@ -456,16 +456,11 @@ int ED_space_clip_load_movieclip_buffer(SpaceClip *sc, ImBuf *ibuf) if (need_rebind) { int width = ibuf->x, height = ibuf->y; - float *frect = NULL, *fscalerect = NULL; - unsigned int *rect = NULL, *scalerect = NULL; int need_recreate = 0; if (width > GL_MAX_TEXTURE_SIZE || height > GL_MAX_TEXTURE_SIZE) return 0; - rect = ibuf->rect; - frect = ibuf->rect_float; - /* if image resolution changed (e.g. switched to proxy display) texture need to be recreated */ need_recreate = context->image_width != ibuf->x || context->image_height != ibuf->y; @@ -498,10 +493,13 @@ int ED_space_clip_load_movieclip_buffer(SpaceClip *sc, ImBuf *ibuf) glBindTexture(GL_TEXTURE_2D, context->texture); } - if (frect) - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA16, width, height, 0, GL_RGBA, GL_FLOAT, frect); - else - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, rect); + if (ibuf->rect_float) { + if (ibuf->rect == NULL) + IMB_rect_from_float(ibuf); + } + + if (ibuf->rect) + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, ibuf->rect); /* store settings */ context->texture_allocated = 1; @@ -509,11 +507,6 @@ int ED_space_clip_load_movieclip_buffer(SpaceClip *sc, ImBuf *ibuf) context->image_width = ibuf->x; context->image_height = ibuf->y; context->framenr = sc->user.framenr; - - if (fscalerect) - MEM_freeN(fscalerect); - if (scalerect) - MEM_freeN(scalerect); } else { /* displaying exactly the same image which was loaded t oa texture, |