TrimColor

Structin image_optimizerfastly 0.13.1View source
pub struct TrimColor {
pub color: HexColor,
pub threshold: f32,
}

Identify a rectangular border based on specified color and remove this border from the edges of an image.

Fields

Indicates what color to trim off.

threshold

f32

An optional number between 0 and 1 indicating how different a color can be from the given trim color and still be trimmed.

This can be used if the background that is being trimmed is not uniform (all one color). Setting it to 1 will trim everything, as 1 is the largest possible color difference.

Trait implementations

impl Clone for TrimColor

fn clone(&self) -> Self

Parameters

self: &Self

Returns

Self

impl Debug for TrimColor

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

Parameters

self: &Self
f: &mut $crate::fmt::Formatter

Returns

$crate::fmt::Result

impl Serialize for TrimColor

serialize

View source
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: Serializer,

Parameters

self: &Self
serializer: S

Returns

Result<S::Ok, S::Error>

Auto trait implementations

Blanket implementations