diff options
Diffstat (limited to 'source/blender/blenkernel/intern/colortools.c')
-rw-r--r-- | source/blender/blenkernel/intern/colortools.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/colortools.c b/source/blender/blenkernel/intern/colortools.c index 1bfefef4b71..7cf6b21e2f1 100644 --- a/source/blender/blenkernel/intern/colortools.c +++ b/source/blender/blenkernel/intern/colortools.c @@ -1012,6 +1012,9 @@ void scopes_update(Scopes *scopes, ImBuf *ibuf, int use_color_management) int savedlines, saveline; float rgb[3], ycc[3], luma; int ycc_mode=-1; + const short is_float = (ibuf->rect_float != NULL); + + if (ibuf->rect==NULL && ibuf->rect_float==NULL) return; if (scopes->ok == 1 ) return; @@ -1019,6 +1022,7 @@ void scopes_update(Scopes *scopes, ImBuf *ibuf, int use_color_management) /* hmmmm */ if (!(ELEM(ibuf->channels, 3, 4))) return; + scopes->hist.channels = 3; scopes->hist.x_resolution = 256; @@ -1073,9 +1077,9 @@ void scopes_update(Scopes *scopes, ImBuf *ibuf, int use_color_management) scopes->waveform_3= MEM_callocN(scopes->waveform_tot * 2 * sizeof(float), "waveform point channel 3"); scopes->vecscope= MEM_callocN(scopes->waveform_tot * 2 * sizeof(float), "vectorscope point channel"); - if (ibuf->rect_float) + if (is_float) rf = ibuf->rect_float; - else if (ibuf->rect) + else rc = (unsigned char *)ibuf->rect; for (y = 0; y < ibuf->y; y++) { @@ -1084,13 +1088,13 @@ void scopes_update(Scopes *scopes, ImBuf *ibuf, int use_color_management) } else saveline=0; for (x = 0; x < ibuf->x; x++) { - if (ibuf->rect_float) { + if (is_float) { if (use_color_management) linearrgb_to_srgb_v3_v3(rgb, rf); else copy_v3_v3(rgb, rf); } - else if (ibuf->rect) { + else { for (c=0; c<3; c++) rgb[c] = rc[c] * INV_255; } |