Read input data/stream in opencv

Currently, I am getting my input in cv::mat format in Opencv.
How do I proceed ahead with converting the input data(cv::mat format) in the required format i.e (0XRRGGBB)?