update servicepoint, simplify copy_raw
This commit is contained in:
parent
8d5e408653
commit
4cbf3784fc
5 changed files with 18 additions and 19 deletions
|
@ -2,7 +2,10 @@ use crate::macros::{
|
|||
wrap_get_set_fill_2d, wrap_uniffi_object, wrap_width_height,
|
||||
};
|
||||
use servicepoint::{Brightness, DataRef, Grid};
|
||||
use std::sync::Arc;
|
||||
use std::{
|
||||
ops::Deref,
|
||||
sync::{Arc, RwLockReadGuard},
|
||||
};
|
||||
|
||||
wrap_uniffi_object!(BrightnessGrid);
|
||||
wrap_width_height!(BrightnessGrid);
|
||||
|
@ -37,12 +40,6 @@ impl BrightnessGrid {
|
|||
}
|
||||
|
||||
pub fn copy_raw(&self) -> Vec<u8> {
|
||||
self.actual
|
||||
.read()
|
||||
.unwrap()
|
||||
.data_ref()
|
||||
.iter()
|
||||
.map(u8::from)
|
||||
.collect()
|
||||
self.actual.read().unwrap().deref().into()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue