Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FR] add CLI #36

Open
NightMachinery opened this issue Sep 14, 2021 · 1 comment
Open

[FR] add CLI #36

NightMachinery opened this issue Sep 14, 2021 · 1 comment

Comments

@NightMachinery
Copy link

Add a CLI:

bardecoder file.png
@itdaniher
Copy link

Here's my main.rs for a CLI.

use bardecoder;
use bardecoder::prepare::BlockedMean;

use image;

use std::env;

fn main() {
    let img = image::open(env::args().last().unwrap()).unwrap();

    // Use default decoder builder
    let mut db = bardecoder::default_builder();

    // Use some different arguments in one of the default components
    //db.prepare(Box::new(BlockedMean::new(7, 9)));

    // Build the actual decoder
    let decoder = db.build();

    let results = decoder.decode(&img);
    for result in results {
        println!("{}", result.unwrap());
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants