> For the complete documentation index, see [llms.txt](https://kinematicsoup.gitbook.io/scene-fusion/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kinematicsoup.gitbook.io/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfiterraincompressor.md).

# Interface sfITerrainCompressor

Namespace: [KS.SceneFusion.Client.Unity.Editor](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor.md)\
Assembly: KSUnity-Source.dll

Interface for compressing and decompressing terrain data.

```csharp
public interface sfITerrainCompressor
```

## Methods

### DecodeAlphamap(byte\[], int, int, int) <a href="#ks_scenefusion_client_unity_editor_sfiterraincompressor_decodealphamap_system_byte___system_int32_sy" id="ks_scenefusion_client_unity_editor_sfiterraincompressor_decodealphamap_system_byte___system_int32_sy"></a>

Decodes alphamap data.

```csharp
float[,,] DecodeAlphamap(byte[] data, int width, int height, int numLayers)
```

#### Parameters

`data` byte\[]

Data to decode.

`width` int

Width of the region the data is for.

`height` int

Height of the region the data is for.

`numLayers` int

Number of alphamap layers.

#### Returns

float\[,,]

Decoded alphamap data

### DecodeDetailLayer(byte\[], int, int) <a href="#ks_scenefusion_client_unity_editor_sfiterraincompressor_decodedetaillayer_system_byte___system_int32" id="ks_scenefusion_client_unity_editor_sfiterraincompressor_decodedetaillayer_system_byte___system_int32"></a>

Decodes detail layer data.

```csharp
int[,] DecodeDetailLayer(byte[] data, int width, int height)
```

#### Parameters

`data` byte\[]

Data to decode.

`width` int

Width of the region the data is for.

`height` int

Height of the region the data is for.

#### Returns

int\[,]

Decoded detail layer data

### DecodeHeightmap(byte\[], int, int) <a href="#ks_scenefusion_client_unity_editor_sfiterraincompressor_decodeheightmap_system_byte___system_int32_s" id="ks_scenefusion_client_unity_editor_sfiterraincompressor_decodeheightmap_system_byte___system_int32_s"></a>

Decodes heightmap data.

```csharp
float[,] DecodeHeightmap(byte[] data, int width, int height)
```

#### Parameters

`data` byte\[]

Data to decode.

`width` int

Width of the region the data is for.

`height` int

Height of the region the data is for.

#### Returns

float\[,]

Decoded heightmap data

### DecodeTrees(byte\[]) <a href="#ks_scenefusion_client_unity_editor_sfiterraincompressor_decodetrees_system_byte" id="ks_scenefusion_client_unity_editor_sfiterraincompressor_decodetrees_system_byte"></a>

Decodes tree data.

```csharp
byte[] DecodeTrees(byte[] data)
```

#### Parameters

`data` byte\[]

Data to decode.

#### Returns

byte\[]

Decoded tree data

### EncodeAlphamap(float\[,,]) <a href="#ks_scenefusion_client_unity_editor_sfiterraincompressor_encodealphamap_system_single_0__0__0" id="ks_scenefusion_client_unity_editor_sfiterraincompressor_encodealphamap_system_single_0__0__0"></a>

Encodes alphamap data.

```csharp
byte[] EncodeAlphamap(float[,,] alphamapData)
```

#### Parameters

`alphamapData` float\[,,]

#### Returns

byte\[]

Encoded data

### EncodeDetailLayer(int\[,]) <a href="#ks_scenefusion_client_unity_editor_sfiterraincompressor_encodedetaillayer_system_int32_0__0" id="ks_scenefusion_client_unity_editor_sfiterraincompressor_encodedetaillayer_system_int32_0__0"></a>

Encodes detail layer data.

```csharp
byte[] EncodeDetailLayer(int[,] detailLayerData)
```

#### Parameters

`detailLayerData` int\[,]

#### Returns

byte\[]

Encoded data

### EncodeHeightmap(float\[,]) <a href="#ks_scenefusion_client_unity_editor_sfiterraincompressor_encodeheightmap_system_single_0__0" id="ks_scenefusion_client_unity_editor_sfiterraincompressor_encodeheightmap_system_single_0__0"></a>

```csharp
byte[] EncodeHeightmap(float[,] heightmapData)
```

#### Parameters

`heightmapData` float\[,]

#### Returns

byte\[]

### EncodeTrees(byte\[]) <a href="#ks_scenefusion_client_unity_editor_sfiterraincompressor_encodetrees_system_byte" id="ks_scenefusion_client_unity_editor_sfiterraincompressor_encodetrees_system_byte"></a>

Encodes tree data.

```csharp
byte[] EncodeTrees(byte[] data)
```

#### Parameters

`data` byte\[]

Data to encode.

#### Returns

byte\[]

Encoded tree data
