changes to package name. added help command.

This commit is contained in:
nihil 2024-11-13 23:55:53 +01:00
parent 222b0e2c7b
commit d4d87fffe3
4 changed files with 335 additions and 285 deletions

4
Cargo.lock generated
View File

@ -82,8 +82,8 @@ dependencies = [
]
[[package]]
name = "qoi-test"
version = "0.1.0"
name = "qoi"
version = "0.1.1"
dependencies = [
"array-init",
"colors-transform",

View File

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

File diff suppressed because it is too large Load Diff

View File

@ -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!")
}