Reading a file that is just 8 bit Bayer pixels

I have a file from "fswebcam --dumpfile" that is just a stream of 8 bit pixel values. There is no other data in the file. Is it possible to read this into LibRaw and demosaic it into a file such as a TIFF or JPEG file? When I try to read the file in with imread(), it says that the file has an unsupported format.

Basically I want to be able to specify the XY size of the file and the pixel format so that LibRaw can read the file.



LibRaw provides LibRaw::open

LibRaw provides LibRaw::open_bayer() call for such tasks.
Unfotrunately, the only place where it is documented is Changelog.txt file, it is missing from docs (to be fixed).
Also, look into samples\openbayer_example.cpp

-- Alex Tutubalin