Skip to content

Commit

Permalink
grade: use colour wheels
Browse files Browse the repository at this point in the history
  • Loading branch information
hanatos committed Aug 1, 2023
1 parent 88830f3 commit 04ef97d
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 3 deletions.
24 changes: 24 additions & 0 deletions src/gui/render_darkroom.hh
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,30 @@ void render_darkroom_widget(int modid, int parid)
}
break;
}
case dt_token("coledit"):
{ // only works for param->type == float and count == 3
if((num % 3) == 0)
{
float *val = (float*)(vkdt.graph_dev.module[modid].param + param->offset) + num;
float oldval = *val;
char str[10] = {0};
memcpy(str, &param->name, 8);
if(ImGui::ColorEdit3(str, val, ImGuiColorEditFlags_DisplayRGB | ImGuiColorEditFlags_PickerHueWheel |
ImGuiColorEditFlags_HDR | ImGuiColorEditFlags_InputRGB | ImGuiColorEditFlags_Float))
RESETBLOCK {
dt_graph_run_t flags = s_graph_run_none;
if(vkdt.graph_dev.module[modid].so->check_params)
flags = vkdt.graph_dev.module[modid].so->check_params(vkdt.graph_dev.module+modid, parid, &oldval);
vkdt.graph_dev.runflags = static_cast<dt_graph_run_t>(
flags | s_graph_run_record_cmd_buf | s_graph_run_wait_done);
vkdt.graph_dev.active_module = modid;
dt_graph_history_append(&vkdt.graph_dev, modid, parid, throttle);
}
KEYFRAME
TOOLTIP
}
break;
}
case dt_token("vslider"):
{
if(param->type == dt_token("float"))
Expand Down
1 change: 1 addition & 0 deletions src/pipe/global.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ dt_module_so_load(
else if(type == dt_token("print")) {}
else if(type == dt_token("rbmap")) {}
else if(type == dt_token("callback")){}
else if(type == dt_token("coledit")) {}
else dt_log(s_log_err, "unknown widget type %"PRItkn" in %s!", dt_token_str(type), filename);
int pid = dt_module_get_param(mod, parm);
if(pid == -1)
Expand Down
6 changes: 3 additions & 3 deletions src/pipe/modules/grade/params.ui
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
lift:vslider:-.1:.1
gamma:vslider:0:3
gain:vslider:0:3
lift:coledit
gamma:coledit
gain:coledit

0 comments on commit 04ef97d

Please sign in to comment.