Skip to main content

Pyramid

Struct Pyramid 

Source
pub struct Pyramid {
    pub dims: [usize; 3],
    pub lens: Vec<[usize; 3]>,
    pub split: Vec<[bool; 3]>,
    pub bands: Vec<Band>,
}
Expand description

The dyadic pyramid for a shape.

Fields§

§dims: [usize; 3]

Shape (3D, row-major, axis 2 fastest).

§lens: Vec<[usize; 3]>

lens[l] = LL extent entering level l (lens[0] = dims).

§split: Vec<[bool; 3]>

split[l][a]: axis a is transformed at level l.

§bands: Vec<Band>

Bands in coding order: LL first, then detail bands coarse → fine.

Implementations§

Source§

impl Pyramid

Source

pub fn new(dims: [usize; 3], max_levels: usize) -> Self

Build the pyramid for dims with at most max_levels levels.

Source

pub fn nlev(&self) -> usize

Number of levels.

Source

pub fn len(&self) -> usize

Total cells.

Source

pub fn is_empty(&self) -> bool

Whether the shape is empty.

Source

pub fn band_weight(&self, band: &Band) -> f64

L2 norm of the CDF 9/7 synthesis basis function of a coefficient in band (separable product of 1D norms). Scaling coefficients by it makes one uniform step equal-slope (MSE-matched) across bands.

Source

pub fn parent_band(&self, bi: usize) -> Option<usize>

The coarser-level coefficient (“parent”) of position p in detail band bi: same orientation one level up, or None if that band does not exist (coarsest detail level, or the axis set stops splitting).

Source

pub fn parent_pos(&self, b: &Band, pb: &Band, p: [usize; 3]) -> [usize; 3]

Map a position in band b to its parent position in band pb.

Trait Implementations§

Source§

impl Clone for Pyramid

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
Source§

impl Debug for Pyramid

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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> ByRef<T> for T

Source§

fn by_ref(&self) -> &T

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> Imply<T> for U
where T: ?Sized, U: ?Sized,

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.