31 lines
831 B
Rust
31 lines
831 B
Rust
use crate::{
|
|
commands::wrap_command, compression_code::CompressionCode,
|
|
containers::bitmap::Bitmap, macros::wrap_object_attr_wrapped,
|
|
};
|
|
use servicepoint::Origin;
|
|
use std::sync::Arc;
|
|
|
|
wrap_command!(BitmapCommand);
|
|
|
|
wrap_object_attr_wrapped!(BitmapCommand, bitmap, Bitmap);
|
|
|
|
#[uniffi::export]
|
|
impl BitmapCommand {
|
|
#[uniffi::constructor]
|
|
pub fn new(
|
|
offset_x: u64,
|
|
offset_y: u64,
|
|
bitmap: &Arc<Bitmap>,
|
|
compression: CompressionCode,
|
|
) -> Arc<Self> {
|
|
let origin = Origin::new(offset_x as usize, offset_y as usize);
|
|
let bitmap = bitmap.read().clone();
|
|
let compression = compression.into();
|
|
let actual = servicepoint::BitmapCommand {
|
|
origin,
|
|
bitmap,
|
|
compression,
|
|
};
|
|
Self::internal_new(actual)
|
|
}
|
|
}
|