The image is linearized via OpcodeList2 tag value; For similar images use of OpcodeList3 is also possible (probably depends on Adobe software version used).
By default, only OpcodeList1 tag is processed by LibRaw
To enable OpcodeList2/3 processing LIBRAW_RAWOPTIONS_DNG_STAGE2_IFPRESENT/LIBRAW_RAWOPTIONS_DNG_STAGE3_IFPRESENT flags should be added to imgdata.rawparams.options
This translates into numeric value of (1<<20)|(1<<21) so 3145728
This is not perfect solution if one do not want to apply OpcodeList2/3 for all DNG files containing these tags.
To improve it: query decoder used via LibRaw::get_decoder_info() and set the flags only for jxl_dng_load_raw_placeholder() and/or lossy_dng_load_raw() decoders.
Thank you for the file sample.
Here is processing results: https://www.dropbox.com/scl/fi/ooqcaseziap0vwo5ario4/2023-11-11-003-Pano...
dcraw_emu command line used for that:
dcraw_emu -dngsdk -R 3145728 -T 2023-11-11 003-Pano.dng
Technical details:
LIBRAW_RAWOPTIONS_DNG_STAGE2_IFPRESENT/LIBRAW_RAWOPTIONS_DNG_STAGE3_IFPRESENT
flags should be added toimgdata.rawparams.options
This is not perfect solution if one do not want to apply OpcodeList2/3 for all DNG files containing these tags.
To improve it: query decoder used via LibRaw::get_decoder_info() and set the flags only for jxl_dng_load_raw_placeholder() and/or lossy_dng_load_raw() decoders.