Class RandomSequence

java.lang.Object
nom.tam.fits.compression.algorithm.quant.RandomSequence

public final class RandomSequence extends Object
A standard fixed random sequence to use for portable and reversible dither implementations. This is a modified (improved) version of the random sequence implementation in Appendix I of the FITS 4.0 standard, using integer arithmetics for better performance -- but still providing the same sequence as the original algorithm.
See Also:
  • QuantizeProcessor
  • Method Summary

    Modifier and Type
    Method
    Description
    static double
    get(int i)
    Returns the ith random value from the sequence
    static int
    Returns the number of random values in the sequence.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • get

      public static double get(int i)
      Returns the ith random value from the sequence
      Parameters:
      i - The index between 0 and length() (exclusive).
      Returns:
      The fixed uniform random deviate value at that index in the range of 0.0 to 1.0 (exclusive).
      See Also:
    • length

      public static int length()
      Returns the number of random values in the sequence.
      Returns:
      The number of random values available from the fixed sequence.