pub struct Wall<S: FrameSink = Link> { /* private fields */ }Expand description
A wall of panels on one network interface.
Implementations§
Source§impl<S: FrameSink> Wall<S>
impl<S: FrameSink> Wall<S>
Sourcepub fn with_sink(dev: S, canvas: Canvas, settings: Settings) -> Result<Self>
pub fn with_sink(dev: S, canvas: Canvas, settings: Settings) -> Result<Self>
Bind a canvas to any frame sink.
§Errors
Fails if the canvas is inconsistent or too large for the row packet’s u16 coordinates (every receiver lies inside it, so they fit too).
pub const fn canvas(&self) -> &Canvas
pub const fn frames_sent(&self) -> u64
pub const fn settings(&self) -> &Settings
Sourcepub fn set_brightness(&mut self, brightness: u8)
pub fn set_brightness(&mut self, brightness: u8)
Change the brightness every later refresh carries. Nothing is sent here; the cached brightness and latch frames are rebuilt.
Sourcepub fn set_gains(&mut self, brightness: u8, gains: [u8; 3])
pub fn set_gains(&mut self, brightness: u8, gains: [u8; 3])
set_brightness with the latch frame’s three
channel gains given separately (colorlight::sync_gains); the brightness
frame carries only the master.
Sourcepub fn announce_layout(&mut self) -> Result<()>
pub fn announce_layout(&mut self) -> Result<()>
Tell every receiver its own window and the size of the whole wall.
The as u16 casts are lossless: sizes were checked in with_sink.
§Errors
Fails if a frame cannot be sent.
Sourcepub fn show(&mut self, frame: &Frame) -> Result<()>
pub fn show(&mut self, frame: &Frame) -> Result<()>
Render one canvas frame onto the screen and push the screen to the chain: brightness, one row packet per screen row (chunked at 497 pixels), the latch gap, the latches. Row and pixel offset are screen coordinates; every card keeps its own window of them (docs/receiver-identity.md), so the stream is the same however many cards listen.
A card fresh from arming never starts when the latch leads the rows; once woken either order works (docs/rendering.md).
§Errors
Fails if a frame cannot be sent.
Sourcepub fn show_rows(&mut self, frame: &Frame, rows: Range<u32>) -> Result<()>
pub fn show_rows(&mut self, frame: &Frame, rows: Range<u32>) -> Result<()>
show sending only the screen rows in rows (clipped
to the screen) between the brightness frame and the latches. Rows are
addressed and the card keeps its frame memory, so the rest of the
picture stays as last sent; an empty range sends brightness and
latches alone. The card’s own scan bounds how fast a band can change.
§Errors
Fails if a frame cannot be sent.