pub type Image = GenericImage<Gradient, MozImageRect, 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>>, Global>),
Rect(Box<MozImageRect, Global>),
PaintWorklet(PaintWorklet),
CrossFade(Box<GenericCrossFade<GenericImage<GenericGradient<LineDirection, LengthPercentage, NonNegative<CSSPixelLength>, NonNegative<LengthPercentage>, GenericPosition<LengthPercentage, LengthPercentage>, Angle, AngleOrPercentage, GenericColor<Percentage>>, MozImageRect, ComputedUrl, GenericColor<Percentage>, Percentage, Resolution>, GenericColor<Percentage>, Percentage>, Global>),
ImageSet(Box<GenericImageSet<GenericImage<GenericGradient<LineDirection, LengthPercentage, NonNegative<CSSPixelLength>, NonNegative<LengthPercentage>, GenericPosition<LengthPercentage, LengthPercentage>, Angle, AngleOrPercentage, GenericColor<Percentage>>, MozImageRect, ComputedUrl, GenericColor<Percentage>, Percentage, Resolution>, Resolution>, Global>),
}
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>>, Global>)
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.
Rect(Box<MozImageRect, Global>)
A -moz-image-rect
image. Also fairly large and rare.
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>>, MozImageRect, ComputedUrl, GenericColor<Percentage>, Percentage, Resolution>, GenericColor<Percentage>, Percentage>, Global>)
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>>, MozImageRect, ComputedUrl, GenericColor<Percentage>, Percentage, Resolution>, Resolution>, Global>)
An image-set()
function.
Trait Implementations§
source§impl<G: Clone, MozImageRect: Clone, ImageUrl: Clone, Color: Clone, Percentage: Clone, Resolution: Clone> Clone for GenericImage<G, MozImageRect, ImageUrl, Color, Percentage, Resolution>
impl<G: Clone, MozImageRect: Clone, ImageUrl: Clone, Color: Clone, Percentage: Clone, Resolution: Clone> Clone for GenericImage<G, MozImageRect, ImageUrl, Color, Percentage, Resolution>
source§fn clone(
&self
) -> GenericImage<G, MozImageRect, ImageUrl, Color, Percentage, Resolution>
fn clone( &self ) -> GenericImage<G, MozImageRect, ImageUrl, Color, Percentage, Resolution>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<G, R, U, C, P, Resolution> Debug for Image<G, R, U, C, P, Resolution>where
Image<G, R, U, C, P, Resolution>: ToCss,
impl<G, R, U, C, P, Resolution> Debug for Image<G, R, U, C, P, Resolution>where Image<G, R, U, C, P, Resolution>: ToCss,
source§impl<G, MozImageRect, ImageUrl, Color, Percentage, Resolution> MallocSizeOf for GenericImage<G, MozImageRect, ImageUrl, Color, Percentage, Resolution>where
G: MallocSizeOf,
MozImageRect: MallocSizeOf,
ImageUrl: MallocSizeOf,
Color: MallocSizeOf,
Percentage: MallocSizeOf,
Resolution: MallocSizeOf,
impl<G, MozImageRect, ImageUrl, Color, Percentage, Resolution> MallocSizeOf for GenericImage<G, MozImageRect, ImageUrl, Color, Percentage, Resolution>where G: MallocSizeOf, MozImageRect: MallocSizeOf, ImageUrl: MallocSizeOf, Color: MallocSizeOf, Percentage: MallocSizeOf, Resolution: MallocSizeOf,
source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
Measure the heap usage of all descendant heap-allocated structures, but
not the space taken up by the value itself.
source§impl<G: PartialEq, MozImageRect: PartialEq, ImageUrl: PartialEq, Color: PartialEq, Percentage: PartialEq, Resolution: PartialEq> PartialEq<GenericImage<G, MozImageRect, ImageUrl, Color, Percentage, Resolution>> for GenericImage<G, MozImageRect, ImageUrl, Color, Percentage, Resolution>
impl<G: PartialEq, MozImageRect: PartialEq, ImageUrl: PartialEq, Color: PartialEq, Percentage: PartialEq, Resolution: PartialEq> PartialEq<GenericImage<G, MozImageRect, ImageUrl, Color, Percentage, Resolution>> for GenericImage<G, MozImageRect, ImageUrl, Color, Percentage, Resolution>
source§fn eq(
&self,
other: &GenericImage<G, MozImageRect, ImageUrl, Color, Percentage, Resolution>
) -> bool
fn eq( &self, other: &GenericImage<G, MozImageRect, ImageUrl, Color, Percentage, Resolution> ) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<G, MozImageRect, ImageUrl, Color, Percentage, Resolution> SpecifiedValueInfo for GenericImage<G, MozImageRect, ImageUrl, Color, Percentage, Resolution>where
G: SpecifiedValueInfo,
MozImageRect: SpecifiedValueInfo,
ImageUrl: SpecifiedValueInfo,
Color: SpecifiedValueInfo,
Percentage: SpecifiedValueInfo,
Resolution: SpecifiedValueInfo,
impl<G, MozImageRect, ImageUrl, Color, Percentage, Resolution> SpecifiedValueInfo for GenericImage<G, MozImageRect, ImageUrl, Color, Percentage, Resolution>where G: SpecifiedValueInfo, MozImageRect: SpecifiedValueInfo, ImageUrl: SpecifiedValueInfo, Color: SpecifiedValueInfo, Percentage: SpecifiedValueInfo, Resolution: SpecifiedValueInfo,
source§const SUPPORTED_TYPES: u8 = _
const SUPPORTED_TYPES: u8 = _
Supported CssTypes by the given value type. Read more
source§impl ToAnimatedValue for Image
impl ToAnimatedValue for Image
§type AnimatedValue = GenericImage<GenericGradient<LineDirection, LengthPercentage, NonNegative<CSSPixelLength>, NonNegative<LengthPercentage>, GenericPosition<LengthPercentage, LengthPercentage>, Angle, AngleOrPercentage, GenericColor<Percentage>>, MozImageRect, ComputedUrl, GenericColor<Percentage>, Percentage, Resolution>
type AnimatedValue = GenericImage<GenericGradient<LineDirection, LengthPercentage, NonNegative<CSSPixelLength>, NonNegative<LengthPercentage>, GenericPosition<LengthPercentage, LengthPercentage>, Angle, AngleOrPercentage, GenericColor<Percentage>>, MozImageRect, ComputedUrl, GenericColor<Percentage>, Percentage, Resolution>
The type of the animated value.
source§fn to_animated_value(self) -> Self
fn to_animated_value(self) -> 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.
source§impl<G, MozImageRect, ImageUrl, Color, Percentage, Resolution> ToComputedValue for GenericImage<G, MozImageRect, ImageUrl, Color, Percentage, Resolution>where
G: ToComputedValue,
MozImageRect: ToComputedValue,
ImageUrl: ToComputedValue,
Color: ToComputedValue,
Percentage: ToComputedValue,
Resolution: ToComputedValue,
Box<GenericImageSet<Self, Resolution>>: ToComputedValue<ComputedValue = Box<GenericImageSet<GenericImage<<G as ToComputedValue>::ComputedValue, <MozImageRect as ToComputedValue>::ComputedValue, <ImageUrl as ToComputedValue>::ComputedValue, <Color as ToComputedValue>::ComputedValue, <Percentage as ToComputedValue>::ComputedValue, <Resolution as ToComputedValue>::ComputedValue>, <Resolution as ToComputedValue>::ComputedValue>>>,
impl<G, MozImageRect, ImageUrl, Color, Percentage, Resolution> ToComputedValue for GenericImage<G, MozImageRect, ImageUrl, Color, Percentage, Resolution>where G: ToComputedValue, MozImageRect: ToComputedValue, ImageUrl: ToComputedValue, Color: ToComputedValue, Percentage: ToComputedValue, Resolution: ToComputedValue, Box<GenericImageSet<Self, Resolution>>: ToComputedValue<ComputedValue = Box<GenericImageSet<GenericImage<<G as ToComputedValue>::ComputedValue, <MozImageRect as ToComputedValue>::ComputedValue, <ImageUrl as ToComputedValue>::ComputedValue, <Color as ToComputedValue>::ComputedValue, <Percentage as ToComputedValue>::ComputedValue, <Resolution as ToComputedValue>::ComputedValue>, <Resolution as ToComputedValue>::ComputedValue>>>,
§type ComputedValue = GenericImage<<G as ToComputedValue>::ComputedValue, <MozImageRect as ToComputedValue>::ComputedValue, <ImageUrl as ToComputedValue>::ComputedValue, <Color as ToComputedValue>::ComputedValue, <Percentage as ToComputedValue>::ComputedValue, <Resolution as ToComputedValue>::ComputedValue>
type ComputedValue = GenericImage<<G as ToComputedValue>::ComputedValue, <MozImageRect as ToComputedValue>::ComputedValue, <ImageUrl as ToComputedValue>::ComputedValue, <Color as ToComputedValue>::ComputedValue, <Percentage as ToComputedValue>::ComputedValue, <Resolution as ToComputedValue>::ComputedValue>
The computed value type we’re going to be converted to.
source§fn from_computed_value(from: &Self::ComputedValue) -> Self
fn from_computed_value(from: &Self::ComputedValue) -> Self
Convert a computed value to specified value form. Read more
source§fn to_computed_value(&self, context: &Context<'_>) -> Self::ComputedValue
fn to_computed_value(&self, context: &Context<'_>) -> Self::ComputedValue
Convert a specified value to a computed value, using itself and the data
inside the
Context
.source§impl<G, R, U, C, P, Resolution> ToCss for Image<G, R, U, C, P, Resolution>where
G: ToCss,
R: ToCss,
U: ToCss,
C: ToCss,
P: ToCss,
Resolution: ToCss,
impl<G, R, U, C, P, Resolution> ToCss for Image<G, R, U, C, P, Resolution>where G: ToCss, R: ToCss, U: ToCss, C: ToCss, P: ToCss, Resolution: ToCss,
source§impl<G, MozImageRect, ImageUrl, Color, Percentage, Resolution> ToResolvedValue for GenericImage<G, MozImageRect, ImageUrl, Color, Percentage, Resolution>where
G: ToResolvedValue,
MozImageRect: ToResolvedValue,
ImageUrl: ToResolvedValue,
Color: ToResolvedValue,
Percentage: ToResolvedValue,
Resolution: ToResolvedValue,
impl<G, MozImageRect, ImageUrl, Color, Percentage, Resolution> ToResolvedValue for GenericImage<G, MozImageRect, ImageUrl, Color, Percentage, Resolution>where G: ToResolvedValue, MozImageRect: ToResolvedValue, ImageUrl: ToResolvedValue, Color: ToResolvedValue, Percentage: ToResolvedValue, Resolution: ToResolvedValue,
§type ResolvedValue = GenericImage<<G as ToResolvedValue>::ResolvedValue, <MozImageRect as ToResolvedValue>::ResolvedValue, <ImageUrl as ToResolvedValue>::ResolvedValue, <Color as ToResolvedValue>::ResolvedValue, <Percentage as ToResolvedValue>::ResolvedValue, <Resolution as ToResolvedValue>::ResolvedValue>
type ResolvedValue = GenericImage<<G as ToResolvedValue>::ResolvedValue, <MozImageRect as ToResolvedValue>::ResolvedValue, <ImageUrl as ToResolvedValue>::ResolvedValue, <Color as ToResolvedValue>::ResolvedValue, <Percentage as ToResolvedValue>::ResolvedValue, <Resolution as ToResolvedValue>::ResolvedValue>
The resolved value type we’re going to be converted to.
source§fn from_resolved_value(from: Self::ResolvedValue) -> Self
fn from_resolved_value(from: Self::ResolvedValue) -> Self
Convert a resolved value to resolved value form.
source§fn to_resolved_value(self, context: &Context<'_>) -> Self::ResolvedValue
fn to_resolved_value(self, context: &Context<'_>) -> Self::ResolvedValue
Convert a resolved value to a resolved value.