pub struct HalfBlockImage {
pub width: u32,
pub height: u32,
pub pixels: Vec<(Color, Color)>,
}Expand description
A terminal-renderable image stored as a grid of Color values.
Each cell contains a foreground color (upper pixel) and background color
(lower pixel), rendered using the ▀ half-block character.
Create from an [image::DynamicImage] with [HalfBlockImage::from_dynamic]
(requires image feature), or construct manually from raw RGB data with
HalfBlockImage::from_rgb.
Fields§
§width: u32Width in terminal columns.
height: u32Height in terminal rows (each row = 2 image pixels).
pixels: Vec<(Color, Color)>Row-major pairs of (upper_color, lower_color) for each cell.
Implementations§
Auto Trait Implementations§
impl Freeze for HalfBlockImage
impl RefUnwindSafe for HalfBlockImage
impl Send for HalfBlockImage
impl Sync for HalfBlockImage
impl Unpin for HalfBlockImage
impl UnsafeUnpin for HalfBlockImage
impl UnwindSafe for HalfBlockImage
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