Skip to content
This repository was archived by the owner on Apr 15, 2026. It is now read-only.

Refactor Pipeline to Vec<Command> with .effect() and .rotate_angle()#4

Open
lilith wants to merge 3 commits intomainfrom
feat/pipeline-commands
Open

Refactor Pipeline to Vec<Command> with .effect() and .rotate_angle()#4
lilith wants to merge 3 commits intomainfrom
feat/pipeline-commands

Conversation

@lilith
Copy link
Copy Markdown
Member

@lilith lilith commented Apr 13, 2026

Summary

  • Pipeline internally builds a `Vec` instead of fixed fields
  • `plan()` delegates to `compute_layout_sequential()` — command evaluation order matches builder call order
  • New: `.effect(impl DimensionEffect)` inserts any dimension effect at the current position
  • New: `.rotate_angle(degrees, mode)` — cardinal angles (0/90/180/270) map to `Command::Rotate` (free D4), non-cardinal to `Command::Effect(RotateEffect)`
  • Removes dead `SourceRegion` enum

Fully backward compatible: existing `.auto_orient().crop().within().pad()` chains produce the same results.

Test plan

  • All 643 existing tests pass (no behavioral change)
  • 8 doctests pass
  • Clippy clean, no_std, WASM

lilith added 2 commits April 13, 2026 08:11
Pipeline now builds a Vec<Command> internally instead of using fixed
fields. plan() delegates to compute_layout_sequential(), which means
the order of builder calls determines command evaluation order.

New builder methods:
- .effect(impl DimensionEffect) — insert any dimension effect
- .rotate_angle(degrees, mode) — cardinal angles map to Command::Rotate
  (free, D4 composable), non-cardinal to Command::Effect(RotateEffect)

Existing API is fully backward compatible: .auto_orient().crop().within()
.pad() produces the same command sequence as the old fixed pipeline.

Removes dead SourceRegion enum (Pipeline no longer needs it).
lilith added a commit to imazen/zenpipe that referenced this pull request Apr 13, 2026
Adds support for arbitrary-angle rotation in the geometry bridge.
The new `zenlayout.rotate_angle` schema ID accepts `degrees` (f32)
and `mode` (crop/expand/original) parameters.

Pipeline.rotate_angle() handles dispatch: cardinal angles (0/90/180/270)
compose into the D4 orientation group (free), non-cardinal angles produce
a RotateEffect that the planner tracks as a dimension-changing effect.

Depends on zenlayout Pipeline refactor (imazen/zenlayout#4) and
zenresize re-exports (imazen/zenresize#4).
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant