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/imbuf/intern/scaling.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/imbuf/intern/scaling.c')
-rw-r--r-- | source/blender/imbuf/intern/scaling.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/imbuf/intern/scaling.c b/source/blender/imbuf/intern/scaling.c index 1c0b47f7942..4b528160fb7 100644 --- a/source/blender/imbuf/intern/scaling.c +++ b/source/blender/imbuf/intern/scaling.c @@ -324,18 +324,18 @@ MINLINE void straight_uchar_to_premul_ushort(unsigned short result[4], const uns MINLINE void premul_ushort_to_straight_uchar(unsigned char *result, const unsigned short color[4]) { if (color[3] <= 255) { - result[0] = USHORTTOUCHAR(color[0]); - result[1] = USHORTTOUCHAR(color[1]); - result[2] = USHORTTOUCHAR(color[2]); - result[3] = USHORTTOUCHAR(color[3]); + result[0] = unit_ushort_to_uchar(color[0]); + result[1] = unit_ushort_to_uchar(color[1]); + result[2] = unit_ushort_to_uchar(color[2]); + result[3] = unit_ushort_to_uchar(color[3]); } else { unsigned short alpha = color[3] / 256; - result[0] = USHORTTOUCHAR((ushort)(color[0] / alpha * 256)); - result[1] = USHORTTOUCHAR((ushort)(color[1] / alpha * 256)); - result[2] = USHORTTOUCHAR((ushort)(color[2] / alpha * 256)); - result[3] = USHORTTOUCHAR(color[3]); + result[0] = unit_ushort_to_uchar((ushort)(color[0] / alpha * 256)); + result[1] = unit_ushort_to_uchar((ushort)(color[1] / alpha * 256)); + result[2] = unit_ushort_to_uchar((ushort)(color[2] / alpha * 256)); + result[3] = unit_ushort_to_uchar(color[3]); } } |