diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-11-30 17:42:52 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-11-30 17:42:52 +0400 |
commit | a02e51febabfd6469a6316c5e51d2aea56ee75da (patch) | |
tree | 2b1b70a4c4fe16a53ad7141f9d5996690110fdec | |
parent | 7fa7ce297edee80258938c5c82837dcd8ab8377a (diff) |
Fix #33357: Strip modificator Bright/Contrast doesn't work correct for byte images
-rw-r--r-- | source/blender/blenkernel/intern/seqmodifier.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/seqmodifier.c b/source/blender/blenkernel/intern/seqmodifier.c index 609724e802f..5b2e9f2bf23 100644 --- a/source/blender/blenkernel/intern/seqmodifier.c +++ b/source/blender/blenkernel/intern/seqmodifier.c @@ -427,17 +427,17 @@ static void brightcontrast_apply_threaded(int width, int height, unsigned char * unsigned char *pixel = rect + pixel_index; for (c = 0; c < 3; c++) { - i = pixel[c]; + i = (float) pixel[c] / 255.0f; v = a * i + b; if (mask_rect) { unsigned char *m = mask_rect + pixel_index; float t = (float) m[c] / 255.0f; - pixel[c] = pixel[c] * (1.0f - t) + v * t; + v = (float) pixel[c] * (1.0f - t) + v * t; } - else - pixel[c] = v; + + pixel[c] = FTOCHAR(v); } } else if (rect_float) { |