Class AutoColorMapCellValueDataLayer<TCellValue>
Base class for data layers that store a TCellValue value per cell, have color map (color per cell), and provide a job to calculate the color map.
Inheritance
Inherited Members
Namespace: Fwt.HexTerrains.DataLayers
Assembly: fwt.hexterrains.dll
Syntax
public abstract class AutoColorMapCellValueDataLayer<TCellValue> : ColorMapCellValueDataLayer<TCellValue>, IDisposable, ICommitChanges, IListDataLayer<TCellValue>, ICalculateColorMapJobProvider where TCellValue : unmanaged
Type Parameters
| Name | Description |
|---|---|
| TCellValue | Type of value per cell |
Properties
AutoColorMapMode
Declaration
public virtual AutoColorMapMode AutoColorMapMode { get; set; }
Property Value
| Type | Description |
|---|---|
| AutoColorMapMode |
MaxValue
Declaration
public virtual TCellValue MaxValue { get; set; }
Property Value
| Type | Description |
|---|---|
| TCellValue |
MinValue
Declaration
public virtual TCellValue MinValue { get; set; }
Property Value
| Type | Description |
|---|---|
| TCellValue |
Methods
CalculateColorMap(JobHandle)
Schedules a job that calculates colors for each cell based on the cell values.
Declaration
public virtual JobHandle CalculateColorMap(JobHandle dependency)
Parameters
| Type | Name | Description |
|---|---|---|
| JobHandle | dependency | job handle that is used as dependency to the scheduled job |
Returns
| Type | Description |
|---|---|
| JobHandle | new job handle that handles a scheduled job |
CalculateColorMap_ColorIndexByValue(JobHandle)
Schedules a job that calculates colors for each cell based on the cell values. Color map is calculated by taking from color palette a color with index == cell value.
Declaration
public abstract JobHandle CalculateColorMap_ColorIndexByValue(JobHandle dependency)
Parameters
| Type | Name | Description |
|---|---|---|
| JobHandle | dependency | job handle that is used as dependency to the scheduled job |
Returns
| Type | Description |
|---|---|
| JobHandle | new job handle that handles a scheduled job |
CalculateColorMap_Custom(JobHandle)
Schedules a job that calculates colors for each cell based on the cell values. Color map is calculated by using a custom logic defined in the derived class.
Declaration
public abstract JobHandle CalculateColorMap_Custom(JobHandle dependency)
Parameters
| Type | Name | Description |
|---|---|---|
| JobHandle | dependency | job handle that is used as dependency to the scheduled job |
Returns
| Type | Description |
|---|---|
| JobHandle | new job handle that handles a scheduled job |
CalculateColorMap_GradientThroughPalette(JobHandle)
Schedules a job that calculates colors for each cell based on the cell values. Color map is calculated by using a gradient through the color palette. The progress trhough gradient (palette) is calculated based on the cell value. The cell value is normalized to the range [0, 1] based on the MinValue and MaxValue.
Declaration
public abstract JobHandle CalculateColorMap_GradientThroughPalette(JobHandle dependency)
Parameters
| Type | Name | Description |
|---|---|---|
| JobHandle | dependency | job handle that is used as dependency to the scheduled job |
Returns
| Type | Description |
|---|---|
| JobHandle | new job handle that handles a scheduled job |
Init(int, TCellValue, TCellValue, HexTerrainSettings, NativeArray<Color32>)
Declaration
public virtual void Init(int layerSize, TCellValue minValue, TCellValue maxValue, HexTerrainSettings terrainSettings, NativeArray<Color32> copyColorPaletteFrom)
Parameters
| Type | Name | Description |
|---|---|---|
| int | layerSize | |
| TCellValue | minValue | |
| TCellValue | maxValue | |
| HexTerrainSettings | terrainSettings | |
| NativeArray<Color32> | copyColorPaletteFrom |