This sample demonstrates the backend-neutral persistent-raster animation model introduced in Icod.Terminal 1.16.0.
Run it with, for example:
dotnet run --project samples/Icod.Terminal.RasterAnimation.Sample/Icod.Terminal.RasterAnimation.Sample.csproj -f net10.0
The sample keeps the ownership boundary explicit:
application / higher-level renderer
owns source frames, placement intent, and playback policy
Icod.Terminal
owns opaque terminal image/frame identity, acknowledged transfer,
frame-sequence certainty, serialized playback control, and cleanup
The executable flow:
- verifies the semantic
PersistentRasterAnimationcapability; - creates one persistent resource from an in-memory RGB24 root image;
- obtains the resource-owned animation controller and opaque root-frame token without I/O;
- assigns the root frame a positive duration;
- appends two acknowledged full-size frames;
- creates one ordinary placement through the existing presentation API;
- starts loading-mode playback and appends another frame while loading;
- stops playback and explicitly selects a known frame;
- runs normal playback with one additional traversal;
- runs normal playback indefinitely, then stops it explicitly;
- releases placement and resource ownership deterministically with
await using.
The program contains no terminal-brand branch, graphics-backend selection, public numeric image/frame identity, raw control dictionary, retained source-frame replay cache, image-file decoder, or screen-layout policy. A failed or ambiguous operation is reported and is never automatically retried.
The animation controller is resource-owned and is not independently disposable. Disposing the resource remains final terminal-side cleanup authority for the resource, its frames, and its placements.
See ../../docs/Persistent-Raster-Ownership.md for the permanent ownership contract and ../README.md for the sample catalog.