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:
authorTon Roosendaal <ton@blender.org>2013-04-02 16:41:11 +0400
committerTon Roosendaal <ton@blender.org>2013-04-02 16:41:11 +0400
commit58530a5affce93388937064e6dadd1eadc2b1b0c (patch)
tree5e5ed13f899b1194f79956b24d8cb37c431c1cf7 /source/blender/blenkernel/intern/colortools.c
parenta78aa15cd653c18bc0b3b486cf4c7dab39f85fd3 (diff)
Usability fix, for color grading.
The Scopes and Histogram (Image editor, Sequencer) were not updating on changes in color or display settings. - Missing notifiers for refreshing - Missing code to draw correct for managed byte buffers.
Diffstat (limited to 'source/blender/blenkernel/intern/colortools.c')
-rw-r--r--source/blender/blenkernel/intern/colortools.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/source/blender/blenkernel/intern/colortools.c b/source/blender/blenkernel/intern/colortools.c
index 5176f93f4f3..6dc496f060c 100644
--- a/source/blender/blenkernel/intern/colortools.c
+++ b/source/blender/blenkernel/intern/colortools.c
@@ -1008,6 +1008,7 @@ void BKE_histogram_update_sample_line(Histogram *hist, ImBuf *ibuf, const ColorM
IMB_colormanagement_processor_free(cm_processor);
}
+/* if view_settings, it also applies this to byte buffers */
void scopes_update(Scopes *scopes, ImBuf *ibuf, const ColorManagedViewSettings *view_settings,
const ColorManagedDisplaySettings *display_settings)
{
@@ -1021,7 +1022,7 @@ void scopes_update(Scopes *scopes, ImBuf *ibuf, const ColorManagedViewSettings *
float rgba[4], ycc[3], luma;
int ycc_mode = -1;
const short is_float = (ibuf->rect_float != NULL);
-
+ void *cache_handle = NULL;
struct ColormanageProcessor *cm_processor = NULL;
if (ibuf->rect == NULL && ibuf->rect_float == NULL) return;
@@ -1090,12 +1091,17 @@ void scopes_update(Scopes *scopes, ImBuf *ibuf, const ColorManagedViewSettings *
if (is_float)
rf = ibuf->rect_float;
- else
- rc = (unsigned char *)ibuf->rect;
-
+ else {
+ if (view_settings)
+ rc = (unsigned char *)IMB_display_buffer_acquire(ibuf, view_settings, display_settings, &cache_handle);
+ else
+ rc = (unsigned char *)ibuf->rect;
+ }
+
if (ibuf->rect_float)
cm_processor = IMB_colormanagement_display_processor_new(view_settings, display_settings);
+ printf("update %p\n", cm_processor);
for (y = 0; y < ibuf->y; y++) {
if (savedlines < scopes->sample_lines && y >= ((savedlines) * ibuf->y) / (scopes->sample_lines + 1)) {
saveline = 1;
@@ -1193,7 +1199,9 @@ void scopes_update(Scopes *scopes, ImBuf *ibuf, const ColorManagedViewSettings *
if (cm_processor)
IMB_colormanagement_processor_free(cm_processor);
-
+ if (cache_handle)
+ IMB_display_buffer_release(cache_handle);
+
scopes->ok = 1;
}