LibRaw processing order of operation && where to get RGB image that's not processed yet

Is it possible to get an RGB or XYZ or other image that's not processed yet (image after unpacking - preferably RGB)?

I'd also like to ask about order of operations done in dcraw_process.

Forums: 

For bayer image, use imgdata

For bayer image, use imgdata.rawdata.raw_image array to access unprocessed values decoded from raw file

-- Alex Tutubalin

'color profile' or RGB?

Well, both would be nice to know about. The situation has changed for me since asking this question :) Right now color profile could help me a bit more.

The camera to sRGB matrix is

The camera to sRGB matrix is in imgdata.color.rgb_cam[3][4] array.

This is 'device link'profile, you may multiply this matrix to another one (e.g. srgb to Adobe RGB) to get different output color space.

-- Alex Tutubalin