Since the question was actually about black and white objects, the - otherwise correct! - caveat of images possibly having color patches in them does not apply.
The question should instead be answered with: Libraw currently does not have such a function and due to its generalistic approach never will have, yet building a solution is rather easy and straight forward: If you know that your objects are reliably black and white anyway, just shoot a gray image, read out the channel differences (i.e. the "scaling" introduced by the color filters) and re-multiply with the appropriate scales.
Since the question was actually about black and white objects, the - otherwise correct! - caveat of images possibly having color patches in them does not apply.
The question should instead be answered with: Libraw currently does not have such a function and due to its generalistic approach never will have, yet building a solution is rather easy and straight forward: If you know that your objects are reliably black and white anyway, just shoot a gray image, read out the channel differences (i.e. the "scaling" introduced by the color filters) and re-multiply with the appropriate scales.
Mact