diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2013-03-11 22:11:07 +0400 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2013-03-11 22:11:07 +0400 |
commit | 0a3382c8e032db528b1432c85d4aa516108b9f54 (patch) | |
tree | c6701e6684c8f3e14a666f178025a7e091abede8 | |
parent | e6dcf9504e1a9c1dcd574044e7a717d0def8aadc (diff) |
Fix #34589. There was no space conversion being done between layers in
different colour space when using the clone brush.
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_image_proj.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c index 6e3beecb04b..8edb118ab73 100644 --- a/source/blender/editors/sculpt_paint/paint_image_proj.c +++ b/source/blender/editors/sculpt_paint/paint_image_proj.c @@ -1379,15 +1379,18 @@ static ProjPixel *project_paint_uvpixel_init( } else { /* from char to float */ unsigned char rgba_ub[4]; + float rgba[4]; project_face_pixel(tf_other, ibuf_other, w, side, rgba_ub, NULL); - IMAPAINT_CHAR_RGBA_TO_FLOAT(((ProjPixelClone *)projPixel)->clonepx.f, rgba_ub); + srgb_to_linearrgb_uchar4(rgba, rgba_ub); + straight_to_premul_v4_v4(((ProjPixelClone *)projPixel)->clonepx.f, rgba); } } else { if (ibuf_other->rect_float) { /* float to char */ float rgba[4]; project_face_pixel(tf_other, ibuf_other, w, side, NULL, rgba); - IMAPAINT_FLOAT_RGBA_TO_CHAR(((ProjPixelClone *)projPixel)->clonepx.ch, rgba); + premul_to_straight_v4(rgba); + linearrgb_to_srgb_uchar3(((ProjPixelClone *)projPixel)->clonepx.ch, rgba); } else { /* char to char */ project_face_pixel(tf_other, ibuf_other, w, side, ((ProjPixelClone *)projPixel)->clonepx.ch, NULL); |