Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mycrl/libyuv-rs
Libyuv bindings for rust.
https://github.com/mycrl/libyuv-rs
libyuv rgb rust-lang yuv
Last synced: 3 months ago
JSON representation
Libyuv bindings for rust.
- Host: GitHub
- URL: https://github.com/mycrl/libyuv-rs
- Owner: mycrl
- License: mit
- Created: 2022-12-14T15:27:09.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2024-09-25T03:16:45.000Z (4 months ago)
- Last Synced: 2024-10-01T17:08:41.067Z (3 months ago)
- Topics: libyuv, rgb, rust-lang, yuv
- Language: Rust
- Homepage: https://crates.io/crates/libyuv
- Size: 71.3 KB
- Stars: 7
- Watchers: 1
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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:
```toml
[dependencies]
libyuv = "1"
```Convert ARGB to NV12:
```rs
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](./LICENSE) Copyright (c) 2022 Mr.Panda.