rawprepare can produce very different results in preview and full pipe
Before I forget again here are the steps to reproduce this issue:
- Open any image and go to "raw black/white point"
- Take one of the four black levels and move it up to a high value (to make it obvious)
- At this point the preview and the full pipe produce very different results (see the attached screenshot)
My understanding is that this happens because the preview pipe is using a demosaiced RGB image and then applying the wrong blackpoint to each of the channels. In most cases this doesn't matter because the blackpoints are similar enough between all four channels that the preview isn't too off.
To fix this properly we probably need to use FC and FCxtrans() to figure correspondence in bayer/xtrans and CYGM may be trickier. For the same reason as CYGM the green channel is also going to be more complex because it has two different blackpoints. A full fix would be to make MIPF 4-channel (RGGB) instead of 3 (RGB) all the way through to demosaic where it would get turned into 3 channel. This would also simplify CYGM a bit. Since this is mostly a correctness issue and in real world usage doesn't show up much (at all?) we can also just ignore it.