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:
authorSergey Sharybin <sergey.vfx@gmail.com>2013-12-18 12:05:06 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2013-12-18 12:05:06 +0400
commit69a1234c6d0e6522546b9ff1892b5e4e6e879124 (patch)
tree1c20fca9cf5ffc4f1ccfd439c0d19e0bdfb11082 /source/blender/imbuf
parentf5616bf8b2d87b0a2fcc17491f327a8eb74cb390 (diff)
Fix artifact in partial buffer update after recent changes
The issue wasn't new in fact, just partial buffer update function was still broken. Not sure how those issues were not noticed for so long. Perhaps partial_buffer_update_rect() could be simplified, but i've got some more upcoming changes here which might run into conflicts if i'll do simplification now.
Diffstat (limited to 'source/blender/imbuf')
-rw-r--r--source/blender/imbuf/intern/colormanagement.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/source/blender/imbuf/intern/colormanagement.c b/source/blender/imbuf/intern/colormanagement.c
index e57a876bcde..6047b1696bb 100644
--- a/source/blender/imbuf/intern/colormanagement.c
+++ b/source/blender/imbuf/intern/colormanagement.c
@@ -2665,7 +2665,7 @@ static void partial_buffer_update_rect(ImBuf *ibuf, unsigned char *display_buffe
if (cm_processor) {
for (y = ymin; y < ymax; y++) {
for (x = xmin; x < xmax; x++) {
- int display_index = (y * display_stride + x) * channels;
+ int display_index = (y * display_stride + x) * 4;
int linear_index = ((y - linear_offset_y) * linear_stride + (x - linear_offset_x)) * channels;
float pixel[4];
@@ -2675,6 +2675,7 @@ static void partial_buffer_update_rect(ImBuf *ibuf, unsigned char *display_buffe
}
else if (channels == 3) {
copy_v3_v3(pixel, (float *) linear_buffer + linear_index);
+ pixel[3] = 1.0f;
}
else if (channels == 1) {
pixel[0] = linear_buffer[linear_index];
@@ -2690,7 +2691,17 @@ static void partial_buffer_update_rect(ImBuf *ibuf, unsigned char *display_buffe
}
if (!is_data) {
- IMB_colormanagement_processor_apply_v4_predivide(cm_processor, pixel);
+ if (channels == 4) {
+ IMB_colormanagement_processor_apply_v4_predivide(cm_processor, pixel);
+ }
+ else if (channels == 3) {
+ IMB_colormanagement_processor_apply_v3(cm_processor, pixel);
+ }
+ else /* if (channels == 1) */ {
+ if (cm_processor->curve_mapping) {
+ curve_mapping_apply_pixel(cm_processor->curve_mapping, pixel, 1);
+ }
+ }
}
if (display_buffer_float) {
@@ -2714,7 +2725,7 @@ static void partial_buffer_update_rect(ImBuf *ibuf, unsigned char *display_buffe
}
else if (channels == 3) {
rgb_float_to_uchar(display_buffer + display_index, pixel);
- display_buffer[display_index + 1] = 255;
+ display_buffer[display_index + 3] = 255;
}
else /* if (channels == 1) */ {
display_buffer[display_index] =