C# Class Universe.ClientStack.UniverseTerrainCompressor

Datei anzeigen Open project: Virtual-Universe/Virtual-Universe

Public Methods

Method Description
CreateLandPacket ( short heightmap, int x, int y, byte type, int regionSizeX, int regionSizeY ) : LayerDataPacket

Creates a LayerData packet for compressed land data given a full simulator heightmap and an array of indices of patches to compress

CreateLayerDataPacket ( TerrainPatch patches, byte type, int regionSizeX, int regionSizeY ) : LayerDataPacket
CreatePatch ( BitPack output, float patchData, int x, int y, int regionSizeX, int regionSizeY ) : void
CreatePatchFromHeightmap ( BitPack output, short heightmap, int x, int y, int regionSizeX, int regionSizeY ) : void

Add a patch of terrain to a BitPacker

DecodePatch ( int patches, BitPack bitpack, TerrainPatch header, int size ) : void
DecodePatchHeader ( BitPack bitpack ) : TerrainPatch.Header
DecompressPatch ( int patches, TerrainPatch header, TerrainPatch group ) : float[]

Private Methods

Method Description
BuildCopyMatrix16 ( ) : void
BuildDequantizeTable16 ( ) : void
BuildQuantizeTable16 ( ) : void
CompressPatch ( float patchData, TerrainPatch header, int prequant, int &wbits ) : int[]
CompressPatch ( short heightmap, int patchX, int patchY, TerrainPatch header, int prequant, int regionSizeX, int regionSizeY, int &wbits ) : int[]
DCTColumn16 ( float linein, int lineout, int column ) : void
DCTColumn16Wbits ( float linein, int lineout, int column, int wbits, int maxwbits ) : int
DCTLine16 ( float linein, float lineout, int line ) : void
EncodePatch ( BitPack output, int patch, int postquant, int wbits ) : void
EncodePatchHeader ( BitPack output, TerrainPatch header, int patch, int regionSizeX, int regionSizeY, int wbits ) : int
IDCTColumn16 ( float linein, float lineout, int column ) : void
IDCTLine16 ( float linein, float lineout, int line ) : void
PrescanPatch ( float patch ) : TerrainPatch.Header
PrescanPatch ( short heightmap, int patchX, int patchY, int regionSizeX, int regionSizeY ) : TerrainPatch.Header
SetupCosines16 ( ) : void
UniverseTerrainCompressor ( ) : System

Method Details

CreateLandPacket() public static method

Creates a LayerData packet for compressed land data given a full simulator heightmap and an array of indices of patches to compress
public static CreateLandPacket ( short heightmap, int x, int y, byte type, int regionSizeX, int regionSizeY ) : LayerDataPacket
heightmap short /// A 256 * 256 array of floating point values /// specifying the height at each meter in the simulator ///
x int /// Array of indexes in the 16x16 grid of patches /// for this simulator. For example if 1 and 17 are specified, patches /// x=1,y=0 and x=1,y=1 are sent ///
y int /// Array of indexes in the 16x16 grid of patches /// for this simulator. For example if 1 and 17 are specified, patches /// x=1,y=0 and x=1,y=1 are sent ///
type byte
regionSizeX int
regionSizeY int
return LayerDataPacket

CreateLayerDataPacket() public static method

public static CreateLayerDataPacket ( TerrainPatch patches, byte type, int regionSizeX, int regionSizeY ) : LayerDataPacket
patches TerrainPatch
type byte
regionSizeX int
regionSizeY int
return LayerDataPacket

CreatePatch() public static method

public static CreatePatch ( BitPack output, float patchData, int x, int y, int regionSizeX, int regionSizeY ) : void
output BitPack
patchData float
x int
y int
regionSizeX int
regionSizeY int
return void

CreatePatchFromHeightmap() public static method

Add a patch of terrain to a BitPacker
public static CreatePatchFromHeightmap ( BitPack output, short heightmap, int x, int y, int regionSizeX, int regionSizeY ) : void
output BitPack BitPacker to write the patch to
heightmap short /// Heightmap of the simulator, must be a 256 * /// 256 float array ///
x int /// X offset of the patch to create, valid values are /// from 0 to 15 ///
y int /// Y offset of the patch to create, valid values are /// from 0 to 15 ///
regionSizeX int
regionSizeY int
return void

DecodePatch() public static method

public static DecodePatch ( int patches, BitPack bitpack, TerrainPatch header, int size ) : void
patches int
bitpack BitPack
header TerrainPatch
size int
return void

DecodePatchHeader() public static method

public static DecodePatchHeader ( BitPack bitpack ) : TerrainPatch.Header
bitpack BitPack
return TerrainPatch.Header

DecompressPatch() public static method

public static DecompressPatch ( int patches, TerrainPatch header, TerrainPatch group ) : float[]
patches int
header TerrainPatch
group TerrainPatch
return float[]