diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-05-07 18:31:28 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-05-07 18:51:40 +0300 |
commit | f74d85ffc8232a859b1419f5dc25b244ae04375f (patch) | |
tree | f74928d7681488c044ea65249eaaa5b6900d246b /source/blender/editors/sculpt_paint/paint_image_proj.c | |
parent | 905eeb0bc7f46efb95cb5450cc6c2ec27f02730c (diff) |
Cleanup: rename char/float conversion functions
- FTOCHAR -> unit_float_to_uchar_clamp
- F3TOCHAR3 -> unit_float_to_uchar_clamp_v3 (swap args)
- F4TOCHAR4 -> unit_float_to_uchar_clamp_v4 (swap args)
- FTOUSHORT -> unit_float_to_ushort_clamp
- USHORTTOUCHAR -> unit_ushort_to_uchar
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_image_proj.c')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_image_proj.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c index e5bddae971d..7784926128f 100644 --- a/source/blender/editors/sculpt_paint/paint_image_proj.c +++ b/source/blender/editors/sculpt_paint/paint_image_proj.c @@ -111,10 +111,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 */ @@ -4392,7 +4392,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); @@ -4596,9 +4596,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); } |