[][src]Struct signed_distance_field::distance_field::NormalizedDistanceField

pub struct NormalizedDistanceField<D: DistanceStorage> {
    pub width: u16,
    pub height: u16,
    pub distances: D,
    pub zero_distance: f32,
    pub former_min_distance: f32,
    pub former_max_distance: f32,
}

Represents a distance field which was normalized to the range [0, 1]. Also contains information about the greatest distances of the unnormalized distance field.

Fields

width: u16height: u16distances: D

All distances are in the range of [0..1].

zero_distance: f32

In the original distance field, edges are represented by a distance of zero. Normalizing the distance field will result in edges no longer being zero. The normalized field will have edges somewhere between zero and one. This float describes the new value that edges in the normalized field have.

former_min_distance: f32

The largest distance in the image to the nearest edge outside of a shape .

former_max_distance: f32

The largest distance in the image to the nearest edge inside of a shape

Methods

impl<D> NormalizedDistanceField<D> where
    D: DistanceStorage
[src]

pub fn from_distance_field(distance_field: SignedDistanceField<D>) -> Self[src]

Scales all distances such that the smallest distance is zero and the largest is one. Also computes the former minimum and maximum distance, as well as the new edge-value.

Auto Trait Implementations

impl<D> Send for NormalizedDistanceField<D> where
    D: Send

impl<D> Sync for NormalizedDistanceField<D> where
    D: Sync

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]