Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2012-09-19 23:53:16 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2012-09-19 23:53:16 +0400
commita09b5c1f2036333608276674d4a6047b911556ed (patch)
treec458d5a4a5c984e88e9f9980348ff0c9b0be3608 /source
parent88010085074a4e5c3cfb7f56683b410bcafbba3b (diff)
Color Management: new generated images had empty color space by default
Now use default byte/float colorspace when creating new image.
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/intern/image.c9
1 files changed, 9 insertions, 0 deletions
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;
}