I have an UnsafeMutablePointer<UInt8>
which contains the raw RGB data to construct the image.
But I cannot find a API that can render the image from raw RGB data.
var content = UnsafeMutablePointer<UInt8>.allocate(capacity: 6)
apply_raw_data(content) // set content to [255,0,0,255,0,0]
let data = Data(bytes: content, count: 6)
let ui_image = UIImage(data: data) // we get nil