Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/magiclen/zbar-rust
High-level and low-level ZBar binding for the Rust language.
https://github.com/magiclen/zbar-rust
rust zbar
Last synced: 28 days ago
JSON representation
High-level and low-level ZBar binding for the Rust language.
- Host: GitHub
- URL: https://github.com/magiclen/zbar-rust
- Owner: magiclen
- License: lgpl-2.1
- Created: 2018-10-31T08:24:45.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-12-15T03:19:11.000Z (about 1 year ago)
- Last Synced: 2024-03-15T05:05:59.479Z (9 months ago)
- Topics: rust, zbar
- Language: Rust
- Homepage:
- Size: 49.8 KB
- Stars: 11
- Watchers: 3
- Forks: 12
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
ZBar Rust
====================[![CI](https://github.com/magiclen/zbar-rust/actions/workflows/ci.yml/badge.svg)](https://github.com/magiclen/zbar-rust/actions/workflows/ci.yml)
High-level and low-level ZBar binding for the Rust language.
## Compilation
To compile this crate, you need to compile the ZBar library first. You can install ZBar in your operating system, or in somewhere in your file system. As for the latter, you need to set the following environment variables to link the ZBar library:
* `ZBAR_LIB_DIRS`: The directories of library files, like `-L`. Use `:` to separate.
* `ZBAR_LIBS`: The library names that you want to link, like `-l`. Use `:` to separate. Typically, it is **iconv:zbar**.
* `ZBAR_INCLUDE_DIRS`: The directories of header files, like `-i`. Use `:` to separate.## Examples
```rust
use zbar_rust::ZBarImageScanner;use image::GenericImageView;
let img = image::open(INPUT_IMAGE_PATH).unwrap();
let (width, height) = img.dimensions();
let mut scanner = ZBarImageScanner::new();
let mut results = scanner.scan_y800(img.into_luma8().into_raw(), width, height).unwrap();
for result in results {
println!("{}", String::from_utf8(result.data).unwrap())
}
```More examples are in the `examples` folder.
## Crates.io
https://crates.io/crates/zbar-rust
## Documentation
https://docs.rs/zbar-rust
## License
[LGPL-2.1](LICENSE)