implement sharpen

This commit is contained in:
Vinzenz Schroeter 2025-02-28 12:12:39 +01:00
parent ea7262f8f5
commit f64365f5bd
2 changed files with 32 additions and 2 deletions

View file

@ -29,11 +29,17 @@ pub fn stream_window(connection: &Connection, options: StreamScreenOptions) {
loop {
let mut frame = get_next_frame(&capturer);
LedwandDither::histogram_correction(&mut frame);
let mut orig = frame.clone();
LedwandDither::blur(&orig, &mut frame);
std::mem::swap(&mut frame, &mut orig);
LedwandDither::sharpen(&orig, &mut frame);
let cutoff = if options.no_dither {
LedwandDither::median_brightness(&frame)
} else {
LedwandDither::histogram_correction(&mut frame);
LedwandDither::blur(&frame.clone(), &mut frame);
dither(&mut frame, &BiLevel);
u8::MAX / 2
};