[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [50756] trunk/blender/source/blender/ blenkernel/intern/image.c: Color Management: new generated images had empty color space by default
Sergey Sharybin
sergey.vfx at gmail.com
Wed Sep 19 21:53:16 CEST 2012
Revision: 50756
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=50756
Author: nazgul
Date: 2012-09-19 19:53:16 +0000 (Wed, 19 Sep 2012)
Log Message:
-----------
Color Management: new generated images had empty color space by default
Now use default byte/float colorspace when creating new image.
Modified Paths:
--------------
trunk/blender/source/blender/blenkernel/intern/image.c
Modified: trunk/blender/source/blender/blenkernel/intern/image.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/image.c 2012-09-19 19:42:01 UTC (rev 50755)
+++ trunk/blender/source/blender/blenkernel/intern/image.c 2012-09-19 19:53:16 UTC (rev 50756)
@@ -643,6 +643,7 @@
if (ima) {
ImBuf *ibuf;
+ const char *colorspace;
/* BLI_strncpy(ima->name, name, FILE_MAX); */ /* don't do this, this writes in ain invalid filepath! */
ima->gen_x = width;
@@ -653,6 +654,14 @@
ibuf = add_ibuf_size(width, height, ima->name, depth, floatbuf, gen_type, color);
image_assign_ibuf(ima, ibuf, IMA_NO_INDEX, 0);
+ /* assign colorspaces */
+ if (floatbuf)
+ colorspace = IMB_colormanagement_role_colorspace_name_get(COLOR_ROLE_DEFAULT_FLOAT);
+ else
+ colorspace = IMB_colormanagement_role_colorspace_name_get(COLOR_ROLE_DEFAULT_BYTE);
+
+ BLI_strncpy(ima->colorspace_settings.name, colorspace, sizeof(ima->colorspace_settings.name));
+
ima->ok = IMA_OK_LOADED;
}
More information about the Bf-blender-cvs
mailing list