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]]
|
||||
name = "qoi-test"
|
||||
version = "0.1.0"
|
||||
name = "qoi"
|
||||
version = "0.1.1"
|
||||
dependencies = [
|
||||
"array-init",
|
||||
"colors-transform",
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "qoi-test"
|
||||
version = "0.1.0"
|
||||
name = "qoi"
|
||||
version = "0.1.1"
|
||||
edition = "2021"
|
||||
|
||||
# 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 png;
|
||||
use qoi_test::qoi_img::*;
|
||||
use qoi::qoi_lib::*;
|
||||
|
||||
fn encode_checkerboard() {
|
||||
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)?;
|
||||
|
||||
match qoi_test::qoi_img::decode(bytes) {
|
||||
match qoi::qoi_lib::decode(bytes) {
|
||||
Ok(_img) => println!("Decoding successful!"),
|
||||
Err(err) => panic!("ERROR: {err:?}"),
|
||||
}
|
||||
@ -249,6 +249,9 @@ fn main() {
|
||||
"bench" => {
|
||||
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!")
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user