Puregrain.Internal.ZhouFang
- Package
- purescript-puregrain
- Repository
- roman-mkh/puregrain
Zhou and Fang's error diffusion with threshold modulation (SIGGRAPH
2003): its tables, and the table by tone built from them. Internal:
may change without notice; Puregrain.Dither.zhouFang is the public
value.
The tables are the authors' code's, tmed.cpp, dated 2003-04-25
(https://github.com/cczbf/TMED), which libdither uses too; they differ
from the paper's Table 1 and Table 2 in three places, which measure
alike (docs/weights-by-tone/zhou-fang.md).
#coefficients Source
coefficients :: Array (Array Int)The weights as the code prints them, levels 0 to 127: right, down-left and down (Ostromoukhov's three neighbours), divided by their sum. Levels 128 to 255 are these mirrored (level i uses the row of 255 − i), as the code folds them.
#strengthPercent Source
strengthPercent :: Array IntThe threshold's modulation strength m(i), in percent, levels 0 to 127,
as the code's m_lpRandomScale; mirrored like the weights.
#zhouFangWeights Source
zhouFangWeights :: Unit -> WeightsByToneThe table by tone: each row divided by its sum, the strengths by 100, both mirrored to 256. Built when called, once per run by the drivers.
- Modules
- Puregrain
- Puregrain.
Cells - Puregrain.
Dither - Puregrain.
Gamma - Puregrain.
Internal. Cells - Puregrain.
Internal. Exact - Puregrain.
Internal. Fifo - Puregrain.
Internal. Gamma - Puregrain.
Internal. Image - Puregrain.
Internal. Kernel - Puregrain.
Internal. Noise - Puregrain.
Internal. Ostromoukhov - Puregrain.
Internal. Params - Puregrain.
Internal. Quantize - Puregrain.
Internal. Row - Puregrain.
Internal. SelfCheck - Puregrain.
Internal. State - Puregrain.
Internal. Step - Puregrain.
Internal. Util - Puregrain.
Internal. WeightsByTone - Puregrain.
Internal. ZhouFang - Puregrain.
Kernel - Puregrain.
Machine. C64 - Puregrain.
Machine. ZxSpectrum - Puregrain.
Ordered - Puregrain.
Palette - Puregrain.
Palette. Presets - Puregrain.
Pixel - Puregrain.
Quantize - Puregrain.
SelfCheck