add Brightness::saturating_from

This commit is contained in:
Vinzenz Schroeter 2024-10-15 21:32:37 +02:00
parent 593a975d5c
commit 78a4d4dbcf
4 changed files with 33 additions and 8 deletions

View file

@ -21,14 +21,9 @@ use std::intrinsics::transmute;
/// SPCommand command = sp_command_char_brightness(grid);
/// sp_connection_free(connection);
/// ```
#[derive(Clone)]
pub struct SPBrightnessGrid(pub(crate) servicepoint::BrightnessGrid);
impl Clone for SPBrightnessGrid {
fn clone(&self) -> Self {
SPBrightnessGrid(self.0.clone())
}
}
/// Creates a new [SPBrightnessGrid] with the specified dimensions.
///
/// returns: [SPBrightnessGrid] initialized to 0. Will never return NULL.