Copyright | (c) Alexey Kuleshevich 2018-2020 |
---|---|
License | BSD3 |
Maintainer | Alexey Kuleshevich <lehins@yandex.ru> |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- pattern Y' :: e -> Color (Y' cs) e
- pattern Y'A :: e -> e -> Color (Alpha (Y' cs)) e
- pattern Luma :: Color X e -> Color (Y' cs) e
- data Y' (cs :: Linearity -> Type)
- class Luma (cs :: Linearity -> Type) where
- newtype Weight cs e = Weight {
- unWeight :: e
- newtype Weights e = Weights {}
- rgbLuma :: forall cs i e' e. (Luma cs, RedGreenBlue cs i, Elevator e', Elevator e, RealFloat e) => Color (cs 'NonLinear) e' -> Color (Y' cs) e
- rgbLumaWeights :: forall cs e' e. (Luma cs, RealFloat e) => Color (cs 'NonLinear) e' -> Weights e
- toBaseLinearSpace :: forall cs e i. (RedGreenBlue cs i, Applicative (Color (cs 'Linear)), RealFloat e) => Color (Y' cs) e -> Color (cs 'Linear) e
Luma
data Y' (cs :: Linearity -> Type) Source #
Instances
(Typeable cs, Illuminant i, ColorSpace (cs 'Linear) i e, ColorSpace (cs 'NonLinear) i e, Luma cs, RedGreenBlue cs i) => ColorSpace (Y' cs) (i :: k) e Source # | |
Defined in Graphics.Color.Space.RGB.Luma toBaseModel :: Color (Y' cs) e -> Color (BaseModel (Y' cs)) e Source # fromBaseModel :: Color (BaseModel (Y' cs)) e -> Color (Y' cs) e Source # toBaseSpace :: Color (Y' cs) e -> Color (BaseSpace (Y' cs)) e Source # fromBaseSpace :: Color (BaseSpace (Y' cs)) e -> Color (Y' cs) e Source # luminance :: (Elevator a, RealFloat a) => Color (Y' cs) e -> Color (Y i) a Source # toColorXYZ :: (Elevator a, RealFloat a) => Color (Y' cs) e -> Color (XYZ i) a Source # fromColorXYZ :: (Elevator a, RealFloat a) => Color (XYZ i) a -> Color (Y' cs) e Source # | |
Functor (Color (Y' cs)) Source # |
|
Applicative (Color (Y' cs)) Source # |
|
Defined in Graphics.Color.Space.RGB.Luma pure :: a -> Color (Y' cs) a # (<*>) :: Color (Y' cs) (a -> b) -> Color (Y' cs) a -> Color (Y' cs) b # liftA2 :: (a -> b -> c) -> Color (Y' cs) a -> Color (Y' cs) b -> Color (Y' cs) c # (*>) :: Color (Y' cs) a -> Color (Y' cs) b -> Color (Y' cs) b # (<*) :: Color (Y' cs) a -> Color (Y' cs) b -> Color (Y' cs) a # | |
Foldable (Color (Y' cs)) Source # |
|
Defined in Graphics.Color.Space.RGB.Luma fold :: Monoid m => Color (Y' cs) m -> m # foldMap :: Monoid m => (a -> m) -> Color (Y' cs) a -> m # foldMap' :: Monoid m => (a -> m) -> Color (Y' cs) a -> m # foldr :: (a -> b -> b) -> b -> Color (Y' cs) a -> b # foldr' :: (a -> b -> b) -> b -> Color (Y' cs) a -> b # foldl :: (b -> a -> b) -> b -> Color (Y' cs) a -> b # foldl' :: (b -> a -> b) -> b -> Color (Y' cs) a -> b # foldr1 :: (a -> a -> a) -> Color (Y' cs) a -> a # foldl1 :: (a -> a -> a) -> Color (Y' cs) a -> a # toList :: Color (Y' cs) a -> [a] # null :: Color (Y' cs) a -> Bool # length :: Color (Y' cs) a -> Int # elem :: Eq a => a -> Color (Y' cs) a -> Bool # maximum :: Ord a => Color (Y' cs) a -> a # minimum :: Ord a => Color (Y' cs) a -> a # | |
Traversable (Color (Y' cs)) Source # |
|
Defined in Graphics.Color.Space.RGB.Luma | |
(Typeable cs, Elevator e) => ColorModel (Y' cs) e Source # |
|
Defined in Graphics.Color.Space.RGB.Luma type Components (Y' cs) e Source # toComponents :: Color (Y' cs) e -> Components (Y' cs) e Source # fromComponents :: Components (Y' cs) e -> Color (Y' cs) e Source # showsColorModelName :: Proxy (Color (Y' cs) e) -> ShowS Source # | |
Eq e => Eq (Color (Y' cs) e) Source # |
|
Ord e => Ord (Color (Y' cs) e) Source # |
|
Defined in Graphics.Color.Space.RGB.Luma compare :: Color (Y' cs) e -> Color (Y' cs) e -> Ordering # (<) :: Color (Y' cs) e -> Color (Y' cs) e -> Bool # (<=) :: Color (Y' cs) e -> Color (Y' cs) e -> Bool # (>) :: Color (Y' cs) e -> Color (Y' cs) e -> Bool # (>=) :: Color (Y' cs) e -> Color (Y' cs) e -> Bool # max :: Color (Y' cs) e -> Color (Y' cs) e -> Color (Y' cs) e # min :: Color (Y' cs) e -> Color (Y' cs) e -> Color (Y' cs) e # | |
(Typeable cs, Elevator e) => Show (Color (Y' cs) e) Source # |
|
Storable e => Storable (Color (Y' cs) e) Source # |
|
Defined in Graphics.Color.Space.RGB.Luma sizeOf :: Color (Y' cs) e -> Int # alignment :: Color (Y' cs) e -> Int # peekElemOff :: Ptr (Color (Y' cs) e) -> Int -> IO (Color (Y' cs) e) # pokeElemOff :: Ptr (Color (Y' cs) e) -> Int -> Color (Y' cs) e -> IO () # peekByteOff :: Ptr b -> Int -> IO (Color (Y' cs) e) # pokeByteOff :: Ptr b -> Int -> Color (Y' cs) e -> IO () # | |
newtype Color (Y' cs) e Source # | Constructor for Luma. |
type BaseModel (Y' cs) Source # | |
Defined in Graphics.Color.Space.RGB.Luma | |
type BaseSpace (Y' cs) Source # | |
Defined in Graphics.Color.Space.RGB.Luma | |
type Components (Y' cs) e Source # | |
Defined in Graphics.Color.Space.RGB.Luma |
Instances
Weights imposed on individual channels of a 3-component color
Since: 0.1.0
Instances
Functor Weights Source # | |
Eq e => Eq (Weights e) Source # | |
Floating e => Floating (Weights e) Source # | |
Defined in Graphics.Color.Model.X exp :: Weights e -> Weights e # log :: Weights e -> Weights e # sqrt :: Weights e -> Weights e # (**) :: Weights e -> Weights e -> Weights e # logBase :: Weights e -> Weights e -> Weights e # sin :: Weights e -> Weights e # cos :: Weights e -> Weights e # tan :: Weights e -> Weights e # asin :: Weights e -> Weights e # acos :: Weights e -> Weights e # atan :: Weights e -> Weights e # sinh :: Weights e -> Weights e # cosh :: Weights e -> Weights e # tanh :: Weights e -> Weights e # asinh :: Weights e -> Weights e # acosh :: Weights e -> Weights e # atanh :: Weights e -> Weights e # log1p :: Weights e -> Weights e # expm1 :: Weights e -> Weights e # | |
Fractional e => Fractional (Weights e) Source # | |
Num e => Num (Weights e) Source # | |
Defined in Graphics.Color.Model.X | |
Elevator e => Show (Weights e) Source # | |
rgbLuma :: forall cs i e' e. (Luma cs, RedGreenBlue cs i, Elevator e', Elevator e, RealFloat e) => Color (cs 'NonLinear) e' -> Color (Y' cs) e Source #
Convert a non-linear RGB pixel to a luma pixel
Since: 0.1.0
rgbLumaWeights :: forall cs e' e. (Luma cs, RealFloat e) => Color (cs 'NonLinear) e' -> Weights e Source #
Get the weights of a non-linear RGB color space that can be used for converting to Luma
Since: 0.1.4
toBaseLinearSpace :: forall cs e i. (RedGreenBlue cs i, Applicative (Color (cs 'Linear)), RealFloat e) => Color (Y' cs) e -> Color (cs 'Linear) e Source #
Convert Luma directly into the linear version of base space. This is equivalent to `dcctf . toBaseSpace`, but is a bit faster, since inverse transfer function is applied only once
Since: 0.3.0