Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2018-05-07 18:31:28 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-05-07 18:51:40 +0300
commitf74d85ffc8232a859b1419f5dc25b244ae04375f (patch)
treef74928d7681488c044ea65249eaaa5b6900d246b /source/blender/imbuf/intern/scaling.c
parent905eeb0bc7f46efb95cb5450cc6c2ec27f02730c (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.c16
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]);
}
}