Skip to content

Commit e4244d8

Browse files
A port of Blender's AgX to darktable (darktable-org#19026)
* A port of Blender's AgX to darktable --------- Co-authored-by: Anna <[email protected]>
1 parent bcda97d commit e4244d8

File tree

7 files changed

+2526
-2
lines changed

7 files changed

+2526
-2
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,5 @@ output*png
2525
Brewfile.lock.json
2626
CMakeLists.txt.user
2727
workspace/
28+
cmake-build-debug/
29+
.idea/

data/darktableconfig.xml.in

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3562,6 +3562,7 @@
35623562
<enum>
35633563
<option>scene-referred (sigmoid)</option>
35643564
<option>scene-referred (filmic)</option>
3565+
<option>scene-referred (agx)</option>
35653566
<option>display-referred (legacy)</option>
35663567
<option>none</option>
35673568
</enum>
@@ -3900,6 +3901,41 @@
39003901
<shortdescription>active tab in tone equaliser module</shortdescription>
39013902
<longdescription>which of simple, advanced or masking tabs will show at startup</longdescription>
39023903
</dtconfig>
3904+
<dtconfig>
3905+
<name>plugins/darkroom/agx/enable_curve_tab</name>
3906+
<type>bool</type>
3907+
<default>false</default>
3908+
<shortdescription>whether to enable the curve tab</shortdescription>
3909+
<longdescription>if enabled, the settings tab will have fewer controls and will occupy less vertical space</longdescription>
3910+
</dtconfig>
3911+
<dtconfig>
3912+
<name>plugins/darkroom/agx/look_always_visible</name>
3913+
<type>bool</type>
3914+
<default>false</default>
3915+
<shortdescription>whether to keep look controls always visible</shortdescription>
3916+
<longdescription>if enabled, the look controls won't be placed in a collapsible section</longdescription>
3917+
</dtconfig>
3918+
<dtconfig>
3919+
<name>plugins/darkroom/agx/expand_curve_graph</name>
3920+
<type>bool</type>
3921+
<default>false</default>
3922+
<shortdescription>whether to expand the curve graph</shortdescription>
3923+
<longdescription>this is just to store whether to show the curve graph or not</longdescription>
3924+
</dtconfig>
3925+
<dtconfig>
3926+
<name>plugins/darkroom/agx/curve_graph_height</name>
3927+
<type min="100" max="300">int</type>
3928+
<default>200</default>
3929+
<shortdescription>height of agx graph in per cent</shortdescription>
3930+
<longdescription>height of agx graph in per cent</longdescription>
3931+
</dtconfig>
3932+
<dtconfig>
3933+
<name>plugins/darkroom/agx/expand_curve_advanced</name>
3934+
<type>bool</type>
3935+
<default>false</default>
3936+
<shortdescription>whether to show advanced curve parameters</shortdescription>
3937+
<longdescription>this is just to store whether to show advanced curve parameters or not</longdescription>
3938+
</dtconfig>
39033939
<dtconfig>
39043940
<name>plugins/lighttable/collect/windowheight</name>
39053941
<type>int</type>

