Class QuantizeProcessor.DitherFilter
- java.lang.Object
-
- nom.tam.fits.compression.algorithm.quant.QuantizeProcessor.PixelFilter
-
- nom.tam.fits.compression.algorithm.quant.QuantizeProcessor.DitherFilter
-
- Enclosing class:
- QuantizeProcessor
private class QuantizeProcessor.DitherFilter extends QuantizeProcessor.PixelFilter
-
-
Field Summary
Fields Modifier and Type Field Description private intiseedprivate static intLAST_RANDOM_VALUEprivate static doubleMAX_INT_AS_DOUBLEprivate static intN_RANDOMDO NOT CHANGE THIS; used when quantizing real numbersprivate intnextRandomprivate static intRANDOM_MULTIPLICATORprivate static doubleRANDOM_START_VALUEprivate double[]randomValues
-
Constructor Summary
Constructors Constructor Description DitherFilter(long seed)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidinitialize(long ditherSeed)private double[]initRandoms()protected voidnextPixel()doublenextRandom()protected doubletoDouble(int pixel)protected inttoInt(double pixel)
-
-
-
Field Detail
-
LAST_RANDOM_VALUE
private static final int LAST_RANDOM_VALUE
- See Also:
- Constant Field Values
-
MAX_INT_AS_DOUBLE
private static final double MAX_INT_AS_DOUBLE
- See Also:
- Constant Field Values
-
N_RANDOM
private static final int N_RANDOM
DO NOT CHANGE THIS; used when quantizing real numbers- See Also:
- Constant Field Values
-
RANDOM_MULTIPLICATOR
private static final int RANDOM_MULTIPLICATOR
- See Also:
- Constant Field Values
-
RANDOM_START_VALUE
private static final double RANDOM_START_VALUE
- See Also:
- Constant Field Values
-
iseed
private int iseed
-
nextRandom
private int nextRandom
-
randomValues
private final double[] randomValues
-
-
Method Detail
-
initialize
public void initialize(long ditherSeed)
-
nextRandom
public double nextRandom()
-
initRandoms
private double[] initRandoms()
-
nextPixel
protected void nextPixel()
- Overrides:
nextPixelin classQuantizeProcessor.PixelFilter
-
toDouble
protected double toDouble(int pixel)
- Overrides:
toDoublein classQuantizeProcessor.PixelFilter
-
toInt
protected int toInt(double pixel)
- Overrides:
toIntin classQuantizeProcessor.PixelFilter
-
-