Skip to main content

Kern

Struct Kern 

Source
pub struct Kern {
    pub typ: u32,
    pub halo: i32,
    pub n: i32,
    pub w: [i16; 256],
    pub h: [i32; 8],
}
Expand description

a separable 1-D kernel (KERN)

Fields§

§typ: u32§halo: i32§n: i32§w: [i16; 256]§h: [i32; 8]

Implementations§

Source§

impl Kern

Source

pub fn copy() -> Kern

the identity

Source

pub fn boxk(h: i32) -> Kern

one box of width 2h + 1 (h <= 0: identity) [fxc_kern_box]

Source

pub fn gauss(var12: i32) -> Kern

Gaussian with 12 sigma^2 = var12 (<= 0: identity) [fxc_kern_gauss] FIR (var12 <= 432): h = ceil(sqrt(0.75 var12)) (1..18), g_i = exp(-6 i^2 / var12), sum = g_0 + 2 g_1 + …, q_i = trunc(g_i (16384 / sum) + 0.5), the centre absorbs 16384 - (q_0 + 2 sum q_i). Boxes: wl = largest odd w with 3 w^2 <= var12 + 3, m = (2 num + den) / (2 den) (num = 3 wl^2 + 12 wl + 9 - var12, den = 4 wl + 4, m <= 3): m boxes of width wl, then 3 - m of wl + 2.

Trait Implementations§

Source§

impl Clone for Kern

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

impl Forget for Kern

§

impl Freeze for Kern

§

impl RefUnwindSafe for Kern

§

impl Send for Kern

§

impl Sync for Kern

§

impl Unpin for Kern

§

impl UnsafeUnpin for Kern

§

impl UnwindSafe for Kern

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.