changes to package name. added help command.
This commit is contained in:
parent
222b0e2c7b
commit
d4d87fffe3
4
Cargo.lock
generated
4
Cargo.lock
generated
@ -82,8 +82,8 @@ dependencies = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "qoi-test"
|
name = "qoi"
|
||||||
version = "0.1.0"
|
version = "0.1.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"array-init",
|
"array-init",
|
||||||
"colors-transform",
|
"colors-transform",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "qoi-test"
|
name = "qoi"
|
||||||
version = "0.1.0"
|
version = "0.1.1"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
605
src/lib.rs
605
src/lib.rs
File diff suppressed because it is too large
Load Diff
@ -6,7 +6,7 @@ use std::time::SystemTime;
|
|||||||
|
|
||||||
use colors_transform::{Color, Hsl, Rgb};
|
use colors_transform::{Color, Hsl, Rgb};
|
||||||
use png;
|
use png;
|
||||||
use qoi_test::qoi_img::*;
|
use qoi::qoi_lib::*;
|
||||||
|
|
||||||
fn encode_checkerboard() {
|
fn encode_checkerboard() {
|
||||||
let mut pixels: Vec<Pixel> = Vec::with_capacity(64 * 64);
|
let mut pixels: Vec<Pixel> = Vec::with_capacity(64 * 64);
|
||||||
@ -191,7 +191,7 @@ fn decode(args: &Vec<String>) -> io::Result<()> {
|
|||||||
|
|
||||||
reader.read_to_end(&mut bytes)?;
|
reader.read_to_end(&mut bytes)?;
|
||||||
|
|
||||||
match qoi_test::qoi_img::decode(bytes) {
|
match qoi::qoi_lib::decode(bytes) {
|
||||||
Ok(_img) => println!("Decoding successful!"),
|
Ok(_img) => println!("Decoding successful!"),
|
||||||
Err(err) => panic!("ERROR: {err:?}"),
|
Err(err) => panic!("ERROR: {err:?}"),
|
||||||
}
|
}
|
||||||
@ -249,6 +249,9 @@ fn main() {
|
|||||||
"bench" => {
|
"bench" => {
|
||||||
bench(&args);
|
bench(&args);
|
||||||
}
|
}
|
||||||
|
"help" => {
|
||||||
|
println!("qoi supports the following commands: \n encode [IMAGE] (encodes given png-encoded into .qoi) \n decode [IMAGE] decodes given .qoi to .png \n bench [INPUT] [OUTPUT] encodes input .png into .qoi with encoding speed measured in microseconds.")
|
||||||
|
}
|
||||||
_ => {
|
_ => {
|
||||||
panic!("Invalid arguments!")
|
panic!("Invalid arguments!")
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user