Fix: Wrong color space for gizmo, fluid grid line and stamp colors
Mark these as sRGB, as they already were or should be interpreted this way. Pull Request: https://projects.blender.org/blender/blender/pulls/145755
This commit is contained in:
@@ -2057,6 +2057,7 @@ void BKE_image_stamp_buf(Scene *scene,
|
||||
ibuf->x,
|
||||
ibuf->y,
|
||||
ibuf->byte_buffer.colorspace);
|
||||
/* No conversion to scene linear needed, #BLF_buffer_col accepts sRGB. */
|
||||
BLF_buffer_col(mono, scene->r.fg_stamp);
|
||||
pad = BLF_width_max(mono);
|
||||
|
||||
@@ -2067,13 +2068,18 @@ void BKE_image_stamp_buf(Scene *scene,
|
||||
x = 0;
|
||||
y = ibuf->y;
|
||||
|
||||
/* Background needs to be converted to scene linear. */
|
||||
float bg_stamp[4];
|
||||
IMB_colormanagement_srgb_to_scene_linear_v3(bg_stamp, scene->r.bg_stamp);
|
||||
bg_stamp[3] = scene->r.bg_stamp[3];
|
||||
|
||||
if (TEXT_SIZE_CHECK(stamp_data.file, w, h)) {
|
||||
/* Top left corner */
|
||||
y -= h;
|
||||
|
||||
/* also a little of space to the background. */
|
||||
IMB_rectfill_area(ibuf,
|
||||
scene->r.bg_stamp,
|
||||
bg_stamp,
|
||||
x - BUFF_MARGIN_X,
|
||||
y - BUFF_MARGIN_Y,
|
||||
w + BUFF_MARGIN_X,
|
||||
@@ -2093,7 +2099,7 @@ void BKE_image_stamp_buf(Scene *scene,
|
||||
|
||||
/* and space for background. */
|
||||
IMB_rectfill_area(
|
||||
ibuf, scene->r.bg_stamp, 0, y - BUFF_MARGIN_Y, w + BUFF_MARGIN_X, y + h + BUFF_MARGIN_Y);
|
||||
ibuf, bg_stamp, 0, y - BUFF_MARGIN_Y, w + BUFF_MARGIN_X, y + h + BUFF_MARGIN_Y);
|
||||
|
||||
BLF_position(mono, x, y + y_ofs, 0.0);
|
||||
BLF_draw_buffer(mono, stamp_data.date, sizeof(stamp_data.date));
|
||||
@@ -2108,7 +2114,7 @@ void BKE_image_stamp_buf(Scene *scene,
|
||||
|
||||
/* and space for background. */
|
||||
IMB_rectfill_area(
|
||||
ibuf, scene->r.bg_stamp, 0, y - BUFF_MARGIN_Y, w + BUFF_MARGIN_X, y + h + BUFF_MARGIN_Y);
|
||||
ibuf, bg_stamp, 0, y - BUFF_MARGIN_Y, w + BUFF_MARGIN_X, y + h + BUFF_MARGIN_Y);
|
||||
|
||||
BLF_position(mono, x, y + y_ofs, 0.0);
|
||||
BLF_draw_buffer(mono, stamp_data.rendertime, sizeof(stamp_data.rendertime));
|
||||
@@ -2123,7 +2129,7 @@ void BKE_image_stamp_buf(Scene *scene,
|
||||
|
||||
/* and space for background. */
|
||||
IMB_rectfill_area(
|
||||
ibuf, scene->r.bg_stamp, 0, y - BUFF_MARGIN_Y, w + BUFF_MARGIN_X, y + h + BUFF_MARGIN_Y);
|
||||
ibuf, bg_stamp, 0, y - BUFF_MARGIN_Y, w + BUFF_MARGIN_X, y + h + BUFF_MARGIN_Y);
|
||||
|
||||
BLF_position(mono, x, y + y_ofs, 0.0);
|
||||
BLF_draw_buffer(mono, stamp_data.memory, sizeof(stamp_data.memory));
|
||||
@@ -2138,7 +2144,7 @@ void BKE_image_stamp_buf(Scene *scene,
|
||||
|
||||
/* and space for background. */
|
||||
IMB_rectfill_area(
|
||||
ibuf, scene->r.bg_stamp, 0, y - BUFF_MARGIN_Y, w + BUFF_MARGIN_X, y + h + BUFF_MARGIN_Y);
|
||||
ibuf, bg_stamp, 0, y - BUFF_MARGIN_Y, w + BUFF_MARGIN_X, y + h + BUFF_MARGIN_Y);
|
||||
|
||||
BLF_position(mono, x, y + y_ofs, 0.0);
|
||||
BLF_draw_buffer(mono, stamp_data.hostname, sizeof(stamp_data.hostname));
|
||||
@@ -2154,7 +2160,7 @@ void BKE_image_stamp_buf(Scene *scene,
|
||||
|
||||
/* and space for background. */
|
||||
IMB_rectfill_area(
|
||||
ibuf, scene->r.bg_stamp, 0, y - BUFF_MARGIN_Y, w + BUFF_MARGIN_X, y + h + BUFF_MARGIN_Y);
|
||||
ibuf, bg_stamp, 0, y - BUFF_MARGIN_Y, w + BUFF_MARGIN_X, y + h + BUFF_MARGIN_Y);
|
||||
|
||||
BLF_position(mono, x, y + y_ofs + (h - h_fixed), 0.0);
|
||||
BLF_draw_buffer(mono, stamp_data.note, sizeof(stamp_data.note));
|
||||
@@ -2169,7 +2175,7 @@ void BKE_image_stamp_buf(Scene *scene,
|
||||
|
||||
/* extra space for background. */
|
||||
IMB_rectfill_area(ibuf,
|
||||
scene->r.bg_stamp,
|
||||
bg_stamp,
|
||||
x - BUFF_MARGIN_X,
|
||||
y - BUFF_MARGIN_Y,
|
||||
w + BUFF_MARGIN_X,
|
||||
@@ -2187,12 +2193,8 @@ void BKE_image_stamp_buf(Scene *scene,
|
||||
if (TEXT_SIZE_CHECK(stamp_data.time, w, h)) {
|
||||
|
||||
/* extra space for background */
|
||||
IMB_rectfill_area(ibuf,
|
||||
scene->r.bg_stamp,
|
||||
x - BUFF_MARGIN_X,
|
||||
y,
|
||||
x + w + BUFF_MARGIN_X,
|
||||
y + h + BUFF_MARGIN_Y);
|
||||
IMB_rectfill_area(
|
||||
ibuf, bg_stamp, x - BUFF_MARGIN_X, y, x + w + BUFF_MARGIN_X, y + h + BUFF_MARGIN_Y);
|
||||
|
||||
/* and pad the text. */
|
||||
BLF_position(mono, x, y + y_ofs, 0.0);
|
||||
@@ -2206,7 +2208,7 @@ void BKE_image_stamp_buf(Scene *scene,
|
||||
|
||||
/* extra space for background. */
|
||||
IMB_rectfill_area(ibuf,
|
||||
scene->r.bg_stamp,
|
||||
bg_stamp,
|
||||
x - BUFF_MARGIN_X,
|
||||
y - BUFF_MARGIN_Y,
|
||||
x + w + BUFF_MARGIN_X,
|
||||
@@ -2224,7 +2226,7 @@ void BKE_image_stamp_buf(Scene *scene,
|
||||
|
||||
/* extra space for background. */
|
||||
IMB_rectfill_area(ibuf,
|
||||
scene->r.bg_stamp,
|
||||
bg_stamp,
|
||||
x - BUFF_MARGIN_X,
|
||||
y - BUFF_MARGIN_Y,
|
||||
x + w + BUFF_MARGIN_X,
|
||||
@@ -2242,7 +2244,7 @@ void BKE_image_stamp_buf(Scene *scene,
|
||||
|
||||
/* extra space for background. */
|
||||
IMB_rectfill_area(ibuf,
|
||||
scene->r.bg_stamp,
|
||||
bg_stamp,
|
||||
x - BUFF_MARGIN_X,
|
||||
y - BUFF_MARGIN_Y,
|
||||
x + w + BUFF_MARGIN_X,
|
||||
@@ -2258,7 +2260,7 @@ void BKE_image_stamp_buf(Scene *scene,
|
||||
|
||||
/* extra space for background. */
|
||||
IMB_rectfill_area(ibuf,
|
||||
scene->r.bg_stamp,
|
||||
bg_stamp,
|
||||
x - BUFF_MARGIN_X,
|
||||
y - BUFF_MARGIN_Y,
|
||||
x + w + BUFF_MARGIN_X,
|
||||
@@ -2274,7 +2276,7 @@ void BKE_image_stamp_buf(Scene *scene,
|
||||
|
||||
/* extra space for background. */
|
||||
IMB_rectfill_area(ibuf,
|
||||
scene->r.bg_stamp,
|
||||
bg_stamp,
|
||||
x - BUFF_MARGIN_X,
|
||||
y - BUFF_MARGIN_Y,
|
||||
x + w + BUFF_MARGIN_X,
|
||||
@@ -2293,7 +2295,7 @@ void BKE_image_stamp_buf(Scene *scene,
|
||||
|
||||
/* extra space for background. */
|
||||
IMB_rectfill_area(ibuf,
|
||||
scene->r.bg_stamp,
|
||||
bg_stamp,
|
||||
x - BUFF_MARGIN_X,
|
||||
y - BUFF_MARGIN_Y,
|
||||
x + w + BUFF_MARGIN_X,
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
#include <cstdlib>
|
||||
|
||||
#include "BLI_math_base.h"
|
||||
#include "BLI_math_color.h"
|
||||
#include "BLI_math_color_blend.h"
|
||||
#include "BLI_math_vector.h"
|
||||
#include "BLI_rect.h"
|
||||
|
||||
@@ -2641,7 +2641,7 @@ static void rna_def_fluid_domain_settings(BlenderRNA *brna)
|
||||
RNA_def_property_ui_text(prop, "Upper Bound", "Upper bound of the highlighting range");
|
||||
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, nullptr);
|
||||
|
||||
prop = RNA_def_property(srna, "gridlines_range_color", PROP_FLOAT, PROP_COLOR);
|
||||
prop = RNA_def_property(srna, "gridlines_range_color", PROP_FLOAT, PROP_COLOR_GAMMA);
|
||||
RNA_def_property_float_sdna(prop, nullptr, "gridlines_range_color");
|
||||
RNA_def_property_array(prop, 4);
|
||||
RNA_def_property_ui_text(prop, "Color", "Color used to highlight the range");
|
||||
|
||||
@@ -7370,14 +7370,14 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
|
||||
RNA_def_property_ui_text(prop, "Font Size", "Size of the font used when rendering stamp text");
|
||||
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, nullptr);
|
||||
|
||||
prop = RNA_def_property(srna, "stamp_foreground", PROP_FLOAT, PROP_COLOR);
|
||||
prop = RNA_def_property(srna, "stamp_foreground", PROP_FLOAT, PROP_COLOR_GAMMA);
|
||||
RNA_def_property_float_sdna(prop, nullptr, "fg_stamp");
|
||||
RNA_def_property_array(prop, 4);
|
||||
RNA_def_property_range(prop, 0.0, 1.0);
|
||||
RNA_def_property_ui_text(prop, "Text Color", "Color to use for stamp text");
|
||||
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, nullptr);
|
||||
|
||||
prop = RNA_def_property(srna, "stamp_background", PROP_FLOAT, PROP_COLOR);
|
||||
prop = RNA_def_property(srna, "stamp_background", PROP_FLOAT, PROP_COLOR_GAMMA);
|
||||
RNA_def_property_float_sdna(prop, nullptr, "bg_stamp");
|
||||
RNA_def_property_array(prop, 4);
|
||||
RNA_def_property_range(prop, 0.0, 1.0);
|
||||
|
||||
@@ -1140,7 +1140,7 @@ static void rna_def_gizmo(BlenderRNA *brna, PropertyRNA *cprop)
|
||||
RNA_def_property_ui_text(prop, "", "Gizmo group this gizmo is a member of");
|
||||
|
||||
/* Color & Alpha */
|
||||
prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
|
||||
prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR_GAMMA);
|
||||
RNA_def_property_array(prop, 3);
|
||||
RNA_def_property_float_funcs(prop, "rna_Gizmo_color_get", "rna_Gizmo_color_set", nullptr);
|
||||
|
||||
@@ -1151,7 +1151,7 @@ static void rna_def_gizmo(BlenderRNA *brna, PropertyRNA *cprop)
|
||||
RNA_def_property_update(prop, 0, "rna_Gizmo_update_redraw");
|
||||
|
||||
/* Color & Alpha (highlight) */
|
||||
prop = RNA_def_property(srna, "color_highlight", PROP_FLOAT, PROP_COLOR);
|
||||
prop = RNA_def_property(srna, "color_highlight", PROP_FLOAT, PROP_COLOR_GAMMA);
|
||||
RNA_def_property_array(prop, 3);
|
||||
RNA_def_property_float_funcs(prop, "rna_Gizmo_color_hi_get", "rna_Gizmo_color_hi_set", nullptr);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user