diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-02-04 16:14:59 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-02-04 16:14:59 +0400 |
commit | df1fe576213e0a5245fd5c219af071f007a4b9b2 (patch) | |
tree | 1fa4dbf944aee739d6b249bc93e29b0ace9e0746 /source/blender/editors/space_image/image_ops.c | |
parent | 29a15f287f7f945e72967d1feef8584bef1c4141 (diff) |
Fix #34079: RGB and HSV values inconsistency
Use COLOR_GAMMA subtype for new image color since this color is
actually being color managed. Also made it so byte and float
buffers would have the same exact display color after creation
with the same color value.
Also made it so color strip's color have COLOR_GAMMA subtype,
otherwise swatch color wouldn't match render result which is
not nice at all.
Diffstat (limited to 'source/blender/editors/space_image/image_ops.c')
-rw-r--r-- | source/blender/editors/space_image/image_ops.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index 23adf7eb575..8bb51edde02 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -1735,11 +1735,6 @@ static int image_new_exec(bContext *C, wmOperator *op) RNA_float_get_array(op->ptr, "color", color); alpha = RNA_boolean_get(op->ptr, "alpha"); - if (!floatbuf) { - /* OCIO_TODO: perhaps we need to convert to display space, not just to sRGB */ - linearrgb_to_srgb_v3_v3(color, color); - } - if (!alpha) color[3] = 1.0f; @@ -1806,6 +1801,7 @@ void IMAGE_OT_new(wmOperatorType *ot) RNA_def_int(ot->srna, "width", 1024, 1, INT_MAX, "Width", "Image width", 1, 16384); RNA_def_int(ot->srna, "height", 1024, 1, INT_MAX, "Height", "Image height", 1, 16384); prop = RNA_def_float_color(ot->srna, "color", 4, NULL, 0.0f, FLT_MAX, "Color", "Default fill color", 0.0f, 1.0f); + RNA_def_property_subtype(prop, PROP_COLOR_GAMMA); RNA_def_property_float_array_default(prop, default_color); RNA_def_boolean(ot->srna, "alpha", 1, "Alpha", "Create an image with an alpha channel"); RNA_def_enum(ot->srna, "generated_type", image_generated_type_items, IMA_GENTYPE_BLANK, |