fn pixel_1(
        &self,
        x: i32,
        y: i32,
        ctx: &ColorCtx,
        buf: &[u8],
    ) -> Option<SRgb8> {
        let offset = y * i32::from(self.width) + x;
        let by = offset as usize / 8;
        let bi = 7 - (offset & 7);
        let lit = ((buf[by] >> bi) & 1) != 0;
        match (lit, self.transparent_color) {
            (false, Some(0)) => None,
            (true, Some(1)) => None,
            (false, _) => {
                let (red, green, blue) = ctx.rgb(ctx.background())?;
                Some(SRgb8::new(red, green, blue))
            }
            (true, _) => {
                let (red, green, blue) = ctx.rgb(ctx.foreground())?;
                Some(SRgb8::new(red, green, blue))
            }
        }
    }
/// Get one pixel of a monochrome 1-bit graphic
Get one pixel of a monochrome 1-bit graphic
Get one pixel of a monochrome 1 - bit graphic
fn pixel_1(
        &self,
        x: i32,
        y: i32,
        ctx: &ColorCtx,
        buf: &[u8],
    ) -> Option<SRgb8> {
        let offset = y * i32::from(self.width) + x;
        let by = offset as usize / 8;
        let bi = 7 - (offset & 7);
        let lit = ((buf[by] >> bi) & 1) != 0;
        match (lit, self.transparent_color) {
            (false, Some(0)) => None,
            (true, Some(1)) => None,
            (false, _) => {
                let (red, green, blue) = ctx.rgb(ctx.background())?;
                Some(SRgb8::new(red, green, blue))
            }
            (true, _) => {
                let (red, green, blue) = ctx.rgb(ctx.foreground())?;
                Some(SRgb8::new(red, green, blue))
            }
        }
    }
fn pixel_1 ( & self , x : i32 , y : i32 , ctx : & ColorCtx , buf : & [ u8 ] , ) -> Option < SRgb8 > { let offset = y * i32 :: from ( self . width ) + x ; let by = offset as usize / 8 ; let bi = 7 - ( offset & 7 ) ; let lit = ( ( buf [ by ] >> bi ) & 1 ) != 0 ; match ( lit , self . transparent_color ) { ( false , Some ( 0 ) ) => None , ( true , Some ( 1 ) ) => None , ( false , _ ) => { let ( red , green , blue ) = ctx . rgb ( ctx . background ( ) ) ? ; Some ( SRgb8 :: new ( red , green , blue ) ) } ( true , _ ) => { let ( red , green , blue ) = ctx . rgb ( ctx . foreground ( ) ) ? ; Some ( SRgb8 :: new ( red , green , blue ) ) } } }
Get one pixel of a monochrome 1-bit graphic
Get one pixel of a monochrome 1 - bit graphic
&self
x
i32
y
i32
ctx
&ColorCtx
buf
&[u8]