Files
brahman/crates/modules/pineal/export/src/lib.rs
T
sergio b75e22fa91 feat(pineal): cierra stub export — PlanRecorder + exporter SVG
Fase F: primer stub de pineal cerrado.

pineal-render:
- PlanRecorder — un Canvas que graba cada llamada como RenderCmd en un
  RenderPlan. Es el puente painter→backend-diferido y la infraestructura
  de testing (snapshot de planes).

pineal-export:
- svg::to_svg(plan, w, h) — RenderPlan → documento SVG completo.
  Cubre FillRect/StrokeRect/StrokeLine/StrokePolyline/DrawText +
  FillTriangleStrip (strip→polígonos con color promedio). XML-escape
  en texto. v1: clips ignorados (documentado).
- pdf queda como placeholder documentado.

Tests: 1 recorder + 4 svg (well-formed, primitivas, xml-escape,
triangle-strip→polygons). cargo check --workspace verde.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-20 14:11:03 +00:00

22 lines
741 B
Rust
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
//! `pineal-export` — exporters de `RenderPlan`.
//!
//! Estrategia: el painter dibuja contra el trait `Canvas`; un
//! `PlanRecorder` (en `pineal-render`) lo graba como `RenderPlan`; este
//! crate consume el plan y emite el formato destino. Un solo camino de
//! código para screen y export.
//!
//! - [`svg`] — exporter SVG (implementado).
//! - [`pdf`] — placeholder; cuando se implemente, vía `printpdf` sobre
//! el mismo `RenderPlan`, con decimación contextual por DPI
//! (`target = width_inches × dpi × vertices_per_pixel`).
#![forbid(unsafe_code)]
pub mod svg;
/// Exporter PDF — pendiente. Se implementará sobre `printpdf`
/// consumiendo el mismo `RenderPlan` que `svg`.
pub mod pdf {}
pub use svg::to_svg;