Skip to main content

Crate stipple_render

Crate stipple_render 

Source
Expand description

The Stipple rendering seam.

stipple-render is the one crate that knows about oxideav. It turns a Scene (a list of logical-pixel draw primitives) into an oxideav-core scene graph, rasterizes it on the CPU with oxideav-raster, and hands the result to a Surface for display.

use stipple_geometry::{Rect, ScaleFactor, Size};
use stipple_render::{Color, Scene, SoftwareRenderer};

let mut scene = Scene::new(Size::new(64.0, 64.0));
scene.fill_round_rect(Rect::from_xywh(8.0, 8.0, 48.0, 48.0), 12.0, Color::rgb(80, 140, 255));

let pixmap = SoftwareRenderer::new().render(scene, ScaleFactor::IDENTITY);
assert_eq!(pixmap.size().width, 64);

The Surface trait is the GPU-readiness boundary: today the SoftwareRenderer produces a Pixmap that the platform layer blits; a future raw-GPU backend (Metal / Vulkan / D3D12 / WebGPU) can implement the same trait without changing any caller. See ROADMAP.md §2 / Phase 6.

Modules§

oxideav_bridge
Low-level conversions to oxideav-core coordinate types. Exposed for crates that build scene-graph nodes directly (e.g. the future text-run shaping bridge) and need to share Stipple’s geometry conventions.

Structs§

Color
A straight (non-premultiplied) 8-bit-per-channel sRGB color.
Font
A loaded, shapeable font face.
FontError
Error loading a Font.
Pixmap
A CPU pixel buffer in straight (non-premultiplied) RGBA8, row-major, tightly packed (stride == width * 4).
Scene
A builder of vector draw primitives in logical-pixel space.
SoftwareRenderer
Rasterizes scenes on the CPU. Cheap to construct and reusable across frames; the underlying oxideav renderer also caches per-subtree work.

Enums§

DrawCmd
A structured record of a scene primitive, kept alongside the lowered oxideav nodes so a GPU backend can consume the scene without re-deriving primitives from vector paths (the CPU rasterizer uses the nodes; the GPU path uses these). See Scene::commands.

Traits§

Surface
A presentable destination owned by the platform layer (a window’s drawable, a canvas, a layer-backed view, …).