Skip to main content

SpanImageFilterBase

Struct SpanImageFilterBase 

Source
pub struct SpanImageFilterBase<'a, I> { /* private fields */ }
Expand description

Base state for image filter span generators.

Holds a reference to the interpolator and optional filter LUT, plus the subpixel offset (dx, dy) applied to coordinates before filtering.

Port of C++ span_image_filter<Source, Interpolator> (without the source, which is handled by the concrete span generator).

Implementations§

Source§

impl<'a, I> SpanImageFilterBase<'a, I>

Source

pub fn new(interpolator: &'a mut I, filter: Option<&'a ImageFilterLut>) -> Self

Create a new base with interpolator, optional filter, and default 0.5 offset.

Source

pub fn interpolator(&self) -> &I

Source

pub fn interpolator_mut(&mut self) -> &mut I

Source

pub fn filter(&self) -> Option<&ImageFilterLut>

Source

pub fn filter_dx_int(&self) -> u32

Source

pub fn filter_dy_int(&self) -> u32

Source

pub fn filter_dx_dbl(&self) -> f64

Source

pub fn filter_dy_dbl(&self) -> f64

Source

pub fn set_filter_offset(&mut self, dx: f64, dy: f64)

Set the subpixel filter offset.

The offset shifts coordinates before filtering. Default is (0.5, 0.5) which centers the filter kernel on pixel centers.

Source

pub fn set_filter_offset_uniform(&mut self, d: f64)

Set equal filter offset for both axes.

Source

pub fn set_filter(&mut self, filter: &'a ImageFilterLut)

Set the filter LUT.

Source

pub fn prepare(&self)

No-op prepare (matches C++ span_image_filter::prepare()).

Auto Trait Implementations§

§

impl<'a, I> Freeze for SpanImageFilterBase<'a, I>

§

impl<'a, I> RefUnwindSafe for SpanImageFilterBase<'a, I>
where I: RefUnwindSafe,

§

impl<'a, I> Send for SpanImageFilterBase<'a, I>
where I: Send,

§

impl<'a, I> Sync for SpanImageFilterBase<'a, I>
where I: Sync,

§

impl<'a, I> Unpin for SpanImageFilterBase<'a, I>

§

impl<'a, I> !UnwindSafe for SpanImageFilterBase<'a, I>

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.