Skip to main content

Module render

Module render 

Source
Expand description

Render endpoints: start a render job, persist it to the library, and return its id. The same UUID is used for the in-memory JobStore and the saved_renders row, so the existing /api/render/{id}/* endpoints (live SSE / in-memory image) and the new /api/renders/{id}/* endpoints (persisted) address the same render.

Structs§

GlwPreviewRequest
Body of POST /api/render/glw-preview (JSON).
GlwRenderOptions
Per-render GLW configuration accepted by both render endpoints.
GlwStyleOverrides
Optional per-element style overrides for the GLW overlay. All hex-colour strings are validated server-side via parse_color. Absent fields fall back to sl_glw::GlwStyle::default.
GridRectangleRequest
Body of POST /api/render/grid-rectangle (JSON).
GroupDto
The combined free rectangle for one user-defined slot group (two or more slots joined together), so the client can draw and fit-check it.
LogoPlacement
A logo image to composite into one of the nine placement slots, drawn at its native pixel size (optionally integer-doubled) and aligned within the slot’s free rectangle like a text label.
NotecardSummary
Minimal notecard descriptor included in StartedResponse so the UI can update its notecard dropdown in place when the backend copied the source notecard into a new scope.
PixelRectDto
An axis-aligned rectangle in image pixel coordinates (origin top-left).
PlacementSlotsResponse
Response shape for the placement-slots endpoints.
RegionOverlayPreviewRequest
Body of POST /api/render/region-overlay-preview (JSON).
RoutePreviewRequest
Body of POST /api/render/route-preview (JSON).
RoutePreviewWaypoint
One already-resolved route waypoint in a RoutePreviewRequest. The region has already been resolved to grid coordinates by the client’s /api/notecard/derive-rectangle call, so the preview endpoint needs no region lookup (no DB / network). Mirrors the fields of crate::routes::notecards’s ResolvedWaypoint; z is irrelevant to the pixel mapping and is omitted.
SavedGridRectangleSettings
Persisted form fields for a grid-rectangle render.
SavedUsbNotecardSettings
Persisted form fields for a USB-notecard render.
SlotDto
One of the nine candidate placement slots and how much free space it has.
StartedResponse
Response shape for both render endpoints.
TextLabel
A free-floating text label to draw in one of the nine placement slots. Independent of the GLW overlay (labels can be added to any render).

Enums§

GlwSource
Where a render’s GLW overlay should come from.
OutputFormat
Output format for the rendered image.
SavedRenderSettings
Settings JSON stored in saved_renders.settings_json. Designed to be fed back into the form for “Regenerate”.

Functions§

free_placement_slots_grid_rectangle
POST /api/render/placement-slots/grid-rectangle — report the free placement slots for an explicit-corner render (optional GLW overlay), with no route. Read-only: nothing is persisted.
free_placement_slots_usb_notecard
POST /api/render/placement-slots/usb-notecard — report the free placement slots for a notecard render (route + optional GLW overlay). Read-only: the notecard is parsed/loaded but never copied or persisted, and no GLW row is inserted.
glw_legend_preview
POST /api/render/glw-legend-preview — rasterise just the GLW base legend onto a transparent image the size of the final render, so the client-side preview can drop it into the final-image bounds rectangle and show the legend exactly where — and at the size — the final render will place it.
glw_preview
POST /api/render/glw-preview — rasterise just the GLW overlay onto a transparent image matching the final-image bounds, so the client-side preview can composite it over the map tiles. Read-only: nothing is persisted (no saved_glw_data row is inserted).
grid_rectangle
POST /api/render/grid-rectangle — start a render from explicit corners.
placement_preview_grid_rectangle
POST /api/render/placement-preview/grid-rectangle — rasterise the text labels and logos of an explicit-corner render onto a transparent PNG at the final-image resolution, so the client preview can composite them into the bounds rectangle exactly where the final render will place them. Free space is measured on an overlay-only map (GLW shapes; no route on this path), as the real render does. Read-only: nothing is persisted.
placement_preview_usb_notecard
POST /api/render/placement-preview/usb-notecard — same as placement_preview_grid_rectangle but for a notecard render: free space is measured on an overlay-only map carrying the route plus the GLW shapes. Read-only: the notecard is parsed/loaded but never copied or persisted.
region_overlay_preview
POST /api/render/region-overlay-preview — rasterise the optional per-region annotation overlay (rectangles, names, grid coordinates) onto a transparent image at the final-image resolution, so the client-side preview can composite it into the bounds rectangle exactly where — and gated exactly as — the final render draws it. Read-only: nothing is persisted (region names are resolved through the shared cache only).
route_preview
POST /api/render/route-preview — rasterise just the route onto a transparent image at the final-image resolution, so the client-side preview can composite it over the map tiles exactly as the real render draws it. Read-only: nothing is persisted.
usb_notecard
POST /api/render/usb-notecard — start a render from a notecard.