pub struct OctPixel { /* private fields */ }Expand description
Specifies a block of pixels with dimensions 2 (width) by 4 (height).
Implementations§
Source§impl OctPixel
impl OctPixel
Sourcepub const fn character(self) -> char
pub const fn character(self) -> char
§Examples
#![allow(incomplete_features)]
#![feature(generic_const_exprs)]
use console_display::pixel::{
Pixel,
monochrome_pixel::OctPixel
};
let pixel = OctPixel::new ([
true, false, // #_
false, true, // _#
true, true, // ##
false, false // __
]);
let symbol = pixel.character();
assert_eq!(symbol, '')Trait Implementations§
Source§impl Pixel for OctPixel
impl Pixel for OctPixel
type U = bool
fn pixels(&self) -> &[bool; 8]
fn pixels_mut(&mut self) -> &mut [bool; 8]
fn new(pixels: [bool; 8]) -> OctPixel
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, )
impl Copy for OctPixel
Auto Trait Implementations§
impl Freeze for OctPixel
impl RefUnwindSafe for OctPixel
impl Send for OctPixel
impl Sync for OctPixel
impl Unpin for OctPixel
impl UnwindSafe for OctPixel
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