pub type Image = GenericImage<Gradient, ComputedImageUrl, Color, Percentage, Resolution>;
Expand description
Computed values for an image according to CSS-IMAGES. https://drafts.csswg.org/css-images/#image-values
Aliased Type§
enum Image {
None,
Url(ComputedUrl),
Gradient(Box<GenericGradient<LineDirection, LengthPercentage, NonNegative<CSSPixelLength>, NonNegative<LengthPercentage>, GenericPosition<LengthPercentage, LengthPercentage>, Angle, AngleOrPercentage, GenericColor<Percentage>>>),
PaintWorklet(PaintWorklet),
CrossFade(Box<GenericCrossFade<GenericImage<GenericGradient<LineDirection, LengthPercentage, NonNegative<CSSPixelLength>, NonNegative<LengthPercentage>, GenericPosition<LengthPercentage, LengthPercentage>, Angle, AngleOrPercentage, GenericColor<Percentage>>, ComputedUrl, GenericColor<Percentage>, Percentage, Resolution>, GenericColor<Percentage>, Percentage>>),
ImageSet(Box<GenericImageSet<GenericImage<GenericGradient<LineDirection, LengthPercentage, NonNegative<CSSPixelLength>, NonNegative<LengthPercentage>, GenericPosition<LengthPercentage, LengthPercentage>, Angle, AngleOrPercentage, GenericColor<Percentage>>, ComputedUrl, GenericColor<Percentage>, Percentage, Resolution>, Resolution>>),
}
Variants§
None
none
variant.
Url(ComputedUrl)
A <url()>
image.
Gradient(Box<GenericGradient<LineDirection, LengthPercentage, NonNegative<CSSPixelLength>, NonNegative<LengthPercentage>, GenericPosition<LengthPercentage, LengthPercentage>, Angle, AngleOrPercentage, GenericColor<Percentage>>>)
A <gradient>
image. Gradients are rather large, and not nearly as
common as urls, so we box them here to keep the size of this enum sane.
PaintWorklet(PaintWorklet)
A paint worklet image. https://drafts.css-houdini.org/css-paint-api/
CrossFade(Box<GenericCrossFade<GenericImage<GenericGradient<LineDirection, LengthPercentage, NonNegative<CSSPixelLength>, NonNegative<LengthPercentage>, GenericPosition<LengthPercentage, LengthPercentage>, Angle, AngleOrPercentage, GenericColor<Percentage>>, ComputedUrl, GenericColor<Percentage>, Percentage, Resolution>, GenericColor<Percentage>, Percentage>>)
A <cross-fade()>
image. Storing this directly inside of
GenericImage increases the size by 8 bytes so we box it here
and store images directly inside of cross-fade instead of
boxing them there.
ImageSet(Box<GenericImageSet<GenericImage<GenericGradient<LineDirection, LengthPercentage, NonNegative<CSSPixelLength>, NonNegative<LengthPercentage>, GenericPosition<LengthPercentage, LengthPercentage>, Angle, AngleOrPercentage, GenericColor<Percentage>>, ComputedUrl, GenericColor<Percentage>, Percentage, Resolution>, Resolution>>)
An image-set()
function.
Trait Implementations§
source§impl ToAnimatedValue for Image
impl ToAnimatedValue for Image
source§type AnimatedValue = GenericImage<GenericGradient<LineDirection, LengthPercentage, NonNegative<CSSPixelLength>, NonNegative<LengthPercentage>, GenericPosition<LengthPercentage, LengthPercentage>, Angle, AngleOrPercentage, GenericColor<Percentage>>, ComputedUrl, GenericColor<Percentage>, Percentage, Resolution>
type AnimatedValue = GenericImage<GenericGradient<LineDirection, LengthPercentage, NonNegative<CSSPixelLength>, NonNegative<LengthPercentage>, GenericPosition<LengthPercentage, LengthPercentage>, Angle, AngleOrPercentage, GenericColor<Percentage>>, ComputedUrl, GenericColor<Percentage>, Percentage, Resolution>
The type of the animated value.
source§fn to_animated_value(self, _: &Context<'_>) -> Self
fn to_animated_value(self, _: &Context<'_>) -> Self
Converts this value to an animated value.
source§fn from_animated_value(animated: Self::AnimatedValue) -> Self
fn from_animated_value(animated: Self::AnimatedValue) -> Self
Converts back an animated value into a computed value.