Skip to main content

RotatedRenderer

Struct RotatedRenderer 

Source
pub struct RotatedRenderer<'a> { /* private fields */ }
Expand description

Renderer wrapper that applies 90° CCW rotation for platforms where the physical display is landscape but the framebuffer is portrait.

Maps logical coordinates (800×480 landscape) to framebuffer coordinates (480×800 portrait): fb_x = fb_width - logical_y - logical_height fb_y = logical_x fb_w = logical_height fb_h = logical_width

Implementations§

Source§

impl<'a> RotatedRenderer<'a>

Source

pub fn new(inner: &'a mut dyn Renderer, fb_width: u32) -> Self

Create a rotated renderer wrapping inner.

fb_width is the portrait framebuffer width (480 on STM32H747I-DISCO).

Trait Implementations§

Source§

impl Renderer for RotatedRenderer<'_>

Source§

fn fill_rect(&mut self, rect: WidgetRect, color: Color)

Fill the given rectangle with a solid color.
Source§

fn blend_rect(&mut self, rect: WidgetRect, color: Color)

Blend a rectangle onto the target, honoring the alpha channel of color for source-over compositing. Read more
Source§

fn draw_text(&mut self, position: (i32, i32), text: &str, color: Color)

Draw UTF‑8 text with its baseline anchored at the provided position using the color.
Source§

fn draw_pixels( &mut self, position: (i32, i32), pixels: &[Color], width: u32, height: u32, )

Blit a buffer of pixels to the target at the given position. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for RotatedRenderer<'a>

§

impl<'a> !RefUnwindSafe for RotatedRenderer<'a>

§

impl<'a> !Send for RotatedRenderer<'a>

§

impl<'a> !Sync for RotatedRenderer<'a>

§

impl<'a> Unpin for RotatedRenderer<'a>

§

impl<'a> UnsafeUnpin for RotatedRenderer<'a>

§

impl<'a> !UnwindSafe for RotatedRenderer<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.