The dngpreprocess tool is here: GitHub - paolodepetrillo/raw2dng at dngpreprocess
I never got around to writing a readme for it… it’s built inside of a fork of the raw2dng tool because that project was already set up to build the Adobe DNG SDK on Linux.
To build:
git clone https://github.com/paolodepetrillo/raw2dng.git
cd raw2dng
git checkout dngpreprocess
mkdir build
cd build
cmake ..
make
If everything works this will create the executable at build/dngpreprocess/dngpreprocess. To run:
dngpreprocess IMG_9999.dng
This will output a file named IMG_9999_pp.dng with the GainMap applied.