Trait ws2812_flexio::Pixel

source ·
pub trait Pixel {
    type BytesIter: Iterator<Item = u8>;

    // Required method
    fn into_ws2812_bytes(self) -> Self::BytesIter;
}
Expand description

A pixel that can be rendered with this library.

Required Associated Types§

source

type BytesIter: Iterator<Item = u8>

The return type of the into_ws2812_bytes() function.

Required Methods§

source

fn into_ws2812_bytes(self) -> Self::BytesIter

Return the raw bytes that should be sent to the LED strip.

IMPORTANT: Be aware that WS2812 strips are GRB encoded.

Implementations on Foreign Types§

source§

impl Pixel for [u8; 3]

Raw RGB data.

source§

impl Pixel for LinSrgb<u8>

8-bit Linear sRGB, which is the color space most NeoPixel strips are in.

Be aware that this differs from normal, gamma-corrected sRGB. A conversion has to take place.

More info can be found in the documentation of the palette crate.

source§

impl<'a, P> Pixel for &'a Pwhere P: Pixel + Clone,

source§

impl Pixel for [u8; 4]

Raw RGBW data.

Implementors§