src/common/iop_order.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ const dt_iop_order_entry_t legacy_order[] = {
140140
{ {44.0f }, "lowlight", 0},
141141
{ {45.0f }, "monochrome", 0},
142142
{ {45.3f }, "sigmoid", 0},
143+
{ {45.5f }, "agx", 0},
143144
{ {46.0f }, "filmic", 0},
144145
{ {46.5f }, "filmicrgb", 0},
145146
{ {47.0f }, "colisa", 0},
@@ -253,6 +254,7 @@ const dt_iop_order_entry_t v30_order[] = {
253254
// on camera JPEG default look
254255
{ {45.0f }, "filmic", 0}, // same, but different (parametric) approach
255256
{ {45.3f }, "sigmoid", 0},
257+
{ {45.5f }, "agx", 0},
256258
{ {46.0f }, "filmicrgb", 0}, // same, upgraded
257259
{ {36.0f }, "lut3d", 0}, // apply a creative style or film emulation, possibly non-linear
258260
{ {47.0f }, "colisa", 0}, // edit contrast while damaging colour
@@ -370,6 +372,7 @@ const dt_iop_order_entry_t v50_order[] = {
370372
// on camera JPEG default look
371373
{ {45.0f }, "filmic", 0}, // same, but different (parametric) approach
372374
{ {45.3f }, "sigmoid", 0},
375+
{ {45.5f }, "agx", 0},
373376
{ {46.0f }, "filmicrgb", 0}, // same, upgraded
374377
{ {36.0f }, "lut3d", 0}, // apply a creative style or film emulation, possibly non-linear
375378
{ {47.0f }, "colisa", 0}, // edit contrast while damaging colour
@@ -487,6 +490,7 @@ const dt_iop_order_entry_t v30_jpg_order[] = {
487490
{ { 44.0f }, "basecurve", 0 }, // conversion from scene-referred to display referred, reverse-engineered
488491
// on camera JPEG default look
489492
{ { 45.0f }, "filmic", 0 }, // same, but different (parametric) approach
493+
{ {45.5f }, "agx", 0},
490494
{ { 45.3f }, "sigmoid", 0},
491495
{ { 46.0f }, "filmicrgb", 0 }, // same, upgraded
492496
{ { 36.0f }, "lut3d", 0 }, // apply a creative style or film emulation, possibly non-linear
@@ -608,6 +612,7 @@ const dt_iop_order_entry_t v50_jpg_order[] = {
608612
// on camera JPEG default look
609613
{ { 45.0f }, "filmic", 0 }, // same, but different (parametric) approach
610614
{ { 45.3f }, "sigmoid", 0},
615+
{ {45.5f }, "agx", 0},
611616
{ { 46.0f }, "filmicrgb", 0 }, // same, upgraded
612617
{ { 36.0f }, "lut3d", 0 }, // apply a creative style or film emulation, possibly non-linear
613618
{ { 47.0f }, "colisa", 0 }, // edit contrast while damaging colour
@@ -1177,6 +1182,7 @@ GList *dt_ioppr_get_iop_order_list(const dt_imgid_t imgid,
11771182
_insert_before(iop_order_list, "colorbalance", "diffuse");
11781183
_insert_before(iop_order_list, "nlmeans", "blurs");
11791184
_insert_before(iop_order_list, "filmicrgb", "sigmoid");
1185+
_insert_before(iop_order_list, "filmicrgb", "agx");
11801186
_insert_before(iop_order_list, "colorbalancergb", "colorequal");
11811187
_insert_before(iop_order_list, "highlights", "rasterfile");
11821188
}

src/common/utility.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1162,7 +1162,8 @@ gboolean dt_str_commasubstring(const char *list,
11621162
gboolean dt_is_scene_referred(void)
11631163
{
11641164
return dt_conf_is_equal("plugins/darkroom/workflow", "scene-referred (filmic)")
1165-
|| dt_conf_is_equal("plugins/darkroom/workflow", "scene-referred (sigmoid)");
1165+
|| dt_conf_is_equal("plugins/darkroom/workflow", "scene-referred (sigmoid)")
1166+
|| dt_conf_is_equal("plugins/darkroom/workflow", "scene-referred (agx)");
11661167
}
11671168

11681169
gboolean dt_is_display_referred(void)

src/iop/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ add_iop(cacorrectrgb "cacorrectrgb.c")
152152
add_iop(diffuse "diffuse.c")
153153
add_iop(blurs "blurs.c")
154154
add_iop(sigmoid "sigmoid.c")
155+
add_iop(agx "agx.c")
155156
add_iop(primaries "primaries.c")
156157
add_iop(colorequal "colorequal.c")
157158
add_iop(rasterfile "rasterfile.c")

0 commit comments

Comments
 (0)