Done. I think bmp plugin's read_native_scanline is written in the same manner:
https://github.com/OpenImageIO/oiio/blob/master/src/bmp.imageio/bmpinput.cpp#L176