From a09b5c1f2036333608276674d4a6047b911556ed Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Wed, 19 Sep 2012 19:53:16 +0000 Subject: Color Management: new generated images had empty color space by default Now use default byte/float colorspace when creating new image. --- source/blender/blenkernel/intern/image.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'source') diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index 5c1fbf66c43..7146c48cd2f 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -643,6 +643,7 @@ Image *BKE_image_add_generated(unsigned int width, unsigned int height, const ch 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 @@ Image *BKE_image_add_generated(unsigned int width, unsigned int height, const ch 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; } -- cgit v1.2.3