Where you are: docs → reference → api → stmap Read this first: api.md See also: subsystems/stmap.md · stmap.md
TL;DR Twelve endpoints manage the per-pixel coordinate-remapping subsystem (lens correction, creative warps). Maps can be uploaded from EXR/PNG/raw-float32 files, generated from parameterized templates, or assigned per-source or globally on the program bus.
Purpose: list all stored map names.
Handler: control/api_stmap.go → (*API).handleSTMapList.
Response 200: ["identity", "barrel", "lens-cam1", ...].
Purpose: return the current program/source assignments plus the available map list.
Handler: (*API).handleSTMapState.
Response 200: internal.STMapState.
Purpose: list available parametric generators (identity, barrel, pincushion, fisheye_to_rectilinear, corner_pin, heat_shimmer, dream, ripple, lens_breathe, vortex).
Handler: (*API).handleSTMapGenerators.
Purpose: generate a map from a generator preset.
Handler: (*API).handleSTMapGenerate.
Request body (control.generateRequest):
{
"type": "barrel",
"params": { "k1": 0.1, "k2": 0.05 },
"name": "lens-cam1",
"width": 1920, "height": 1080,
"assign_source": "cam1",
"assign_program": false,
"frame_count": 1
}frame_count > 1 produces an animated map (valid only for animated generators like heat_shimmer / ripple / vortex).
Errors: 400 (stmap.ErrInvalidDimensions, stmap.ErrInvalidName, unknown generator type).
Emits: state broadcast with the map added to the registry and optionally assigned.
Purpose: upload an ST map file (EXR, 16-bit PNG, or raw float32).
Handler: (*API).handleSTMapUpload.
Request: multipart/form-data with file field. File type detected by extension.
Response 201: stmap.STMap metadata.
Errors: 400 (stmap.ErrInvalidName, stmap.ErrInvalidDimensions, parse failure).
Purpose: return map metadata.
Handler: (*API).handleSTMapGet. Response 200: stmap.STMap.
Errors: 404 (stmap.ErrNotFound).
Handler: (*API).handleSTMapDelete. Response 204.
Purpose: download the original uploaded file (when available) or the raw float32 representation.
Handler: (*API).handleSTMapDownload.
Response 200: application/octet-stream or original image MIME type.
Purpose: assign a map to a specific source.
Handler: (*API).handleSTMapAssignSource.
Request body (control.stmapAssignRequest): { "map": "lens-cam1" }.
Response 200: full ControlRoomState.
Errors: 404 (stmap.ErrNotFound).
Handler: (*API).handleSTMapRemoveSource.
Purpose: apply a map to the entire program output.
Handler: (*API).handleSTMapAssignProgram.
Request body: { "map": "heat-shimmer" }.
Handler: (*API).handleSTMapRemoveProgram.
- Concepts: stmap.md
- Reference: api.md · state-broadcast.md
- Subsystems: stmap.md