repa-algorithms-3.4.1.4: Algorithms using the Repa array library.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Array.Repa.Algorithms.Pixel

Description

Utilities for converting pixel color values.

NOTE: These functions are not polymorphic in the Float type because without assisatance, GHC does a bad job of converting Word8s to and from floats.

Synopsis

Documentation

floatRmsOfRGB8 :: (Word8, Word8, Word8) -> Float Source #

Compute the root mean square of an RGB color. Result is in the range [0..1].

doubleRmsOfRGB8 :: (Word8, Word8, Word8) -> Float Source #

Compute the root mean square of an RGB color. Result is in the range [0..1].

floatLuminanceOfRGB8 :: (Word8, Word8, Word8) -> Float Source #

Convert an RGB color to its luminance value. Result in the range [0..1].

doubleLuminanceOfRGB8 :: (Word8, Word8, Word8) -> Double Source #

Convert an RGB color to its luminance value. Result in the range [0..1].

rgb8OfGreyFloat :: Float -> (Word8, Word8, Word8) Source #

Promote a value in the range [0..1] to a grey RGB8 color.

rgb8OfGreyDouble :: Double -> (Word8, Word8, Word8) Source #

Promote a value in the range [0..1] to a grey RGB8 color.

rgb8OfFloat :: (Float, Float, Float) -> (Word8, Word8, Word8) Source #

Promote a tuple of color components to a RGB8 color. Each of the source components should be in the range [0..1].

rgb8OfDouble :: (Double, Double, Double) -> (Word8, Word8, Word8) Source #

Promote a tuple of color components to a RGB8 color. Each of the source components should be in the range [0..1].