diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-05-07 19:02:48 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-05-07 19:02:48 +0300 |
commit | b49184b608df297195c5f0e81da4d8d9ddfb9213 (patch) | |
tree | c2624887be563319a7138516d2fcc6100acdb2c6 /source/blender/editors/sculpt_paint | |
parent | f62b826533422e5de3b08601e5511c233deda529 (diff) | |
parent | f74d85ffc8232a859b1419f5dc25b244ae04375f (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/editors/sculpt_paint')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_image_2d.c | 2 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_image_proj.c | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_image_2d.c b/source/blender/editors/sculpt_paint/paint_image_2d.c index 83a5a0d0b1b..c2ce9d83782 100644 --- a/source/blender/editors/sculpt_paint/paint_image_2d.c +++ b/source/blender/editors/sculpt_paint/paint_image_2d.c @@ -433,7 +433,7 @@ static ImBuf *brush_painter_imbuf_new(BrushPainter *painter, int size, float pre unsigned char *dst = (unsigned char *)ibuf->rect + (y * size + x) * 4; rgb_float_to_uchar(dst, rgba); - dst[3] = FTOCHAR(rgba[3]); + dst[3] = unit_float_to_uchar_clamp(rgba[3]); } } } diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c index cacb75b2668..8c148dcb313 100644 --- a/source/blender/editors/sculpt_paint/paint_image_proj.c +++ b/source/blender/editors/sculpt_paint/paint_image_proj.c @@ -112,10 +112,10 @@ static void partial_redraw_array_init(ImagePaintPartialRedraw *pr); /* Defines and Structs */ -/* FTOCHAR as inline function */ +/* unit_float_to_uchar_clamp as inline function */ BLI_INLINE unsigned char f_to_char(const float val) { - return FTOCHAR(val); + return unit_float_to_uchar_clamp(val); } /* ProjectionPaint defines */ @@ -4378,7 +4378,7 @@ static void do_projectpaint_draw( float_to_byte_dither_v3(rgba_ub, rgb, dither, u, v); } else { - F3TOCHAR3(rgb, rgba_ub); + unit_float_to_uchar_clamp_v3(rgba_ub, rgb); } rgba_ub[3] = f_to_char(mask); @@ -4582,9 +4582,9 @@ static void *do_projectpaint_thread(void *ph_v) float_to_byte_dither_v3(projPixel->newColor.ch, color_f, ps->dither, projPixel->x_px, projPixel->y_px); } else { - F3TOCHAR3(color_f, projPixel->newColor.ch); + unit_float_to_uchar_clamp_v3(projPixel->newColor.ch, color_f); } - projPixel->newColor.ch[3] = FTOCHAR(color_f[3]); + projPixel->newColor.ch[3] = unit_float_to_uchar_clamp(color_f[3]); IMB_blend_color_byte(projPixel->pixel.ch_pt, projPixel->origColor.ch_pt, projPixel->newColor.ch, ps->blend); } |