Copyright | (c) Alexey Kuleshevich 2019-2020 |
---|---|
License | BSD3 |
Maintainer | Alexey Kuleshevich <lehins@yandex.ru> |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- pattern SRGB :: Color RGB e -> Color SRGB e
- pattern ColorSRGB :: e -> e -> e -> Color SRGB e
- pattern ColorSRGBA :: e -> e -> e -> e -> Color (Alpha SRGB) e
- data SRGB
- data D50
- data D65
- primaries :: RealFloat e => Gamut rgb i e
- npmStandard :: RealFloat a => NPM SRGB a
- inpmStandard :: RealFloat a => INPM SRGB a
- transfer :: (Ord a, Floating a) => a -> a
- itransfer :: (Ord a, Floating a) => a -> a
Constructors for a sRGB color space.
pattern ColorSRGB :: e -> e -> e -> Color SRGB e Source #
Constructor for a color in sRGB
color space
Since: 0.1.0
pattern ColorSRGBA :: e -> e -> e -> e -> Color (Alpha SRGB) e Source #
Constructor for a color in sRGB
color space with alphs channel
Since: 0.1.0
Instances
This is an approximation of CIE1931 D50
white point defined in ICC PCS. Useful for chromatic adaptation.
>>>
whitePoint :: WhitePoint D50 Double
WhitePoint (Chromaticity <CIExyY * D50:( 0.345702914919, 0.358538596680)>)>>>
whitePointTristimulus :: Color (XYZ D50) Float
<XYZ * D50:( 0.964200, 1.000000, 0.824900)>>>>
colorTemperature :: CCT D50
CCT {unCCT = 5003.0}
Since: 0.1.0
Instances
Illuminant D50 Source # | Tristimulus |
Defined in Graphics.Color.Illuminant.ICC.PCS type Temperature D50 :: n Source # whitePoint :: RealFloat e => WhitePoint D50 e Source # | |
type Temperature D50 Source # | |
Defined in Graphics.Color.Illuminant.ICC.PCS |
Whitepoint D65 that is so commonly used for sRGB and other color spaces defined by
ITU: Rec.601 (525 and 625) and Rec.709 standards. It is slightly different than
D65
that is defined by CIE1931 and
D65
specified in Rec.470.
>>>
whitePoint :: WhitePoint D65 Float
WhitePoint (Chromaticity <CIExyY * D65:( 0.312700, 0.329000)>)>>>
whitePointTristimulus :: Color (XYZ D65) Float
<XYZ * D65:( 0.950456, 1.000000, 1.089058)>>>>
colorTemperature :: CCT D65
CCT {unCCT = 6504.0}
Since: 0.1.0
Instances
primaries :: RealFloat e => Gamut rgb i e Source #
Primaries for ITU-R BT.709, which are also the primaries for sRGB color space.
Since: 0.1.0
npmStandard :: RealFloat a => NPM SRGB a Source #
sRGB normalized primary matrix. This is a helper definition, use npm
instead.
>>>
:set -XDataKinds
>>>
import Graphics.Color.Space.RGB
>>>
npmStandard :: NPM SRGB Float
[ [ 0.412400, 0.357600, 0.180500 ] , [ 0.212600, 0.715200, 0.072200 ] , [ 0.019300, 0.119200, 0.950500 ] ]
Since: 0.1.0
inpmStandard :: RealFloat a => INPM SRGB a Source #
sRGB inverse normalized primary matrix. This is a helper definition, use inpm
instead.
>>>
:set -XDataKinds
>>>
import Graphics.Color.Space.RGB
>>>
inpmStandard :: INPM SRGB Float
[ [ 3.240600,-1.537200,-0.498600 ] , [-0.968900, 1.875800, 0.041500 ] , [ 0.055700,-0.204000, 1.057000 ] ]
Since: 0.1.0
transfer :: (Ord a, Floating a) => a -> a Source #
sRGB transfer function "gamma". This is a helper function, therefore ecctf
should be used
instead.
\[ \gamma(u) = \begin{cases} 12.92 u & u \leq 0.0031308 \\ 1.055 u^{1/2.4} - 0.055 & \text{otherwise} \end{cases} \]
Since: 0.1.0
itransfer :: (Ord a, Floating a) => a -> a Source #
sRGB inverse transfer function "gamma". This is a helper function, therefore dcctf
should
be used instead.
\[ \gamma^{-1}(u) = \begin{cases} u / 12.92 & u \leq 0.04045 \\ \left(\tfrac{u + 0.055}{1.055}\right)^{2.4} & \text{otherwise} \end{cases} \]
Since: 0.1.0