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
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intprivate static final intprivate static final doubleprivate static final intDO NOT CHANGE THIS; used when quantizing real numbersprivate intprivate static final intprivate static final doubleprivate final double[] -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidinitialize(long ditherSeed) private double[]protected voiddoubleprotected doubletoDouble(int pixel) protected inttoInt(double pixel)
-
Field Details
-
LAST_RANDOM_VALUE
private static final int LAST_RANDOM_VALUE- See Also:
-
MAX_INT_AS_DOUBLE
private static final double MAX_INT_AS_DOUBLE- See Also:
-
N_RANDOM
private static final int N_RANDOMDO NOT CHANGE THIS; used when quantizing real numbers- See Also:
-
RANDOM_MULTIPLICATOR
private static final int RANDOM_MULTIPLICATOR- See Also:
-
RANDOM_START_VALUE
private static final double RANDOM_START_VALUE- See Also:
-
iseed
private int iseed -
nextRandom
private int nextRandom -
randomValues
private final double[] randomValues
-
-
Constructor Details
-
DitherFilter
DitherFilter(long seed)
-
-
Method Details
-
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
-