diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2012-09-23 22:50:56 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2012-09-23 22:50:56 +0400 |
commit | a42ba82f638e481d7fd3c3ed2ba05c331ef6717e (patch) | |
tree | 81a2b9221799707b49b74a5df8bb3ff964ba78bd /source/blender/editors/interface/interface_ops.c | |
parent | 7afbdff1b6c348227e652e1c3071ab7ba7c91c44 (diff) | |
parent | a73dd3476e7d180d3320afc04d218ce22f2f3bfc (diff) |
Merged changes in the trunk up to revision 50829.
Conflicts resolved:
source/blender/blenloader/intern/readfile.c
source/blender/render/intern/source/convertblender.c
source/blender/render/intern/source/pipeline.c
Also addressed code inconsistency due to changes in the trunk revision 50628 (color
management with OCIO) and 50806 (UV project material). OCIO-related changes are marked
OCIO_TODO as in some other files modified in revision 50628.
Diffstat (limited to 'source/blender/editors/interface/interface_ops.c')
-rw-r--r-- | source/blender/editors/interface/interface_ops.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/source/blender/editors/interface/interface_ops.c b/source/blender/editors/interface/interface_ops.c index e8b8959fd43..ded5887f7f2 100644 --- a/source/blender/editors/interface/interface_ops.c +++ b/source/blender/editors/interface/interface_ops.c @@ -58,6 +58,8 @@ #include "UI_interface.h" +#include "IMB_colormanagement.h" + #include "interface_intern.h" #include "WM_api.h" @@ -75,7 +77,7 @@ /* ********************************************************** */ typedef struct Eyedropper { - short do_color_management; + struct ColorManagedDisplay *display; PointerRNA ptr; PropertyRNA *prop; @@ -89,8 +91,6 @@ typedef struct Eyedropper { static int eyedropper_init(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); - const int color_manage = scene->r.color_mgt_flag & R_COLOR_MANAGEMENT; - Eyedropper *eye; op->customdata = eye = MEM_callocN(sizeof(Eyedropper), "Eyedropper"); @@ -106,7 +106,12 @@ static int eyedropper_init(bContext *C, wmOperator *op) return FALSE; } - eye->do_color_management = (color_manage && RNA_property_subtype(eye->prop) == PROP_COLOR); + if (RNA_property_subtype(eye->prop) == PROP_COLOR) { + const char *display_device; + + display_device = scene->display_settings.display_device; + eye->display = IMB_colormanagement_display_get_named(display_device); + } return TRUE; } @@ -194,9 +199,10 @@ static void eyedropper_color_set(bContext *C, Eyedropper *eye, const float col[3 /* to maintain alpha */ RNA_property_float_get_array(&eye->ptr, eye->prop, col_conv); - /* convert from screen (srgb) space to linear rgb space */ - if (eye->do_color_management) { - srgb_to_linearrgb_v3_v3(col_conv, col); + /* convert from display space to linear rgb space */ + if (eye->display) { + copy_v3_v3(col_conv, col); + IMB_colormanagement_display_to_scene_linear_v3(col_conv, eye->display); } else { copy_v3_v3(col_conv, col); @@ -906,7 +912,7 @@ static void UI_OT_editsource(wmOperatorType *ot) * Note: this includes utility functions and button matching checks. * this only works in conjunction with a py operator! */ -void edittranslation_find_po_file(const char *root, const char *uilng, char *path, const size_t maxlen) +static void edittranslation_find_po_file(const char *root, const char *uilng, char *path, const size_t maxlen) { char tstr[32]; /* Should be more than enough! */ /* First, full lang code. */ |