Function convert_image::convert

source ·
pub fn convert<SRC, DEST>(
    frame: &dyn ImageStride<SRC>
) -> Result<impl ImageStride<DEST> + '_, Error>
where SRC: PixelFormat, DEST: PixelFormat,
Expand description

Convert input frame with pixel_format SRC into pixel_format DEST

This is a general purpose function which should be able to convert between many types as efficiently as possible. In case no data needs to be copied, no data is copied.

For a version which converts into a pre-allocated buffer, use convert_into (which will copy the image even if the format remains unchanged).