pub struct CellGrid {
pub cols: u16,
pub rows: u16,
pub cells: Vec<Cell>,
}raster only.Expand description
A row-major grid of Cells (cells.len() == cols*rows).
Fields§
§cols: u16§rows: u16§cells: Vec<Cell>Implementations§
Source§impl CellGrid
impl CellGrid
Sourcepub fn filled(cols: u16, rows: u16, fill: Cell) -> Self
pub fn filled(cols: u16, rows: u16, fill: Cell) -> Self
A grid of cols * rows cells, all set to fill.
Render text as a single-row banner of literal glyph Cells (Task
13 Property 3 hook: the labeled-scalar text path, independent of the
pixel rasterize() path — it never touches a frame golden). Every
cell still carries ch+fg+bg unconditionally (glyph floor). Bounded:
text.chars().count().
Sourcepub fn stamp_text(&mut self, row: u16, col: u16, text: &str, fg: Rgb, bg: Rgb)
pub fn stamp_text(&mut self, row: u16, col: u16, text: &str, fg: Rgb, bg: Rgb)
Overwrite cells with the literal glyphs of text, starting at
(row, col) and wrapping onto the following rows, clipped at the
grid’s last row (review MAJOR 5: the glyph-floor information-parity
constraint is met by stamping labeled scalars into the REAL frame,
not by building a separate banner grid nothing renders). Every
stamped cell still carries ch+fg+bg unconditionally. Bounded:
text.chars().count(), and never writes past cells.len().
Sourcepub fn to_text(&self) -> String
pub fn to_text(&self) -> String
Glyphs only, newline-joined — the diffable byte-exact golden form.
Sourcepub fn to_ansi(&self, palette: Palette) -> String
pub fn to_ansi(&self, palette: Palette) -> String
Glyphs with fg/bg ANSI escapes under palette (Task 4): \x1b[0m
reset, then per-cell \x1b[38;2;r;g;bm/\x1b[48;2;r;g;bm (truecolor)
or \x1b[38;5;{n}m/\x1b[48;5;{n}m (256, via color::to_ansi256,
quantized after the fg/bg pick — pick in truecolor, degrade last),
followed by the glyph.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for CellGrid
impl<'de> Deserialize<'de> for CellGrid
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl StructuralPartialEq for CellGrid
Auto Trait Implementations§
impl Forget for CellGrid
impl Freeze for CellGrid
impl Move for CellGrid
impl RefUnwindSafe for CellGrid
impl Send for CellGridwhere
RawVecInner: Send,
impl Sync for CellGridwhere
RawVecInner: Sync,
impl Unpin for CellGrid
impl UnsafeUnpin for CellGrid
impl UnwindSafe for CellGridwhere
RawVecInner: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§unsafe fn to_subset_unchecked(&self) -> SS
unsafe fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.