Crates.io | ueberzug |
lib.rs | ueberzug |
version | 0.1.0 |
source | src |
created_at | 2021-12-26 06:11:46.471117 |
updated_at | 2021-12-26 06:11:46.471117 |
description | Unofficial Ueberzug bindings to use in rust projects |
homepage | |
repository | https://github.com/Adit-Chauhan/Ueberzug-rs |
max_upload_size | |
id | 503203 |
size | 10,261 |
Ueberzug-rs This project provides simple bindings to that ueberzug to draw images in the terminal.
This code was inspired from the termusic to convert their specilized approach to a more general one.
Note: This project needs ueberzug to be installed and be in the system path.
this example will draw image for 2 seconds, erase the image and wait 1 second before exiting the program.
use std::thread::sleep;
use std::time::Duration;
use ueberzug::{UeConf,Scalers};
let a = ueberzug::Ueberzug::new();
// Draw image
// See UeConf for more details
a.draw(&UeConf {
identifier: "crab",
path: "ferris.png",
x: 10,
y: 2,
width: Some(10),
height: Some(10),
scaler: Some(Scalers::FitContain),
..Default::default()
});
sleep(Duration::from_secs(2));
// Only identifier needed to clear image
a.clear("crab");
sleep(Duration::from_secs(1));