Skip to main content

SubSink

Struct SubSink 

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

Offset + bounded wrapper around another EffectSink.

All ops are translated by offset before being forwarded to the inner sink, and target_width / target_height report the clipped sub-region. Used by widget-tree hosts (e.g. rlvgl_widgets::motion::crawl::CrawlWindow) to place an effect at a specific screen location without rewriting every op coordinate inside the effect. No byte-level clipping — the effect is expected to respect the reported target dimensions; the wrapper doesn’t intersect rectangles with the sub-region.

Implementations§

Source§

impl<'a> SubSink<'a>

Source

pub fn new( inner: &'a mut dyn EffectSink, offset: (i32, i32), width: u32, height: u32, ) -> Self

Build a sub-sink over inner at offset with (width, height) as the reported target size.

Trait Implementations§

Source§

impl<'a> EffectSink for SubSink<'a>

Source§

fn target_width(&self) -> u32

Destination width in pixels as the sink sees it. Effects use this to size per-frame work (number of rows to blend, clipping).
Source§

fn target_height(&self) -> u32

Destination height in pixels as the sink sees it.
Source§

fn target_format(&self) -> PixelFmt

Destination pixel format. Effects that only support a subset (e.g. ARGB8888) can bail early without emitting ops.
Source§

fn fill(&mut self, rect: Rect, color: u32)

Fill rect on the destination with a solid ARGB8888 colour.
Source§

fn blit(&mut self, src: &Surface<'_>, src_area: Rect, dst_pos: (i32, i32))

Copy src_area from src to dst_pos on the destination. Read more
Source§

fn blend_a8_row(&mut self, alphas: &[u8], dst_pos: (i32, i32), fg_color: u32)

Alpha-blend a single A8 row onto the destination with a fixed foreground colour. Read more

Auto Trait Implementations§

§

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

§

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

§

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

§

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

§

impl<'a> Freeze for SubSink<'a>

§

impl<'a> Unpin for SubSink<'a>

§

impl<'a> UnsafeUnpin for SubSink<'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.