Compare commits
1 Commits
master
...
noise-redu
Author | SHA1 | Date |
---|---|---|
Max Bradbury | 63bcf8532c |
|
@ -78,6 +78,11 @@ html(lang="en-gb")
|
||||||
| dither
|
| dither
|
||||||
br
|
br
|
||||||
|
|
||||||
|
label
|
||||||
|
input#filter(type="checkbox")
|
||||||
|
| filter
|
||||||
|
br
|
||||||
|
|
||||||
button.pagination.prev#back-to-image previous
|
button.pagination.prev#back-to-image previous
|
||||||
button.pagination.next#room-next add room
|
button.pagination.next#room-next add room
|
||||||
.page.download
|
.page.download
|
||||||
|
|
|
@ -8,6 +8,7 @@ import init, {
|
||||||
output,
|
output,
|
||||||
set_brightness,
|
set_brightness,
|
||||||
set_dither,
|
set_dither,
|
||||||
|
set_filter,
|
||||||
set_palette,
|
set_palette,
|
||||||
set_room_name,
|
set_room_name,
|
||||||
} from './pkg/pixsy.js';
|
} from './pkg/pixsy.js';
|
||||||
|
|
|
@ -33,6 +33,7 @@ struct State {
|
||||||
room_name: Option<String>,
|
room_name: Option<String>,
|
||||||
palette: SelectedPalette,
|
palette: SelectedPalette,
|
||||||
dither: bool,
|
dither: bool,
|
||||||
|
filter: bool,
|
||||||
brightness: i32,
|
brightness: i32,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,6 +45,7 @@ lazy_static! {
|
||||||
room_name: None,
|
room_name: None,
|
||||||
palette: SelectedPalette::None,
|
palette: SelectedPalette::None,
|
||||||
dither: true,
|
dither: true,
|
||||||
|
filter: false,
|
||||||
brightness: 0,
|
brightness: 0,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
@ -131,6 +133,12 @@ pub fn set_dither(dither: bool) {
|
||||||
state.dither = dither;
|
state.dither = dither;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[wasm_bindgen]
|
||||||
|
pub fn set_filter(filter: bool) {
|
||||||
|
let mut state = STATE.lock().unwrap();
|
||||||
|
state.filter = filter;
|
||||||
|
}
|
||||||
|
|
||||||
#[wasm_bindgen]
|
#[wasm_bindgen]
|
||||||
pub fn set_palette(palette_id: &str, background: String, foreground: String) {
|
pub fn set_palette(palette_id: &str, background: String, foreground: String) {
|
||||||
let mut state = STATE.lock().unwrap();
|
let mut state = STATE.lock().unwrap();
|
||||||
|
|
Loading…
Reference in New Issue