[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [46474] trunk/blender/source/blender: Camera tracking: exr frames used to be displayed in linear space

Sergey Sharybin sergey.vfx at gmail.com
Wed May 9 18:00:40 CEST 2012


Revision: 46474
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=46474
Author:   nazgul
Date:     2012-05-09 16:00:39 +0000 (Wed, 09 May 2012)
Log Message:
-----------
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.

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/tracking.c
    trunk/blender/source/blender/editors/space_clip/clip_editor.c

Modified: trunk/blender/source/blender/blenkernel/intern/tracking.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/tracking.c	2012-05-09 15:54:25 UTC (rev 46473)
+++ trunk/blender/source/blender/blenkernel/intern/tracking.c	2012-05-09 16:00:39 UTC (rev 46474)
@@ -1198,6 +1198,8 @@
 	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) {

Modified: trunk/blender/source/blender/editors/space_clip/clip_editor.c
===================================================================
--- trunk/blender/source/blender/editors/space_clip/clip_editor.c	2012-05-09 15:54:25 UTC (rev 46473)
+++ trunk/blender/source/blender/editors/space_clip/clip_editor.c	2012-05-09 16:00:39 UTC (rev 46474)
@@ -456,16 +456,11 @@
 
 	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,22 +493,20 @@
 			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;
 		context->texture_ibuf = 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,




More information about the Bf-blender-cvs mailing list