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:
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]);
}
}