image_ffmpeg_decode_image_rgba function
Probes arbitrary encoded bytes as an image, decodes the first frame, and returns tightly packed RGBA8888. A zero maximum preserves that axis. If both maxima are non-zero, aspect ratio is preserved and the image fits within the requested box without upscaling.
This coarse operation is intentional: one boundary crossing owns probing, decode, scale, pixel conversion, and allocation on native and WebAssembly.
Implementation
@ffi.Native<
ffi.Int32 Function(
ffi.Pointer<ffi.Uint8>,
ffi.Uint32,
ffi.Uint32,
ffi.Uint32,
ffi.Pointer<image_ffmpeg_image>,
)
>()
external int image_ffmpeg_decode_image_rgba(
ffi.Pointer<ffi.Uint8> input,
int input_length,
int max_width,
int max_height,
ffi.Pointer<image_ffmpeg_image> output,
);