pub struct LineImageScale<'a, S: ImagePatternSource> { /* private fields */ }Expand description
Helper that wraps a pattern source and scales its height.
Port of C++ line_image_scale<Source>.
Uses float (Rgba) arithmetic for both branches, matching C++ exactly.
Implementations§
Source§impl<'a, S: ImagePatternSource> LineImageScale<'a, S>
impl<'a, S: ImagePatternSource> LineImageScale<'a, S>
Trait Implementations§
Source§impl<'a, S: ImagePatternSource> ImagePatternSource for LineImageScale<'a, S>
impl<'a, S: ImagePatternSource> ImagePatternSource for LineImageScale<'a, S>
Source§fn pixel(&self, x: i32, y: i32) -> Rgba8
fn pixel(&self, x: i32, y: i32) -> Rgba8
Sample the scaled pattern at (x, y).
Port of C++ line_image_scale::pixel.
Uses float (Rgba) arithmetic for both branches, matching C++ exactly:
- scale < 1.0: gradient interpolation between two rows
- scale >= 1.0: area-weighted average of multiple rows
fn width(&self) -> f64
fn height(&self) -> f64
Auto Trait Implementations§
impl<'a, S> Freeze for LineImageScale<'a, S>
impl<'a, S> RefUnwindSafe for LineImageScale<'a, S>where
S: RefUnwindSafe,
impl<'a, S> Send for LineImageScale<'a, S>where
S: Sync,
impl<'a, S> Sync for LineImageScale<'a, S>where
S: Sync,
impl<'a, S> Unpin for LineImageScale<'a, S>
impl<'a, S> UnwindSafe for LineImageScale<'a, S>where
S: RefUnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more