add uniffi compression code, clone

add uniffi clone
This commit is contained in:
Vinzenz Schroeter 2024-11-04 22:21:28 +01:00
parent 18f1ccb2dc
commit 03aa432655
7 changed files with 213 additions and 40 deletions

View file

@ -33,6 +33,11 @@ impl BrightnessGrid {
))
}
#[uniffi::constructor]
pub fn clone(other: &Arc<Self>) -> Arc<Self> {
Self::internal_new(other.actual.read().unwrap().clone())
}
pub fn set(&self, x: u64, y: u64, value: u8) {
self.actual.write().unwrap().set(
x as usize,