Table of Contents

Class PngS100DatasetRenderer

Namespace
EncDotNet.S100
Assembly
EncDotNet.S100.dll

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

layer S100Layer

The dataset + portrayal lens to render.

options S100RendererOptions

Render options, or null for defaults.

cancellationToken CancellationToken

Cancellation token observed cooperatively.

Returns

Task<byte[]>

The rendered result.

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

processors IReadOnlyList<IDatasetProcessor>

The datasets' processors, painted bottom-first (index 0 is the base layer). Each must implement IVectorPortrayalSource or ICoveragePortrayalSource. Not disposed by this method.

options S100CompositeOptions

Composite render options; defaults when null.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<byte[]>

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

layers IReadOnlyList<S100Layer>

The layers to composite, in draw order (bottom-most first).

options S100CompositeOptions

Composite render options, or null for defaults.

cancellationToken CancellationToken

Cancellation token observed cooperatively.

Returns

Task<byte[]>

The composited result.

Exceptions

NotSupportedException

A layer's dataset shape cannot participate in a headless composite.