Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
fit_agx_ladder Namespace Reference

Functions

 run (flags)
 
 parse_params (out)
 
 patch_shipped (text, name, fit, ins, iro, outs, oro)
 
 patch_c (text, vnum, ins, iro, outs, oro)
 
 main ()
 

Variables

float AB_STAB = 70.0
 
float AB_LEVEL = 10.0
 
float BLEACH_NUGDE = 0.5
 
 ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
 
 PY = os.path.join(ROOT, "tools", "derive_filmic_agx_primaries.py")
 
 C = os.path.join(ROOT, "src", "iop", "filmicrgb.c")
 
list DERIVE = [sys.executable, "-u", PY]
 
list STEPS
 

Detailed Description

Offline orchestrator for the filmic-AgX bleach ladder — run this PLUGGED IN.

It fits the four non-anchor variants in dependency order via successive BISECTION of the
no-bleach / extra-bleach space, so every step is confined between its neighbours (monotone,
even per-hue apparent-brightness AND hue-drift steps), and auto-patches BOTH sources:
  - SHIPPED_VARIANTS in tools/derive_filmic_agx_primaries.py   (single source of truth)
  - the DT_FILMIC_COLORSCIENCE_V6..V10 case blocks in src/iop/filmicrgb.c

no-bleach is NOT re-fit here (it is the settled bottom anchor, --min-bleach --ab-pull 200).

Order:
  1. extra-bleach  = --fit-extra-bleach --ab-stabilize AB_STAB   (stabilise reds/magentas so
                     bleaching does not over-brighten them ; apparent brightness stays ~put)
  2. medium-bleach = bisect(no-bleach, extra-bleach)
  3. low-bleach    = bisect(no-bleach, medium-bleach)
  4. high-bleach   = bisect(medium-bleach, extra-bleach)

Then it writes tools/agx_diagnose.log + tools/agx_report.md and prints the rebuild command.

Tunables (edit + re-run if --diagnose shows a step off the ramp): AB_STAB below, and W_AB /
W_HD inside the --fit-bisect branch of derive_filmic_agx_primaries.py.

Usage:  python3.12 tools/fit_agx_ladder.py
Then:   cmake --build build --target filmicrgb   # verify constants + build

Function Documentation

◆ main()

fit_agx_ladder.main ( )

Definition at line 108 of file fit_agx_ladder.py.

References main(), parse_params(), patch_c(), patch_shipped(), and run().

Referenced by main().

◆ parse_params()

fit_agx_ladder.parse_params (   out)
Pull inset/irot/outset/orot float lists from the 'paste this into SHIPPED_VARIANTS' block.

Definition at line 59 of file fit_agx_ladder.py.

Referenced by main().

◆ patch_c()

fit_agx_ladder.patch_c (   text,
  vnum,
  ins,
  iro,
  outs,
  oro 
)

Definition at line 89 of file fit_agx_ladder.py.

Referenced by main().

◆ patch_shipped()

fit_agx_ladder.patch_shipped (   text,
  name,
  fit,
  ins,
  iro,
  outs,
  oro 
)

Definition at line 70 of file fit_agx_ladder.py.

Referenced by main().

◆ run()

fit_agx_ladder.run (   flags)

Definition at line 52 of file fit_agx_ladder.py.

Referenced by main().

Variable Documentation

◆ AB_LEVEL

float fit_agx_ladder.AB_LEVEL = 10.0

Definition at line 30 of file fit_agx_ladder.py.

◆ AB_STAB

float fit_agx_ladder.AB_STAB = 70.0

Definition at line 29 of file fit_agx_ladder.py.

◆ BLEACH_NUGDE

float fit_agx_ladder.BLEACH_NUGDE = 0.5

Definition at line 33 of file fit_agx_ladder.py.

◆ C

fit_agx_ladder.C = os.path.join(ROOT, "src", "iop", "filmicrgb.c")

Definition at line 36 of file fit_agx_ladder.py.

◆ DERIVE

list fit_agx_ladder.DERIVE = [sys.executable, "-u", PY]

Definition at line 37 of file fit_agx_ladder.py.

◆ PY

fit_agx_ladder.PY = os.path.join(ROOT, "tools", "derive_filmic_agx_primaries.py")

Definition at line 35 of file fit_agx_ladder.py.

◆ ROOT

fit_agx_ladder.ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

Definition at line 34 of file fit_agx_ladder.py.

◆ STEPS

list fit_agx_ladder.STEPS
Initial value:
1= [
2 ("extra-bleach", "V10", ["--fit-extra-bleach", "--ab-stabilize", str(AB_STAB), "--ab-level", str(AB_LEVEL), "--bleach-nudge", str(BLEACH_NUGDE)],
3 "--fit-extra-bleach --ab-stabilize %g --ab-level %g --bleach-nudge %g" % (AB_STAB, AB_LEVEL, BLEACH_NUGDE)),
4 ("medium-bleach", "V8", ["--fit-bisect", "no-bleach", "extra-bleach"],
5 "--fit-bisect no-bleach extra-bleach"),
6 ("low-bleach", "V7", ["--fit-bisect", "no-bleach", "medium-bleach"],
7 "--fit-bisect no-bleach medium-bleach"),
8 ("high-bleach", "V9", ["--fit-bisect", "medium-bleach", "extra-bleach"],
9 "--fit-bisect medium-bleach extra-bleach"),
10]

Definition at line 40 of file fit_agx_ladder.py.