oa::image::decode_file

Decode a JPEG, PNG, WebP, BMP, or TGA file and upload normalized planar FP32 pixels. The result is one NCHW image shaped [1, channels, height, width]. This is a synchronous host codec boundary followed by device upload. Errors Returns an error for an empty path, filesystem failure, unsupported or malformed media, unsupported requested format, checked-size overflow, or device allocation/upload failure.

FnRust public API

Function Documentation

pub fn decode_file( engine: &Engine, path: impl AsRef<Path>, format: ImageFormat ) -> Result<Image>
Decode a JPEG, PNG, WebP, BMP, or TGA file and upload normalized planar FP32 pixels. The result is one NCHW image shaped [1, channels, height, width]. This is a synchronous host codec boundary followed by device upload. Errors Returns an error for an empty path, filesystem failure, unsupported or malformed media, unsupported requested format, checked-size overflow, or device allocation/upload failure.

Examples