pub enum RenderNode {
Empty,
TextLines {
area: Rect,
style: TextStyle,
lines: Vec<String>,
line_height_pt: f32,
},
Rect {
area: Rect,
background: Option<Color>,
border: Option<Border>,
},
Line {
x1: f32,
y1: f32,
x2: f32,
y2: f32,
thickness: f32,
color: Color,
},
Image {
area: Rect,
bytes: Arc<[u8]>,
format: ImageFormat,
width_px: u32,
height_px: u32,
components: u8,
},
Group {
area: Rect,
clip: bool,
background: Option<Color>,
border: Option<Border>,
children: Vec<RenderNode>,
},
}Expand description
Positioned, resolved layout output ready for the facade to translate
into lightweight-pdf-writer content-stream operations. Never seen by
lightweight-pdf-writer directly (plan/00a-contracts-and-artifacts.md point 3).
Variants§
Empty
TextLines
Already-wrapped lines, one per output line, top-aligned within area.
Rect
Line
Image
A validated JPEG/PNG placed at its final, Contain-fit size. bytes
are the original file bytes (facade decides how to embed them —
JPEG passes through as DCTDecode, PNG gets decoded once here to
split out the alpha channel as a SMask).
Group
A container’s own box: clipped (Grundprinzip 4), optionally painted with a background/border, holding its children.
Implementations§
Source§impl RenderNode
impl RenderNode
Sourcepub fn clipped(area: Rect, inner: RenderNode) -> RenderNode
pub fn clipped(area: Rect, inner: RenderNode) -> RenderNode
Wraps self in a clipping group bound to area — the render-pass
safety net required from every element, not only containers
(Grundprinzip 4/6).
pub fn height(&self) -> f32
Trait Implementations§
Source§impl Clone for RenderNode
impl Clone for RenderNode
Source§fn clone(&self) -> RenderNode
fn clone(&self) -> RenderNode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more