pub trait SDFTrait {
    type Image: GenericImage;
    type ColoredOutput: GenericImage;

    fn from_image(image: Self::Image, range: f64, mid_value: f32) -> Self;
    fn to_image(self) -> Self::Image;
    fn image(&self) -> &Self::Image;
    fn range(&self) -> f64;
    fn mid_value(&self) -> f32;
    fn render(&self, width: u32, height: u32) -> GrayFImage;
    fn render_colored(&self, width: u32, height: u32) -> Self::ColoredOutput;
Expand description

Trait for various types of SDFs. Can be converted to an image, or rendered with SDFTrait::render / SDFTrait::render_colored.

Required Associated Types

Required Methods

Create an SDF from an image.

Convert an SDF to an image.

Get SDF image.

Get SDF range.

Get SDF mid-value.

Render this SDF to a single-channel float image of specified size.

Render this SDF to a multi-channel float image of specified size. Colors represent MSDF edge colors.