Update readme with a simple example
This commit is contained in:
parent
caee8701f5
commit
d21dd97c10
1 changed files with 8 additions and 1 deletions
|
@ -22,7 +22,14 @@ Quick summary:
|
|||
### Examples
|
||||
|
||||
```rust
|
||||
todo!();
|
||||
use qoi_fast::{encode_to_vec, decode_to_vec};
|
||||
|
||||
let encoded = encode_to_vec(&pixels, width, height)?;
|
||||
let (header, decoded) = decode_to_vec(&encoded)?;
|
||||
|
||||
assert_eq!(header.width, width);
|
||||
assert_eq!(header.height, height);
|
||||
assert_eq!(decoded, pixels);
|
||||
```
|
||||
|
||||
### Benchmarks
|
||||
|
|
Loading…
Reference in a new issue