diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-06-21 18:37:56 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-06-21 18:37:56 +0400 |
commit | 5def0b6c55d13b07bd59863174379110395e1fed (patch) | |
tree | 200766f14226d049ed858ac51108467bf28b9923 /source/blender/editors/space_node | |
parent | c896a9921371a01b95046dd3522a7758a4e9a878 (diff) |
display a sample line in the hue correct, handy to sample the image to know what to change
Diffstat (limited to 'source/blender/editors/space_node')
-rw-r--r-- | source/blender/editors/space_node/drawnode.c | 11 | ||||
-rw-r--r-- | source/blender/editors/space_node/node_edit.c | 14 |
2 files changed, 20 insertions, 5 deletions
diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index 78de45dd219..22017a2d8b9 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -2134,6 +2134,17 @@ static void node_composit_buts_colorbalance_but(uiLayout *layout, bContext *UNUS static void node_composit_buts_huecorrect(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) { + bNode *node = ptr->data; + CurveMapping *cumap = node->storage; + + if (_sample_col[0] != SAMPLE_FLT_ISNONE) { + cumap->flag |= CUMA_DRAW_SAMPLE; + copy_v3_v3(cumap->sample, _sample_col); + } + else { + cumap->flag &= ~CUMA_DRAW_SAMPLE; + } + uiTemplateCurveMapping(layout, ptr, "mapping", 'h', 0, 0); } diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c index fc7bf473f8f..48f772e8008 100644 --- a/source/blender/editors/space_node/node_edit.c +++ b/source/blender/editors/space_node/node_edit.c @@ -1676,10 +1676,12 @@ static void sample_draw(const bContext *C, ARegion *ar, void *arg_info) Scene *scene = CTX_data_scene(C); ImageSampleInfo *info = arg_info; - ED_image_draw_info(ar, (scene->r.color_mgt_flag & R_COLOR_MANAGEMENT), info->channels, - info->x, info->y, info->col, info->colf, - NULL, NULL /* zbuf - unused for nodes */ - ); + if (info->draw) { + ED_image_draw_info(ar, (scene->r.color_mgt_flag & R_COLOR_MANAGEMENT), info->channels, + info->x, info->y, info->col, info->colf, + NULL, NULL /* zbuf - unused for nodes */ + ); + } } static void sample_apply(bContext *C, wmOperator *op, wmEvent *event) @@ -1694,8 +1696,10 @@ static void sample_apply(bContext *C, wmOperator *op, wmEvent *event) ima = BKE_image_verify_viewer(IMA_TYPE_COMPOSITE, "Viewer Node"); ibuf = BKE_image_acquire_ibuf(ima, NULL, &lock); - if (!ibuf) + if (!ibuf) { + info->draw = 0; return; + } if (!ibuf->rect) { if (info->color_manage) |