Class PngS100DatasetRenderer
Renders an S-100 layer to PNG image bytes. This is the batteries-included
renderer: with the bundled catalogues the simple path is a single call —
await new PngS100DatasetRenderer().RenderAsync(dataset).
public sealed class PngS100DatasetRenderer : IS100DatasetRenderer<byte[]>, IS100CompositeRenderer<byte[]>, IDisposable
- Inheritance
-
PngS100DatasetRenderer
- Implements
- Inherited Members
- Extension Methods
Remarks
A single instance may be reused to render many datasets and layers; it caches the bundled pipeline host so repeated renders reuse warmed catalogue parse caches. The renderer is thread-safe for sequential reuse; concurrent calls on one instance are not supported. Dispose to release the cached host.
Methods
Dispose()
Releases the cached bundled pipeline host.
public void Dispose()
RenderAsync(S100Layer, S100RendererOptions?, CancellationToken)
Renders a single layer.
public Task<byte[]> RenderAsync(S100Layer layer, S100RendererOptions? options = null, CancellationToken cancellationToken = default)
Parameters
layerS100LayerThe dataset + portrayal lens to render.
optionsS100RendererOptionsRender options, or
nullfor defaults.cancellationTokenCancellationTokenCancellation token observed cooperatively.
Returns
Exceptions
- NotSupportedException
The layer's dataset shape cannot be rendered to an image.
RenderAsync(IReadOnlyList<IDatasetProcessor>, S100CompositeOptions?, CancellationToken)
Composites a stack of already-built dataset processors into a single PNG. Unlike the S100Layer overload, this parses nothing: the caller owns the processors and their lifetime, so a host that keeps resident processors (e.g. a mutable MCP session) can render the same datasets repeatedly without re-reading their bytes on every call (issue #566). Per-layer catalogue overrides are not applicable here — a processor already baked its catalogues at construction.
public Task<byte[]> RenderAsync(IReadOnlyList<IDatasetProcessor> processors, S100CompositeOptions? options = null, CancellationToken cancellationToken = default)
Parameters
processorsIReadOnlyList<IDatasetProcessor>The datasets' processors, painted bottom-first (index 0 is the base layer). Each must implement
IVectorPortrayalSourceorICoveragePortrayalSource. Not disposed by this method.optionsS100CompositeOptionsComposite render options; defaults when null.
cancellationTokenCancellationTokenCancellation token.
Returns
RenderAsync(IReadOnlyList<S100Layer>, S100CompositeOptions?, CancellationToken)
Renders an ordered layer stack (bottom-most first) into one image.
public Task<byte[]> RenderAsync(IReadOnlyList<S100Layer> layers, S100CompositeOptions? options = null, CancellationToken cancellationToken = default)
Parameters
layersIReadOnlyList<S100Layer>The layers to composite, in draw order (bottom-most first).
optionsS100CompositeOptionsComposite render options, or
nullfor defaults.cancellationTokenCancellationTokenCancellation token observed cooperatively.
Returns
Exceptions
- NotSupportedException
A layer's dataset shape cannot participate in a headless composite.