pub struct VectorImage {
pub id: Option<Arc<str>>,
pub image: Arc<ImageAsset>,
pub rect: Rect,
pub pixel_transform: Transform,
pub sampling: Sampling,
pub extend: GradientExtend,
pub decal: bool,
pub source: Option<Range<usize>>,
}Expand description
A bitmap leaf; its surrounding group supplies any affine placement.
Fields§
§id: Option<Arc<str>>Optional unique selection ID.
image: Arc<ImageAsset>Immutable linear-premultiplied mip data.
rect: RectLocal destination rectangle; pixels stretch to this rectangle.
pixel_transform: TransformSource-pixel-to-local mapping, independent of the filled rectangle.
sampling: SamplingShared reconstruction rule.
extend: GradientExtendSampling outside source coordinates.
decal: boolWhether source-pixel bounds discard samples before reconstruction.
source: Option<Range<usize>>Optional source provenance.
Implementations§
Source§impl VectorImage
impl VectorImage
Sourcepub fn new(image: Arc<ImageAsset>, rect: Rect) -> Self
pub fn new(image: Arc<ImageAsset>, rect: Rect) -> Self
Creates a image stretched to a local rectangle, with trilinear/Pad sampling and a source decal. Fonts/importers may retain a distinct mapping.
Trait Implementations§
Source§impl Clone for VectorImage
impl Clone for VectorImage
Source§impl Debug for VectorImage
impl Debug for VectorImage
Source§impl Drawable for VectorImage
impl Drawable for VectorImage
Source§fn bounds(&self, _: &DrawContext) -> Rect
fn bounds(&self, _: &DrawContext) -> Rect
Local layout/ink bounds before node placement.
Source§fn draw(
&self,
_: &DrawContext,
canvas: &mut Canvas<'_>,
) -> Result<(), ValidationError>
fn draw( &self, _: &DrawContext, canvas: &mut Canvas<'_>, ) -> Result<(), ValidationError>
Emits local commands; validation errors propagate without partial output.
Source§fn resolve_node(
&self,
_context: &DrawContext,
) -> Result<Option<Node>, ValidationError>
fn resolve_node( &self, _context: &DrawContext, ) -> Result<Option<Node>, ValidationError>
Resolves deferred content to ordinary nodes at the current drawing time.
Source§fn try_bounds(&self, context: &DrawContext) -> Result<Rect, ValidationError>
fn try_bounds(&self, context: &DrawContext) -> Result<Rect, ValidationError>
Checked bounds for fallible content such as explicit-font paragraphs.
Existing geometry implementations may keep the infallible bounds method.
Auto Trait Implementations§
impl Forget for VectorImage
impl Freeze for VectorImage
impl RefUnwindSafe for VectorImage
impl Send for VectorImage
impl Sync for VectorImage
impl Unpin for VectorImage
impl UnsafeUnpin for VectorImage
impl UnwindSafe for VectorImage
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Output> IntoSceneOutput for Output
impl<Output> IntoSceneOutput for Output
Source§impl<Value> NodeModifiers for Value
impl<Value> NodeModifiers for Value
Source§fn layered_shadow(self, color: Color, radius: f64, offset: Vector2) -> Node
fn layered_shadow(self, color: Color, radius: f64, offset: Vector2) -> Node
Layers three soft silhouettes behind a single untouched source snapshot.
Source§fn elevated(self, elevation: Elevation) -> Node
fn elevated(self, elevation: Elevation) -> Node
Layers contact, key and ambient soft shadows that scale with an
Elevation.Source§fn gate_weave(self, seed: u64, frame: u64, amount: f64) -> Node
fn gate_weave(self, seed: u64, frame: u64, amount: f64) -> Node
Repeatable physical gate drift, keyed only by an explicit frame and seed.
Source§fn next_to(self, reference: &Node, side: Side, gap: f64) -> Node
fn next_to(self, reference: &Node, side: Side, gap: f64) -> Node
Places content next to the reference during compile-time layout.
Source§fn align_to(self, reference: &Node, edge: Side) -> Node
fn align_to(self, reference: &Node, edge: Side) -> Node
Aligns an edge with a compile-time measured reference snapshot.
Source§fn at(self, position: impl Into<Point>) -> Node
fn at(self, position: impl Into<Point>) -> Node
Places the selected pivot at a parent-space point, before translation.
Source§fn translate(self, horizontal: f64, vertical: f64) -> Node
fn translate(self, horizontal: f64, vertical: f64) -> Node
Adds parent-space translation, after scale and rotation.
Source§fn rotate(self, radians: f64) -> Node
fn rotate(self, radians: f64) -> Node
Adds clockwise radians about the pivot, after scale and before translation.
Source§fn scale(self, factor: f64) -> Node
fn scale(self, factor: f64) -> Node
Multiplies both scale factors; negative factors reflect and zero collapses.
Source§fn scale_xy(self, horizontal: f64, vertical: f64) -> Node
fn scale_xy(self, horizontal: f64, vertical: f64) -> Node
Multiplies per-axis scale factors about the pivot.
Source§fn pivot(self, pivot: Pivot) -> Node
fn pivot(self, pivot: Pivot) -> Node
Replaces the local-space pivot; defaults to the layout-bounds center.
Source§fn opacity(self, opacity: f64) -> Node
fn opacity(self, opacity: f64) -> Node
Replaces subtree opacity; invalid values are reported during conversion.
Source§fn blend_mode(self, mode: BlendMode) -> Node
fn blend_mode(self, mode: BlendMode) -> Node
Blends the completed subtree once against its immediate parent backdrop. Read more
Source§fn filter(self, filter: Filter) -> Node
fn filter(self, filter: Filter) -> Node
Appends a source-only filter, preserving declaration order. Read more
Source§fn clip(self, shape: impl Into<ShapeClip>) -> Node
fn clip(self, shape: impl Into<ShapeClip>) -> Node
Replaces the subtree’s local path-coverage clip without changing layout. Read more
Source§fn clip_with(self, shape: impl Into<ShapeClip>, mode: ClipMode) -> Node
fn clip_with(self, shape: impl Into<ShapeClip>, mode: ClipMode) -> Node
Clips with explicit coverage multiplication or geometric intersection.
Source§fn mask(self, mask: impl Into<Node>, mode: MaskMode) -> Node
fn mask(self, mask: impl Into<Node>, mode: MaskMode) -> Node
Replaces the local geometric rectangle clip without changing layout. Read more
Source§fn z_index(self, index: i32) -> Node
fn z_index(self, index: i32) -> Node
Replaces sibling-local stacking order; ties retain insertion order.