pub struct Display<const WIDTH: u32, const HEIGHT: u32, const BWRBIT: bool, const BYTECOUNT: usize, COLOR: ColorType + PixelColor> { /* private fields */ }Expand description
Display buffer used for drawing with embedded graphics This can be rendered on EPD using …
- WIDTH: width in pixel when display is not rotated
- HEIGHT: height in pixel when display is not rotated
- BWRBIT: mandatory value of the B/W when chromatic bit is set, can be any value for non tricolor epd
- COLOR: color type used by the target display
- BYTECOUNT: This is redundant with previous data and should be removed when const generic expressions are stabilized
More on BWRBIT:
Different chromatic displays differently treat the bits in chromatic color planes.
Some of them (crate::epd2in13bc) will render a color pixel if bit is set for that pixel,
which is a BWRBIT = true mode.
Other displays, like crate::epd5in83b_v2 in opposite, will draw color pixel if bit is
cleared for that pixel, which is a BWRBIT = false mode.
BWRBIT=true: chromatic doesn’t override white, white bit cleared for black, white bit set for white, both bits set for chromatic BWRBIT=false: chromatic does override white, both bits cleared for black, white bit set for white, red bit set for black
Implementations§
Source§impl<const WIDTH: u32, const HEIGHT: u32, const BWRBIT: bool, const BYTECOUNT: usize, COLOR: ColorType + PixelColor> Display<WIDTH, HEIGHT, BWRBIT, BYTECOUNT, COLOR>
impl<const WIDTH: u32, const HEIGHT: u32, const BWRBIT: bool, const BYTECOUNT: usize, COLOR: ColorType + PixelColor> Display<WIDTH, HEIGHT, BWRBIT, BYTECOUNT, COLOR>
Sourcepub fn set_rotation(&mut self, rotation: DisplayRotation)
pub fn set_rotation(&mut self, rotation: DisplayRotation)
Set the display rotation.
This only concerns future drawing made to it. Anything aready drawn stays as it is in the buffer.
Sourcepub fn rotation(&self) -> DisplayRotation
pub fn rotation(&self) -> DisplayRotation
Get current rotation
Trait Implementations§
Source§impl<const WIDTH: u32, const HEIGHT: u32, const BWRBIT: bool, const BYTECOUNT: usize, COLOR: ColorType + PixelColor> Default for Display<WIDTH, HEIGHT, BWRBIT, BYTECOUNT, COLOR>
impl<const WIDTH: u32, const HEIGHT: u32, const BWRBIT: bool, const BYTECOUNT: usize, COLOR: ColorType + PixelColor> Default for Display<WIDTH, HEIGHT, BWRBIT, BYTECOUNT, COLOR>
Source§fn default() -> Self
fn default() -> Self
Initialize display with the color ‘0’, which may not be the same on all device. Many devices have a bit parameter polarity that should be changed if this is not the right one. However, every device driver should implement a DEFAULT_COLOR constant to indicate which color this represents (TODO)
If you want a specific default color, you can still call clear() to set one.
Source§impl<const WIDTH: u32, const HEIGHT: u32, const BWRBIT: bool, const BYTECOUNT: usize, COLOR: ColorType + PixelColor> DrawTarget for Display<WIDTH, HEIGHT, BWRBIT, BYTECOUNT, COLOR>
For use with embedded_grahics
impl<const WIDTH: u32, const HEIGHT: u32, const BWRBIT: bool, const BYTECOUNT: usize, COLOR: ColorType + PixelColor> DrawTarget for Display<WIDTH, HEIGHT, BWRBIT, BYTECOUNT, COLOR>
For use with embedded_grahics