summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs20
1 files changed, 0 insertions, 20 deletions
diff --git a/src/main.rs b/src/main.rs
deleted file mode 100644
index 1635188..0000000
--- a/src/main.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-use libwebp::WebPEncodeLosslessRGBA;
-use std::fs::File;
-use std::io::prelude::*;
-fn main() -> std::io::Result<()> {
- let buf: &[u8] = &[
- 255,255,255,255,
- 255,0,0,255,
- 0,255,0,255,
- 0,0,255,255,
- 255,255,255,127,
- ];
- let data = WebPEncodeLosslessRGBA(buf,5,1,8).unwrap();
- let mut file = File::create("image.webp")?;
- let mut pos = 0;
- while pos < data.len() {
- let bytes_written = file.write(&data[pos..])?;
- pos += bytes_written;
- }
- Ok(())
-}