pub struct ImagePattern {
pub image: PatternImage,
pub transform: Transform,
pub extend: GradientExtend,
pub sampling: Sampling,
pub decal: bool,
}Expand description
A preloaded static image sampled in local pixel coordinates, without I/O.
Fields§
§image: PatternImageShared immutable pixels and mip levels; no decoder or renderer is retained.
transform: TransformMaps image pixel coordinates into shape-local coordinates.
extend: GradientExtendAddressing policy outside the image’s normalized extent.
sampling: SamplingTexel filtering and transform-derived mip selection policy.
decal: boolMakes samples outside the image extent transparent instead of extending edges.
Implementations§
Source§impl ImagePattern
impl ImagePattern
Sourcepub fn from_pixels(image: Arc<dyn ImagePixels>) -> Self
pub fn from_pixels(image: Arc<dyn ImagePixels>) -> Self
Captures an already resolved backend-independent image result.
Sourcepub fn from_asset<Image: ImagePixels>(image: Arc<Image>) -> Self
pub fn from_asset<Image: ImagePixels>(image: Arc<Image>) -> Self
Captures a linear RGBA16F mip chain without decoding/copying pixels.
Sourcepub fn sampling(self, sampling: Sampling) -> Self
pub fn sampling(self, sampling: Sampling) -> Self
Selects nearest, bilinear or transform-derived trilinear sampling.
Sourcepub fn transform(self, transform: Transform) -> Self
pub fn transform(self, transform: Transform) -> Self
Maps image pixels into shape-local coordinates.
Sourcepub fn extend(self, extend: GradientExtend) -> Self
pub fn extend(self, extend: GradientExtend) -> Self
Selects clamped, repeated or mirrored image edges.
Sourcepub fn validate(&self) -> Result<(), ValidationError>
pub fn validate(&self) -> Result<(), ValidationError>
Rejects nonfinite or noninvertible image-to-shape transforms.