Update readme with a simple example

This commit is contained in:
Ivan Smirnov 2022-01-04 01:52:42 +03:00
parent caee8701f5
commit d21dd97c10

View file

@ -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