diff options
Diffstat (limited to 'source/blender/blenkernel/intern/seqmodifier.c')
-rw-r--r-- | source/blender/blenkernel/intern/seqmodifier.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/source/blender/blenkernel/intern/seqmodifier.c b/source/blender/blenkernel/intern/seqmodifier.c index 5b2e9f2bf23..3d8a2f7cddf 100644 --- a/source/blender/blenkernel/intern/seqmodifier.c +++ b/source/blender/blenkernel/intern/seqmodifier.c @@ -226,24 +226,28 @@ static void curves_apply_threaded(int width, int height, unsigned char *rect, fl } if (rect) { unsigned char *pixel = rect + pixel_index; - unsigned char result[3]; + float result[3], tempc[4]; - curvemapping_evaluate_premulRGB(curve_mapping, result, pixel); + straight_uchar_to_premul_float(tempc, pixel); + + curvemapping_evaluate_premulRGBF(curve_mapping, result, tempc); if (mask_rect) { float t[3]; rgb_uchar_to_float(t, mask_rect + pixel_index); - pixel[0] = pixel[0] * (1.0f - t[0]) + result[0] * t[0]; - pixel[1] = pixel[1] * (1.0f - t[1]) + result[1] * t[1]; - pixel[2] = pixel[2] * (1.0f - t[2]) + result[2] * t[2]; + tempc[0] = pixel[0] * (1.0f - t[0]) + result[0] * t[0]; + tempc[1] = pixel[1] * (1.0f - t[1]) + result[1] * t[1]; + tempc[2] = pixel[2] * (1.0f - t[2]) + result[2] * t[2]; } else { - pixel[0] = result[0]; - pixel[1] = result[1]; - pixel[2] = result[2]; + tempc[0] = result[0]; + tempc[1] = result[1]; + tempc[2] = result[2]; } + + premul_float_to_straight_uchar(pixel, tempc); } } } |