Skip to main content

Group

Struct Group 

Source
pub struct Group {
    pub transform: Transform2D,
    pub opacity: f32,
    pub clip: Option<Path>,
    pub children: Vec<Node>,
    pub cache_key: Option<u64>,
}
Expand description

A grouping node — applies a transform / opacity / optional clip path to all descendants. Mirrors SVG <g> and PDF q ... Q graphic-state blocks.

Fields§

§transform: Transform2D

Coordinate transform applied to children. Identity by default.

§opacity: f32

Group opacity in 0.0..=1.0. 1.0 is fully opaque.

§clip: Option<Path>

Optional clip path. Children are clipped to this path’s interior (using the path’s own fill rule). None means “no clip”.

§children: Vec<Node>§cache_key: Option<u64>

Opaque cache key. When Some(k), a downstream rasterizer is free to memoise the rendered bitmap of this group’s content (after transform is applied) under key k, so re-rendering the same group at the same effective resolution returns the cached bitmap.

Producers that emit cacheable content (e.g. scribe shaping a glyph at (face_id, glyph_id, size_q8, subpixel_x)) compute a deterministic hash of their identity tuple and put it here. The rasterizer treats it as a black box — oxideav-core never inspects the value, so each producer’s namespace stays private.

None (the default) means “do not cache; render fresh every time”. Most synthesised vector content (a one-off rectangle, a gradient panel) leaves this None.

Implementations§

Source§

impl Group

Source

pub fn new() -> Self

An empty group: identity transform, opacity 1.0, no clip, no children, no cache key. Same as Group::default.

Source

pub fn with_transform(self, transform: Transform2D) -> Self

Replace the transform.

Source

pub fn with_opacity(self, opacity: f32) -> Self

Set the group opacity in 0.0..=1.0.

Source

pub fn with_clip(self, clip: Path) -> Self

Set the clip path.

Source

pub fn with_child(self, child: Node) -> Self

Append a child node.

Source

pub fn with_children(self, children: Vec<Node>) -> Self

Replace the children list wholesale.

Source

pub fn with_cache_key(self, key: u64) -> Self

Set the rasterizer cache key. See Group::cache_key.

Trait Implementations§

Source§

impl Clone for Group

Source§

fn clone(&self) -> Group

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Group

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Group

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for Group

§

impl RefUnwindSafe for Group

§

impl Send for Group

§

impl Sync for Group

§

impl Unpin for Group

§

impl UnsafeUnpin for Group

§

impl UnwindSafe for Group

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.