image_ffmpeg_bindings_generated library

Classes

image_ffmpeg_buffer
Owned encoded bytes returned by an encoder operation.
image_ffmpeg_encoded_image
image_ffmpeg_image
Owned output from image_ffmpeg_decode_image_rgba. Keep upstream AVFrame and AVCodecContext details out of this ABI: this exact struct is shared by FFI and Wasm, and remains stable when FFmpeg changes.
image_ffmpeg_image_info
Probe information without decoded pixels. has_alpha is -1 when the container cannot answer without decoding, 0 for no, and 1 for yes. frame_count is zero when the container does not advertise a count.
image_ffmpeg_transcode_options

Enums

image_ffmpeg_box_alpha_mode
image_ffmpeg_image_format
image_ffmpeg_jpeg_chroma
image_ffmpeg_orientation
Values intentionally match EXIF Orientation tag values.
image_ffmpeg_pixel_format
image_ffmpeg_scale_filter
Resampling filter of image_ffmpeg_scale_rgba.
image_ffmpeg_status

Constants

IMAGE_FFMPEG_ABI_VERSION → const int

Functions

image_ffmpeg_abi_version() → int
image_ffmpeg_buffer_release(Pointer<image_ffmpeg_buffer> buffer) → void
image_ffmpeg_build_info() → Pointer<Char>
image_ffmpeg_decode_image_rgba(Pointer<Uint8> input, int input_length, int max_width, int max_height, Pointer<image_ffmpeg_image> output) → int
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.
image_ffmpeg_decode_image_rgba_box_average(Pointer<Uint8> input, int input_length, int max_dimension, int alpha_mode, Pointer<image_ffmpeg_image> output) → int
Decodes the first frame at full resolution and folds completed RGBA rows immediately into integer-only destination cells. POSIX native targets discard completed scratch pages, avoiding a resident full-resolution RGBA intermediate while preserving byte-identical full-frame color conversion. Only the small deterministic result crosses the language boundary. The result is never upscaled and max_dimension must be nonzero.
image_ffmpeg_encode_jpeg_rgba(Pointer<Uint8> rgba, int rgba_length, int width, int height, int stride, int quality, int chroma, int background_argb, Pointer<image_ffmpeg_buffer> output) → int
Encodes RGBA8888 as JPEG. Quality is 1..100. background_argb is 0xAARRGGBB (the alpha byte is ignored); chroma is IMAGE_FFMPEG_JPEG_CHROMA_420 or _444.
image_ffmpeg_encode_png_rgba(Pointer<Uint8> rgba, int rgba_length, int width, int height, int stride, int compression_level, Pointer<image_ffmpeg_buffer> output) → int
Encodes RGBA8888 pixels as a complete PNG image, preserving alpha. Compression level is 0 (fastest) to 9 (smallest).
image_ffmpeg_encoded_image_release(Pointer<image_ffmpeg_encoded_image> image) → void
image_ffmpeg_error_message(int status) → Pointer<Char>
image_ffmpeg_has_ffmpeg() → int
image_ffmpeg_image_release(Pointer<image_ffmpeg_image> image) → void
Releases output->data and zeroes the struct. Safe on a zeroed image.
image_ffmpeg_probe_image(Pointer<Uint8> input, int input_length, Pointer<image_ffmpeg_image_info> output) → int
Reads image format, geometry, EXIF orientation, frame count, and alpha hints without decoding a pixel buffer.
image_ffmpeg_scale_rgba(Pointer<Uint8> rgba, int rgba_length, int width, int height, int stride, int crop_x, int crop_y, int crop_width, int crop_height, int output_width, int output_height, int filter, Pointer<image_ffmpeg_image> output) → int
Crops RGBA8888 pixels, then scales the crop to exactly output_width x output_height with the filter, an image_ffmpeg_scale_filter. A zero crop width and height use the whole image. The output may be larger or smaller than the crop, and its aspect ratio may differ. Alpha is not premultiplied: the colors of transparent pixels can bleed into their neighbors.
image_ffmpeg_transcode_image(Pointer<Uint8> input, int input_length, Pointer<image_ffmpeg_transcode_options> options, Pointer<image_ffmpeg_encoded_image> output) → int
Fused first-frame decode, optional EXIF orientation, solid fill, crop, fit-within resize, and JPEG/PNG encode. Fill and crop coordinates are in oriented coordinates when apply_orientation is nonzero. Zero fill or crop width and height disable that operation.