cz.cuni.jagrlib.iface
Interface BlockQuantizer

All Superinterfaces:
PersistentParamsBinary, Property
All Known Implementing Classes:
DefaultBlockQuantizer, JPEGQuantizer

public interface BlockQuantizer
extends Property, PersistentParamsBinary

Quantization of block discrete data.

Since:
0.24
See Also:
BlockQuantizer.java

Field Summary
 
Fields inherited from interface cz.cuni.jagrlib.iface.Property
LOGGING, STATISTICS, TEXT_DESCRIPTION
 
Method Summary
 int dequantize(int[] quant, double[] coef)
          Dequantization = reconstruction (floating-point form).
 int dequantize(int[] quant, int[] coef)
          Dequantization = reconstruction (integer form).
 int quantize(double[] coef, int[] quant)
          Quantization (floating-point form).
 int quantize(int[] coef, int[] quant)
          Quantization (integer form).
 void setBlockSize(int width, int height)
          Sets actual block size.
 void setData(int[] qtable)
          Sets quantization table for the current variant.
 void setQuality(float quality)
          Sets actual quality coefficient.
 int setVariant(int variant)
          Set actual quantizer variant (context).
 
Methods inherited from interface cz.cuni.jagrlib.iface.Property
commit, get, set
 
Methods inherited from interface cz.cuni.jagrlib.iface.PersistentParamsBinary
loadData, storeData
 

Method Detail

setVariant

int setVariant(int variant)
Set actual quantizer variant (context).

Parameters:
variant - Variant number (from 0).
Returns:
Old variant number.
See Also:
setBlockSize(int, int), setQuality(float), setData(int[])

setBlockSize

void setBlockSize(int width,
                  int height)
Sets actual block size. Can be used both for 1D and 2D quantization.

Parameters:
width - Horizontal block size (1D block size).
height - Vertical block size (1 for 1D).
See Also:
setVariant(int), setQuality(float), setData(int[])

setQuality

void setQuality(float quality)
Sets actual quality coefficient. Value range for the quality: 0.0f to 1.0f.

Parameters:
quality - New quality coefficient.
See Also:
setVariant(int), setBlockSize(int, int), setData(int[])

setData

void setData(int[] qtable)
Sets quantization table for the current variant.

Parameters:
qtable - New quantization table. Should have the correct size and layout (scanline top-first, left-first).
See Also:
setVariant(int), setQuality(float), setBlockSize(int, int)

quantize

int quantize(double[] coef,
             int[] quant)
Quantization (floating-point form).

Parameters:
coef - Source data (coefficients). Size = array size. Should have the correct size and layout (scanline top-first, left-first).
quant - Pre-allocated result array or null if it's size needs to be determined.
Returns:
Result array size (even if the quantization was not performed).
See Also:
quantize(int[],int[]), dequantize(int[],double[])

quantize

int quantize(int[] coef,
             int[] quant)
Quantization (integer form).

Parameters:
coef - Source data (coefficients). Size = array size. Should have the correct size and layout (scanline top-first, left-first).
quant - Pre-allocated result array or null if it's size needs to be determined.
Returns:
Result array size (even if the quantization was not performed).
See Also:
quantize(double[],int[]), dequantize(int[],int[])

dequantize

int dequantize(int[] quant,
               double[] coef)
Dequantization = reconstruction (floating-point form).

Parameters:
quant - Source data (quantized coefficients). Size = array size. Should have the correct size and layout (scanline top-first, left-first).
coef - Pre-allocated coefficient array or null if it's size needs to be determined.
Returns:
Coefficient array size (even if the dequantization was not performed).
See Also:
dequantize(int[],int[]), quantize(double[],int[])

dequantize

int dequantize(int[] quant,
               int[] coef)
Dequantization = reconstruction (integer form).

Parameters:
quant - Source data (quantized coefficients). Size = array size. Should have the correct size and layout (scanline top-first, left-first).
coef - Pre-allocated coefficient array or null if it's size needs to be determined.
Returns:
Coefficient array size (even if the dequantization was not performed).
See Also:
dequantize(int[],double[]), quantize(int[],int[])