Transform

The transform module exposes a well-defined interface which need to be implemented by any Transformer, i.e., the function producing the base and deviation used by the GD Store.

AbstractTransformer

This is the abstract type that a new transformer need to implement in order to be usable by the store. The functions transform and invtransform need to respect the given signatures.

GD.Transform.transformMethod
transform(transformer, data)

Applies the transformer transformation to data and returns a split representation under the form (basis, deviation).

source
GD.Transform.invtransformMethod
invtransform(transformer, basis, deviation)

Reverses the transformation applied by transformer and returns the original data.

source

GD Quantization

GD Quantization is applying a lossless quantization which store the quantization error in the deviation.

GD.Transform.QuantizerType
Quantizer

Transformer which creates a basis and deviation pair as follow:

  • basis: keeps only the msbsize MSB of each byte
  • deviation: keeps the remaing lsbsize LSB of each byte
source
GD.Transform.transformMethod
transform(quantizer, data)

Cuts each element from data into a basis containing the quantizer.msbsize MSB of the element, and a deviation containing the quantizer.lsbsize LSB of the element.

Returns the concatenation of the MSB of the bytes as the basis, and the concatenation of the LSB of the bytes as the deviation.

source
GD.Transform.invtransformMethod
invtransform(quantizer, basis, deviation)

Extracts each couple (MSB, LSB) from basis and deviation and rebuilds the original data by combining them.

Returns the original byte array which has been transformed by transform().

source