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: Transform2DCoordinate transform applied to children. Identity by default.
opacity: f32Group 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
impl Group
Sourcepub fn new() -> Self
pub fn new() -> Self
An empty group: identity transform, opacity 1.0, no clip, no
children, no cache key. Same as Group::default.
Sourcepub fn with_transform(self, transform: Transform2D) -> Self
pub fn with_transform(self, transform: Transform2D) -> Self
Replace the transform.
Sourcepub fn with_opacity(self, opacity: f32) -> Self
pub fn with_opacity(self, opacity: f32) -> Self
Set the group opacity in 0.0..=1.0.
Sourcepub fn with_child(self, child: Node) -> Self
pub fn with_child(self, child: Node) -> Self
Append a child node.
Sourcepub fn with_children(self, children: Vec<Node>) -> Self
pub fn with_children(self, children: Vec<Node>) -> Self
Replace the children list wholesale.
Sourcepub fn with_cache_key(self, key: u64) -> Self
pub fn with_cache_key(self, key: u64) -> Self
Set the rasterizer cache key. See Group::cache_key.