Class DaltonizeGenerator


public class DaltonizeGenerator extends ColorTransformGenerator
Optimized implementation of a Daltonize algorithm. This works by precomputing a set of lookup tables for every possible color. The lookup tables will use 64 MB of RAM. Without these optimizations it would not be possible to use this algorithm in real time.
  • Constructor Details

    • DaltonizeGenerator

      public DaltonizeGenerator(Deficiency colorBlindness)
  • Method Details

    • createDaltonizer

      public static DaltonizeGenerator createDaltonizer(Deficiency colorBlindness)
    • computeColorMapLookup

      protected int[] computeColorMapLookup(float amount)
      Description copied from class: ColorTransformGenerator
      This should only be called once, and lazily, when the table is first used.
      Specified by:
      computeColorMapLookup in class ColorTransformGenerator
      Parameters:
      amount - number in range [0, 1]
      Returns:
      precomputed lookup table.
    • precalcMonochromaticColorMap

      protected int[] precalcMonochromaticColorMap(Vector sim, Matrix shiftErrorTowardsVisible, float amount)
    • precalcDichromaticColorMap

      protected int[] precalcDichromaticColorMap(Matrix sim, Matrix shiftErrorTowardsVisible, float amount)