Description
See this Darktable bug for background info and references.
I'm trying to figure out how to add this to Darktable, for vignetting correction for RAW DNGs from the Google Camera app on my Pixel 4a, and I'm not sure if it should be done in rawspeed or in the darktable pipeline.
I have an implementation of the opcode in this branch that seems to work with the Pixel 4a dngs. I added the GainMap opcode to the existing function that implements the OpcodeList2 tag for lossy DNGs. So that I could test it in darktable, I temporarily modified DngDecoder to apply the OpcodeList2 processing to all DNGs, not only lossy DNGs, and also moved the cropping to after the opcodes are applied - DNG spec says opcodes "should be applied to the raw image, as read directly from the file".
I'm not sure how it would be possible to make this change without breaking any existing darktable edits. Without this change, a RAW DNG is output to darktable as the original pixels, black level, and white level. But with this change, it isn't really the actual RAW anymore, it's just a linear 16 bit integer image with black level 0 and white level 65535. This is fine for a newly imported image, but any existing image would already have the original black and white levels set in the rawprepare module which would no longer be valid. Maybe there could be an option that determines whether or not OpcodeList2 should be applied to a raw dng?