Puregrain.Internal.Gamma
- Package
- purescript-puregrain
- Repository
- roman-mkh/puregrain
The light curves behind Puregrain.Gamma, on single values on the
0–255 scale. Internal: may change without notice. Why the curves are
built from exact operations only, and how: docs/exact-arithmetic.md.
#Gamma Source
data GammaA curve between a picture's stored values and light: one of
Puregrain.Gamma's presets, gammaOff, gamma1p2, gamma1p5,
gamma1p8 and gammaSrgb.
Constructors
#Conversion Source
type Conversion a = { fromLight :: a -> a, gamma :: Gamma, toLight :: a -> a }What a driver hands a quantizer: a pixel type's two conversions, and
the curve itself, for quantizers of single channels (perChannel).
#noConversion Source
noConversion :: forall a. Conversion aNo conversion, for gammaOff: the drivers and the quantizers check
isOff once per run and then skip converting altogether, so the
identities here are never called per pixel.
#conversionFor Source
conversionFor :: forall a. ColorChannels a => Gamma -> Conversion aThe conversion of a pixel type's color channels by a curve.
#toLightValue Source
toLightValue :: Gamma -> Number -> NumberA value's light: a byte's from the table, any other value's from the formula (the table holds the formula's results, so both agree).
#fromLightValue Source
fromLightValue :: Gamma -> Number -> NumberA light value back to a stored one, for what's written: the light of a byte gives that byte exactly, found in the table; any other value goes through the formula.
#toLightFormula Source
toLightFormula :: Gamma -> Number -> NumberThe formula to light, without the table.
- Modules
- Puregrain
- Puregrain.
Cells - Puregrain.
Dither - Puregrain.
Gamma - Puregrain.
Internal. Exact - Puregrain.
Internal. Fifo - Puregrain.
Internal. Gamma - Puregrain.
Internal. Image - Puregrain.
Internal. Kernel - Puregrain.
Internal. Quantize - Puregrain.
Internal. Row - Puregrain.
Internal. SelfCheck - Puregrain.
Internal. State - Puregrain.
Internal. Step - Puregrain.
Internal. Util - Puregrain.
Kernel - Puregrain.
Machine. C64 - Puregrain.
Machine. ZxSpectrum - Puregrain.
Ordered - Puregrain.
Palette - Puregrain.
Palette. Presets - Puregrain.
Pixel - Puregrain.
Quantize - Puregrain.
SelfCheck