I am trying to get a better understanding of what exposure compensation exactly does at the pixel level. What mathematical operations are operated on every pixel and where can I find the formulas? From the documentation (https://rawpedia.rawtherapee.com/Exposure#Exposure_Compensation) I see that a gain is applied. If there is only a gain applied to each of the color channels, what losses will be actually made if you decide to first compress the raw image to jpg, and then do the “gain adjustments” on the pixel? How much would that differ from first doing the exposure compensation on the raw image and then doing the compression to jpg?