pub struct Image(/* private fields */);Expand description
An Image value, not yet erased to a view.
The same reason super::Shape exists: Image.resizable(_:_:) and
.renderingMode(_:) are methods on Image that return an Image, so
they are not view modifiers and an AnyView cannot be their receiver. An
Image is one word, so it travels in a register both ways.
Implementations§
Source§impl Image
impl Image
Sourcepub fn system_variable(name: &str, value: Option<f64>) -> Self
pub fn system_variable(name: &str, value: Option<f64>) -> Self
Image(systemName:variableValue:) — a symbol drawn at a fill level.
The Double? does not travel in a float register. It goes as its raw
bits in an integer register with the tag in the next one, which is what
the IR spells: (i64, ptr, i64, i8) for a String and an
Optional<Double>.
Sourcepub fn allowed_dynamic_range_high(self) -> Self
pub fn allowed_dynamic_range_high(self) -> Self
.allowedDynamicRange(_:) with .high.
Image.DynamicRange is a resilient struct, so its size is a run-time
question and .high is handed back through x8 rather than in a
register. The Optional wrapper is the struct’s own bytes in a buffer
the optional’s size — zeroed, which is .some for a payload with spare
inhabitants — and it travels by address with the image beside it.
Sourcepub fn resizable(self, mode: ResizingMode) -> Self
pub fn resizable(self, mode: ResizingMode) -> Self
.resizable(capInsets:resizingMode:), with the zero cap insets Swift
source gets from the bare .resizable().
EdgeInsets is four CGFloats and nothing else, which makes it a
homogeneous float aggregate: it travels in d0–d3 rather than by address.
The resizing mode does not travel in a register, though — see
Image::rendering_mode.
Sourcepub fn interpolation(self, mode: Interpolation) -> Self
pub fn interpolation(self, mode: Interpolation) -> Self
.interpolation(_:) — how the image is resampled when scaled.
The same argument convention as Image::resizable: the mode by address
in x0, the image itself as a plain second argument in x1 rather than in
x20, and the new image back in x0. Not what a method on a struct usually
looks like, which is why it is read out of the IR rather than assumed.
Sourcepub fn symbol_rendering_mode(self, mode: Option<SymbolRenderingMode>) -> Self
pub fn symbol_rendering_mode(self, mode: Option<SymbolRenderingMode>) -> Self
.symbolRenderingMode(_:) — the overload on Image, which returns
Image.
Its View neighbour writes the environment and wraps the image in a
ModifiedContent; Apple’s own listings reach this one, so a chain that
went through the environment rendered the same and typed differently.
Same shape as Image::rendering_mode: the mode is address-only and
self is an ordinary second argument, not a swiftself.
Sourcepub fn antialiased(self, on: bool) -> Self
pub fn antialiased(self, on: bool) -> Self
.antialiased(_:)
Sourcepub fn rendering_mode(self, mode: Option<TemplateRenderingMode>) -> Self
pub fn rendering_mode(self, mode: Option<TemplateRenderingMode>) -> Self
.renderingMode(_:)
Neither of these two takes its enum in a register, and neither takes
self in x20. Image.TemplateRenderingMode is not @frozen, so its
size is only known at run time and the argument is address-only; and the
IR shows plain pointers rather than a swiftself, so the receiver is an
ordinary second argument. Passing the case number in x0 and the image in
x20 — which is what every view modifier in this crate wants — faults
inside the runtime.
Sourcepub fn view(self) -> ViewHandle
pub fn view(self) -> ViewHandle
The image as a view.