Ok, I'm having another go at implementing camera matrices. When I tried before, my results were all purple, but now I think about it, I realise, the matrix probably transformed the footage to XYZ with some kind of white point adjustment, so when I did the same WB multiplication on that XYZ colour that I do on raw space, it would increase the blue and red too much, which the matrix had already done.
So, does anyone know what temperature/white point the result of matrices 1 and 2 is? Is it 6500k/D65? What is the difference between 1 and 2? I looked at DNG spec, not really sure which one I need, but I know they both convert to raw to XYZ (once inverted)
Also, about this useful thing:
struct cam_matrices {
char * camera;
int32_t ColorMatrix1[18];
int32_t ColorMatrix2[18];
int32_t ForwardMatrix1[18];
int32_t ForwardMatrix2[18];
};
Are ForwardMatrix1 and ForwardMatrix2 the same as ColorMatrix1 and ColorMatrix2, but inverted?
I'm almost there, matrix infrastructure in the app is there, just needs to be set up correctly.
(and thanks everyone)