Dear nk,
There is no inbuilt function to Extract RGB from RGBA. you need to access them byte by byte to extra individual channels.
The RGBA stored format is given at file:///usr/local/driveworks/doc/nvdwx_html/group__image__group.html#gga40e445bbc92b6c60197dd57fc9ca602da2fad36b6d1b6c257083f5ff6afcb7f07