diff options
Diffstat (limited to 'source/blender/editors')
5 files changed, 12 insertions, 12 deletions
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index b92216138fd..5431f210441 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -3847,7 +3847,7 @@ void uiTemplateReportsBanner(uiLayout *layout, bContext *C) but = uiDefBut(block, UI_BTYPE_ROUNDBOX, 0, "", UI_UNIT_X + 10, 0, UI_UNIT_X + width, UI_UNIT_Y, NULL, 0.0f, 0.0f, 0, 0, ""); - but->col[0] = but->col[1] = but->col[2] = FTOCHAR(rti->grayscale); + but->col[0] = but->col[1] = but->col[2] = unit_float_to_uchar_clamp(rti->grayscale); but->col[3] = 255; UI_block_align_end(block); diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index f1f193f1b02..8c868b81239 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -635,7 +635,7 @@ static void shadecolors4(char coltop[4], char coldown[4], const char *color, sho static void round_box_shade_col4_r(unsigned char r_col[4], const char col1[4], const char col2[4], const float fac) { - const int faci = FTOCHAR(fac); + const int faci = unit_float_to_uchar_clamp(fac); const int facm = 255 - faci; r_col[0] = (faci * col1[0] + facm * col2[0]) / 256; diff --git a/source/blender/editors/sculpt_paint/paint_image_2d.c b/source/blender/editors/sculpt_paint/paint_image_2d.c index c1dd31ea055..37096f9e660 100644 --- a/source/blender/editors/sculpt_paint/paint_image_2d.c +++ b/source/blender/editors/sculpt_paint/paint_image_2d.c @@ -432,7 +432,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 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); } diff --git a/source/blender/editors/space_sequencer/sequencer_scopes.c b/source/blender/editors/space_sequencer/sequencer_scopes.c index c5d6edadb53..8c57089f7ab 100644 --- a/source/blender/editors/space_sequencer/sequencer_scopes.c +++ b/source/blender/editors/space_sequencer/sequencer_scopes.c @@ -402,10 +402,10 @@ static void draw_zebra_float(ImBuf *src, ImBuf *ibuf, float perc) } } - *o++ = FTOCHAR(r); - *o++ = FTOCHAR(g); - *o++ = FTOCHAR(b); - *o++ = FTOCHAR(a); + *o++ = unit_float_to_uchar_clamp(r); + *o++ = unit_float_to_uchar_clamp(g); + *o++ = unit_float_to_uchar_clamp(b); + *o++ = unit_float_to_uchar_clamp(a); } } } |