#computer-vision #ffi #api-bindings

libyuv

Raw FFI bindings to libyuv libraries

6 releases (1 stable)

1.0.0 Aug 22, 2024
0.1.4 Aug 21, 2024
0.1.2 Aug 10, 2023
0.1.1 Dec 17, 2022

#26 in Multimedia

Download history 426/week @ 2024-08-18 23/week @ 2024-08-25 1/week @ 2024-09-01 22/week @ 2024-09-15 23/week @ 2024-09-22 17/week @ 2024-09-29 30/week @ 2024-10-06 63/week @ 2024-10-13 163/week @ 2024-10-20 71/week @ 2024-10-27 100/week @ 2024-11-03 84/week @ 2024-11-10 140/week @ 2024-11-17 693/week @ 2024-11-24 662/week @ 2024-12-01

1,592 downloads per month

MIT license

200KB
4.5K SLoC

libyuv-rs

Raw FFI bindings to libyuv libraries,This is an unsafe package.

Supported platforms

arch/os linux windows macos
arm64
amd64

Quick start

Add the following to your Cargo.toml:

[dependencies]
libyuv = "0.1"

Convert ARGB to NV12:

let argb = vec![0u8; 1280 * 720 * 4];
let mut nv12 = vec![0u8; 1280 * 720 * 1.5];

let ret = unsafe {
    libyuv::argb_to_nv12(
        argb.as_ptr(),
        1280 * 4,
        nv12.as_mut_ptr(),
        1280,
        nv12.as_mut_ptr().add(1280 * 720),
        1280,
        1280,
        720,
    )
};

assert_eq!(ret, 0);

License

MIT Copyright (c) 2022 Mr.Panda.

No runtime deps