Skip to main content

SpanPatternRgba

Struct SpanPatternRgba 

Source
pub struct SpanPatternRgba<Src> { /* private fields */ }
Expand description

RGBA span pattern generator — fills spans from a tiled source image.

Port of C++ span_pattern_rgba<Source>. Reads pixels from the attached ImageSource, applying x/y offsets for pattern positioning.

Implementations§

Source§

impl<Src: ImageSource> SpanPatternRgba<Src>

Source

pub fn new(src: Src, offset_x: u32, offset_y: u32) -> Self

Source

pub fn source(&self) -> &Src

Source

pub fn source_mut(&mut self) -> &mut Src

Source

pub fn offset_x(&self) -> u32

Source

pub fn set_offset_x(&mut self, v: u32)

Source

pub fn offset_y(&self) -> u32

Source

pub fn set_offset_y(&mut self, v: u32)

Trait Implementations§

Source§

impl<Src: ImageSource> SpanGenerator for SpanPatternRgba<Src>

Source§

type Color = Rgba8

Source§

fn prepare(&mut self)

Called once before rendering begins.
Source§

fn generate(&mut self, span: &mut [Rgba8], x: i32, y: i32, len: u32)

Generate colors for a horizontal span. Read more

Auto Trait Implementations§

§

impl<Src> Freeze for SpanPatternRgba<Src>
where Src: Freeze,

§

impl<Src> RefUnwindSafe for SpanPatternRgba<Src>
where Src: RefUnwindSafe,

§

impl<Src> Send for SpanPatternRgba<Src>
where Src: Send,

§

impl<Src> Sync for SpanPatternRgba<Src>
where Src: Sync,

§

impl<Src> Unpin for SpanPatternRgba<Src>
where Src: Unpin,

§

impl<Src> UnsafeUnpin for SpanPatternRgba<Src>
where Src: UnsafeUnpin,

§

impl<Src> UnwindSafe for SpanPatternRgba<Src>
where Src: UnwindSafe,

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.