Package colorblind.generators
Class DaltonizeGenerator
java.lang.Object
colorblind.generators.Generator
colorblind.generators.ColorTransformGenerator
colorblind.generators.DaltonizeGenerator
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.
-
Field Summary
Fields inherited from class colorblind.generators.ColorTransformGenerator
amount, amountComplement, applyGammaCorrectionLUT, colorMap, deficiency, dynamicAmount, MAX_ENCODED_VALUE, removeGammaCorrectionLUT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected int[]computeColorMapLookup(float amount) This should only be called once, and lazily, when the table is first used.static DaltonizeGeneratorcreateDaltonizer(Deficiency colorBlindness) protected int[]precalcDichromaticColorMap(Matrix sim, Matrix shiftErrorTowardsVisible, float amount) protected int[]precalcMonochromaticColorMap(Vector sim, Matrix shiftErrorTowardsVisible, float amount) Methods inherited from class colorblind.generators.ColorTransformGenerator
getColorMap, preComputeApplyGammaCorrectionLUT, preComputeRemoveGammaCorrectionLUT, setAmount, setDynamicAmount, transformColor, transformPImage, transformPixels
-
Constructor Details
-
DaltonizeGenerator
-
-
Method Details
-
createDaltonizer
-
computeColorMapLookup
protected int[] computeColorMapLookup(float amount) Description copied from class:ColorTransformGeneratorThis should only be called once, and lazily, when the table is first used.- Specified by:
computeColorMapLookupin classColorTransformGenerator- Parameters:
amount- number in range [0, 1]- Returns:
- precomputed lookup table.
-
precalcMonochromaticColorMap
-
precalcDichromaticColorMap
-