10bit Bayer to 10bit RGB Conversion

Hello
I’m new to opencv and c++ and I need to use 10bit BayerRG format on my machine vision camera for better colour depth and I read on some forums that opencv supports bayer2rgb conversion only for 8bit images. I feel lost, can someone please advise any workarounds.

Thanks.