# RasterAnimationSource

A repeatable bounded frame producer with known dimensions and count.

 Class  

`ChartForgeX.Raster`

**Namespace**

`ChartForgeX.Raster`

**Assembly**

`ChartForgeX`

**Source**

[RasterAnimationSource.cs:11](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Raster/RasterAnimationSource.cs#L11)

**Modifiers**

sealed

A repeatable bounded frame producer with known dimensions and count.

## Inheritance

- object
- RasterAnimationSource

## Remarks

GIF makes a palette pass and an encoding pass. Each index must return identical pixels and timing on both passes. Buffers are borrowed only until the next frame is requested.

## Usage

 Explore 3 API references to this type 

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

### Returned or exposed by 1

- Method [PreparedVisualStory.FrameSource](/api/chartforgex-stories-preparedvisualstory/#method-framesource-chartforgex-raster-rasteranimationformat-chartforgex-stories-visualstoryframeoptions)

### Accepted by parameters 2

- Method [RasterAnimationEncoder.Encode](/api/chartforgex-raster-rasteranimationencoder/#method-encode-chartforgex-raster-rasteranimationsource-chartforgex-raster-rasteranimationformat-chartforgex-raster-rasteranimationoptions-threading-cancellationtoken) parameter `source`
- Method [RasterAnimationEncoder.WriteTo](/api/chartforgex-raster-rasteranimationencoder/#method-writeto-io-stream-chartforgex-raster-rasteranimationsource-chartforgex-raster-rasteranimationformat-chartforgex-raster-rasteranimationoptions-threading-cancellationtoken) parameter `source`

 Filter members   

    Show inherited   

 

## Constructors

 `public RasterAnimationSource(int width, int height, int frameCount, Func<int, CancellationToken, RasterAnimationFrame> renderFrame, long additionalWorkingBytes = 0)` [#](#constructor-ctor-int32-int32-int32-func-system-int32-system-threading-cancellationtoken-chartforgex-raster-rasteranimationframe-int64) 

[RasterAnimationSource.cs:11](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Raster/RasterAnimationSource.cs#L11)

Creates a deterministic frame source. Rendering is deferred until encoding or reading.

Parameters

**width int required**

**height int required**

**frameCount int required**

**renderFrame System.Func<int, System.Threading.CancellationToken, ChartForgeX.Raster.RasterAnimationFrame> required**

**additionalWorkingBytes long = 0 optional**

## Methods

 `public RasterAnimationFrame GetFrame(int index, CancellationToken cancellationToken = default)` [#](#method-getframe-int32-threading-cancellationtoken) 

[RasterAnimationSource.cs:31](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Raster/RasterAnimationSource.cs#L31)

Renders and validates one frame.

Parameters

**index int required**

**cancellationToken System.Threading.CancellationToken = default optional**

Returns

 `RasterAnimationFrame` 

## Inherited Methods

 `public virtual bool Equals(object? obj)` [#](#method-equals-object) 

Inherited from object

Parameters

**obj object? required**

Returns

 `bool` 

 `public virtual int GetHashCode()` [#](#method-gethashcode) 

Inherited from object

Returns

 `int` 

 `public Type GetType()` [#](#method-gettype) 

Inherited from object

Returns

 `Type` 

 `public virtual string? ToString()` [#](#method-tostring) 

Inherited from object

Returns

 `string?` 

## Properties

 `public int Width { get; }` [#](#property-width) 

[RasterAnimationSource.cs:22](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Raster/RasterAnimationSource.cs#L22)

Gets the complete canvas width in pixels.

 `public int Height { get; }` [#](#property-height) 

[RasterAnimationSource.cs:24](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Raster/RasterAnimationSource.cs#L24)

Gets the complete canvas height in pixels.

 `public int FrameCount { get; }` [#](#property-framecount) 

[RasterAnimationSource.cs:26](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Raster/RasterAnimationSource.cs#L26)

Gets the known number of frames.

 `public long AdditionalWorkingBytes { get; }` [#](#property-additionalworkingbytes) 

[RasterAnimationSource.cs:28](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Raster/RasterAnimationSource.cs#L28)

Gets the producer's conservative retained asset and working-buffer estimate, excluding returned frame pixels.

<!-- PowerForge markdown artifact sha256:91D22303AD0CC917BFF3641A5B85FD6EB4C44AEA00C3E8BC8791880EA63D3BB7 -->
