https://www.libraw.org/docs https://www.libraw.org/docs/API-CXX.html#COLOR will return pixel color for (row,col). Of course, this colors are repeatable in rows/columns (in 2x2 pattern for normal bayer and in 6x6 for X-Trans), so you do not need to call it on each pixel -- Alex Tutubalin @LibRaw LLC reply
https://www.libraw.org/docs/API-CXX.html#COLOR will return pixel color for (row,col).
Of course, this colors are repeatable in rows/columns (in 2x2 pattern for normal bayer and in 6x6 for X-Trans), so you do not need to call it on each pixel