pub struct CharacterPixel { /* private fields */ }Implementations§
Source§impl CharacterPixel
impl CharacterPixel
Sourcepub fn new<const CHARACTER: char>(
foreground: TerminalColor,
background: TerminalColor,
) -> Self
pub fn new<const CHARACTER: char>( foreground: TerminalColor, background: TerminalColor, ) -> Self
Constructs a character pixel from a char, a foreground and a background color.
§Panics
This function checks for control characters at compile time. Panics when the compile time checks miss a control character. This should not happen and is a implementation detail that is subject to change.
Sourcepub fn build(
character: char,
foreground: TerminalColor,
background: TerminalColor,
) -> Result<Self, String>
pub fn build( character: char, foreground: TerminalColor, background: TerminalColor, ) -> Result<Self, String>
Constructs a character pixel from a char, a foreground and a background color.
§Errors
Returns an error if the character is a control character.
pub const fn make_copy(&self) -> Self
pub const fn character(&self) -> char
pub const fn foreground(&self) -> TerminalColor
pub const fn background(&self) -> TerminalColor
pub const fn is_copy(&self) -> bool
pub const fn width(&self) -> usize
Trait Implementations§
Source§impl Clone for CharacterPixel
impl Clone for CharacterPixel
Source§fn clone(&self) -> CharacterPixel
fn clone(&self) -> CharacterPixel
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CharacterPixel
impl Debug for CharacterPixel
Source§impl Default for CharacterPixel
impl Default for CharacterPixel
Source§fn default() -> CharacterPixel
fn default() -> CharacterPixel
Returns the “default value” for a type. Read more
Source§impl Display for CharacterPixel
impl Display for CharacterPixel
Source§impl<const WIDTH: usize, const HEIGHT: usize> DynamicCanvas<CharacterPixel> for StaticCharacterDisplay<CharacterPixel, WIDTH, HEIGHT>
impl<const WIDTH: usize, const HEIGHT: usize> DynamicCanvas<CharacterPixel> for StaticCharacterDisplay<CharacterPixel, WIDTH, HEIGHT>
type A = usize
Source§fn pixel(&self, x: Self::A, y: Self::A) -> Result<CharacterPixelData, String>
fn pixel(&self, x: Self::A, y: Self::A) -> Result<CharacterPixelData, String>
Returns a bool representing the state of the pixel at the specified coordinate. Read more
Source§impl DynamicConsoleDisplay<CharacterPixel> for DynamicCharacterDisplay<CharacterPixel>
impl DynamicConsoleDisplay<CharacterPixel> for DynamicCharacterDisplay<CharacterPixel>
Source§fn width(&self) -> usize
fn width(&self) -> usize
Returns the width of the display in a display specific, individually addressable unit (e.g. pixels, characters).
Source§fn height(&self) -> usize
fn height(&self) -> usize
Returns the height of the display in a display specific, individually addressable unit (e.g. pixels, characters).
fn data(&self) -> &[CharacterPixel]
fn data_mut(&mut self) -> &mut Box<[CharacterPixel]>
Source§impl<const WIDTH: usize, const HEIGHT: usize> DynamicConsoleDisplay<CharacterPixel> for StaticCharacterDisplay<CharacterPixel, WIDTH, HEIGHT>
impl<const WIDTH: usize, const HEIGHT: usize> DynamicConsoleDisplay<CharacterPixel> for StaticCharacterDisplay<CharacterPixel, WIDTH, HEIGHT>
Source§fn width(&self) -> usize
fn width(&self) -> usize
Returns the width of the display in a display specific, individually addressable unit (e.g. pixels, characters).
Source§fn height(&self) -> usize
fn height(&self) -> usize
Returns the height of the display in a display specific, individually addressable unit (e.g. pixels, characters).
fn data(&self) -> &[CharacterPixel]
fn data_mut(&mut self) -> &mut Box<[CharacterPixel]>
Source§impl From<CharacterPixel> for CharacterPixelData
impl From<CharacterPixel> for CharacterPixelData
Source§fn from(value: CharacterPixel) -> Self
fn from(value: CharacterPixel) -> Self
Converts to this type from the input type.
Source§impl From<CharacterPixel> for DataCell
impl From<CharacterPixel> for DataCell
Source§fn from(val: CharacterPixel) -> Self
fn from(val: CharacterPixel) -> Self
Converts to this type from the input type.
Source§impl Pixel for CharacterPixel
impl Pixel for CharacterPixel
type U = CharacterPixelData
fn pixels(&self) -> &[Self::U; 1]
fn pixels_mut(&mut self) -> &mut [Self::U; 1]
fn new(pixels: [Self::U; 1]) -> Self
Source§fn subpixel(&self, x: usize, y: usize) -> Result<Self::U, String>
fn subpixel(&self, x: usize, y: usize) -> Result<Self::U, String>
Returns the value of the block at the specified coordinates. Read more
Source§fn set_subpixel(
&mut self,
x: usize,
y: usize,
value: Self::U,
) -> Result<(), String>
fn set_subpixel( &mut self, x: usize, y: usize, value: Self::U, ) -> Result<(), String>
Returns the value of the block at the specified coordinates. Read more
Source§fn build(args: &[Self::U]) -> Result<Self, String>
fn build(args: &[Self::U]) -> Result<Self, String>
Builds a block of pixels from a slice of pixels. Read more
fn subpixel_static<const X: usize, const Y: usize>(&self) -> Self::U
fn set_subpixel_static<const X: usize, const Y: usize>( &mut self, value: Self::U, )
Source§impl<const WIDTH: usize, const HEIGHT: usize> StaticConsoleDisplay<CharacterPixel> for StaticCharacterDisplay<CharacterPixel, WIDTH, HEIGHT>
impl<const WIDTH: usize, const HEIGHT: usize> StaticConsoleDisplay<CharacterPixel> for StaticCharacterDisplay<CharacterPixel, WIDTH, HEIGHT>
Source§impl TryFrom<char> for CharacterPixel
impl TryFrom<char> for CharacterPixel
impl Copy for CharacterPixel
Auto Trait Implementations§
impl Freeze for CharacterPixel
impl RefUnwindSafe for CharacterPixel
impl Send for CharacterPixel
impl Sync for CharacterPixel
impl Unpin for CharacterPixel
impl UnwindSafe for CharacterPixel
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