pub struct Pattern { /* private fields */ }Expand description
A pattern of 8 × 8 pixels: one of the Base patterns, or one of
them inverted. A pattern map spells it Dither50 or
Inverted(Dither50).
Implementations§
Source§impl Pattern
impl Pattern
Sourcepub const fn is_inverted(self) -> bool
pub const fn is_inverted(self) -> bool
Whether it is its base inverted.
Sourcepub fn rows(self) -> [u8; 8]
pub fn rows(self) -> [u8; 8]
Its rows, fixed to the screen: screen pixel (x, y) takes bit
x % 8 of row y % 8.
Sourcepub const fn black_pixels(self) -> u32
pub const fn black_pixels(self) -> u32
How many of its 64 pixels are black.
Sourcepub fn looks_like(self, other: Pattern) -> bool
pub fn looks_like(self, other: Pattern) -> bool
Whether the two look the same on a screen: one’s pixels are the
other’s moved (Dither50 and Inverted(Dither50) are both a
one-pixel checker, one pixel apart).
Trait Implementations§
impl Copy for Pattern
Source§impl<'de> Deserialize<'de> for Pattern
impl<'de> Deserialize<'de> for Pattern
Source§fn deserialize<D>(
deserializer: D,
) -> Result<Pattern, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<Pattern, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Pattern
Source§impl Ord for Pattern
impl Ord for Pattern
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for Pattern
impl PartialOrd for Pattern
Source§impl Serialize for Pattern
impl Serialize for Pattern
Source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for Pattern
Auto Trait Implementations§
impl Freeze for Pattern
impl RefUnwindSafe for Pattern
impl Send for Pattern
impl Sync for Pattern
impl Unpin for Pattern
impl UnsafeUnpin for Pattern
impl UnwindSafe for Pattern
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