Skip to main content

convert

Function convert 

Source
pub fn convert(
    frame: &FrameEnvelope,
    target: PixelFormat,
) -> Result<FrameEnvelope, ConvertError>
Expand description

Convert a frame to a different pixel format.

Works with host-resident and MappableToHost device frames. Conversion always allocates a new output buffer, so the additional cost of materializing device data is negligible.

§Errors

Currently supported paths:

  • Bgr8Rgb8
  • Rgb8Bgr8
  • Rgba8Rgb8
  • Rgb8Gray8

Other conversions can be contributed by adding a match arm below.