#[repr(C)]pub struct Sample {
pub rg: u16,
pub b: u16,
pub x: u16,
pub y: u16,
}Expand description
A laser sample with position and color.
The LaserDock uses 12-bit coordinates (0-4095) where:
- X: 0 = left edge, 2047 = center, 4095 = right edge
- Y: 0 = bottom edge, 2047 = center, 4095 = top edge
Colors are 8-bit values (0-255).
Fields§
§rg: u16Red (low byte) and Green (high byte) combined.
b: u16Blue (low byte), high byte unused.
x: u16X coordinate (12-bit, 0-4095).
y: u16Y coordinate (12-bit, 0-4095).
Implementations§
Trait Implementations§
Source§impl From<&LaserPoint> for Sample
impl From<&LaserPoint> for Sample
Source§fn from(p: &LaserPoint) -> Self
fn from(p: &LaserPoint) -> Self
Convert a LaserPoint to a LaserCube USB Sample.
LaserPoint uses f32 coordinates (-1.0 to 1.0) and u16 colors (0-65535). LaserCube USB uses 12-bit unsigned coordinates (0-4095) and u8 colors.
impl Copy for Sample
impl Eq for Sample
impl StructuralPartialEq for Sample
Auto Trait Implementations§
impl Freeze for Sample
impl RefUnwindSafe for Sample
impl Send for Sample
impl Sync for Sample
impl Unpin for Sample
impl UnsafeUnpin for Sample
impl UnwindSafe for Sample
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more