pub struct PixelScreen { /* private fields */ }Expand description
Renders a pixel surface full-screen through the best strategy the terminal offers.
Implementations§
Source§impl PixelScreen
impl PixelScreen
Sourcepub fn new(caps: &Capabilities, cell: CellPixels, patched: PatchedKitty) -> Self
pub fn new(caps: &Capabilities, cell: CellPixels, patched: PatchedKitty) -> Self
The screen for caps with cells of cell pixels: patched when
the terminal speaks the kitty graphics protocol, sixel tiles when it
speaks sixel, quarter blocks otherwise.
Sourcepub fn picture(caps: &Capabilities, cell: CellPixels) -> Self
pub fn picture(caps: &Capabilities, cell: CellPixels) -> Self
The screen for a terminal without kitty graphics: sixel tiles when it speaks sixel, quarter blocks otherwise.
Sourcepub fn rows_shown(&self, rows: u16) -> u16
pub fn rows_shown(&self, rows: u16) -> u16
How many of rows screen rows a frame covers. Sixel leaves the
bottom row free, because a sixel touching it scrolls the screen.
Sourcepub fn animated(
caps: &Capabilities,
cell: CellPixels,
animated: AnimatedKitty,
fallback: PatchedKitty,
) -> Self
pub fn animated( caps: &Capabilities, cell: CellPixels, animated: AnimatedKitty, fallback: PatchedKitty, ) -> Self
The same screen driven by a terminal-side animation when the
terminal stores animation frames outside a multiplexer, which
swallows frames, and by Self::new with fallback otherwise.
Sourcepub fn set_cell(&mut self, cell: CellPixels)
pub fn set_cell(&mut self, cell: CellPixels)
Draw for cells of cell pixels from now on, after a font zoom.
Sourcepub fn repaint(&mut self)
pub fn repaint(&mut self)
Send every graphics pixel again on the next frame, for when the terminal may have lost its images, such as after a window resize.
Sourcepub fn free<W: Sink>(&mut self, out: &mut W) -> Result<()>
pub fn free<W: Sink>(&mut self, out: &mut W) -> Result<()>
Free every graphics image this screen sent and repaint on the next frame, for a screen that went out of view or is being replaced.
Sourcepub fn render_frame<W: Sink>(
&mut self,
out: &mut W,
surface: &Surface,
columns: u16,
rows: u16,
) -> Result<usize>
pub fn render_frame<W: Sink>( &mut self, out: &mut W, surface: &Surface, columns: u16, rows: u16, ) -> Result<usize>
Write surface scaled to the whole columns x rows screen and
return the bytes written. Blocks show two by two pixels a cell, so
a surface of another size is resized to that first.