Click or drag to resize
DigitalRuneAnimationHelperCompress Method
Compresses the specified animation using simple lossy compression algorithm.

Namespace: DigitalRune.Animation
Assembly: DigitalRune.Animation (in DigitalRune.Animation.dll) Version: 1.4.0.0 (1.4.1.14427)
Syntax
public static SrtAnimation Compress(
	SrtKeyFrameAnimation animation,
	float scaleThreshold,
	float rotationThreshold,
	float translationThreshold
)

Parameters

animation
Type: DigitalRune.AnimationSrtKeyFrameAnimation
The animation.
scaleThreshold
Type: SystemSingle
The scale threshold.
rotationThreshold
Type: SystemSingle
The rotation threshold in degrees.
translationThreshold
Type: SystemSingle
The translation threshold.

Return Value

Type: SrtAnimation
The compressed animation. Or if the animation does contain any key frames.
Exceptions
ExceptionCondition
ArgumentNullExceptionanimation is .
Remarks

This method takes an SrtKeyFrameAnimation and removes not needed scale, rotation or translation channels. It further removes key frames that can be interpolated from the neighbor key frames. This a lossy compression and the threshold parameters define the allowed errors. If the thresholds are 0 or negative, this compression is lossless. If the thresholds are greater than 0 (recommended), the compression is lossy. The best way to determine optimal thresholds is to compare the compressed animation with the uncompressed animation visually.

See Also