fn pixel_24(
        &self,
        x: i32,
        y: i32,
        _ctx: &ColorCtx,
        buf: &[u8],
    ) -> Option<SRgb8> {
        let offset = 3 * (y * i32::from(self.width) + x) as usize;
        let red = buf[offset];
        let green = buf[offset + 1];
        let blue = buf[offset + 2];
        if let Some(tc) = self.transparent_color {
            let rgb =
                ((red as i32) << 16) + ((green as i32) << 8) + blue as i32;
            if rgb == tc {
                return None;
            }
        }
        Some(SRgb8::new(red, green, blue))
    }
/// Get one pixel of a 24-bit color graphic
Get one pixel of a 24-bit color graphic
Get one pixel of a 24 - bit color graphic
fn pixel_24(
        &self,
        x: i32,
        y: i32,
        _ctx: &ColorCtx,
        buf: &[u8],
    ) -> Option<SRgb8> {
        let offset = 3 * (y * i32::from(self.width) + x) as usize;
        let red = buf[offset];
        let green = buf[offset + 1];
        let blue = buf[offset + 2];
        if let Some(tc) = self.transparent_color {
            let rgb =
                ((red as i32) << 16) + ((green as i32) << 8) + blue as i32;
            if rgb == tc {
                return None;
            }
        }
        Some(SRgb8::new(red, green, blue))
    }
fn pixel_24 ( & self , x : i32 , y : i32 , _ctx : & ColorCtx , buf : & [ u8 ] , ) -> Option < SRgb8 > { let offset = 3 * ( y * i32 :: from ( self . width ) + x ) as usize ; let red = buf [ offset ] ; let green = buf [ offset + 1 ] ; let blue = buf [ offset + 2 ] ; if let Some ( tc ) = self . transparent_color { let rgb = ( ( red as i32 ) << 16 ) + ( ( green as i32 ) << 8 ) + blue as i32 ; if rgb == tc { return None ; } } Some ( SRgb8 :: new ( red , green , blue ) ) }
Get one pixel of a 24-bit color graphic
Get one pixel of a 24 - bit color graphic
&self
x
i32
y
i32
_ctx
&ColorCtx
buf
&[u8]