add uniffi CP437Grid, equals
add equals method add uniffi copy_raw method
This commit is contained in:
parent
03aa432655
commit
9553d9fe42
7 changed files with 586 additions and 2 deletions
|
@ -1,4 +1,4 @@
|
|||
use servicepoint::{Brightness, Grid};
|
||||
use servicepoint::{Brightness, DataRef, Grid};
|
||||
use std::sync::{Arc, RwLock};
|
||||
|
||||
#[derive(uniffi::Object)]
|
||||
|
@ -67,4 +67,14 @@ impl BrightnessGrid {
|
|||
pub fn height(&self) -> u64 {
|
||||
self.actual.read().unwrap().height() as u64
|
||||
}
|
||||
|
||||
pub fn equals(&self, other: &BrightnessGrid) -> bool {
|
||||
let a = self.actual.read().unwrap();
|
||||
let b = other.actual.read().unwrap();
|
||||
*a == *b
|
||||
}
|
||||
|
||||
pub fn copy_raw(&self) -> Vec<u8> {
|
||||
self.actual.read().unwrap().data_ref().iter().map(u8::from).collect()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue