colour 1.0.0 → 1.1.0
raw patch · 3 files changed
+45/−4 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Data.Colour.SRGB.Linear: rgb :: (Fractional a) => a -> a -> a -> Colour a
+ Data.Colour.SRGB.Linear: toRGB :: (Fractional a) => Colour a -> RGB a
Files
- Data/Colour/SRGB/Linear.hs +41/−0
- Tests.hs +2/−3
- colour.cabal +2/−1
+ Data/Colour/SRGB/Linear.hs view
@@ -0,0 +1,41 @@+{-+Copyright (c) 2008+Russell O'Connor++Permission is hereby granted, free of charge, to any person obtaining a copy+of this software and associated documentation files (the "Software"), to deal+in the Software without restriction, including without limitation the rights+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell+copies of the Software, and to permit persons to whom the Software is+furnished to do so, subject to the following conditions:++The above copyright notice and this permission notice shall be included in+all copies or substantial portions of the Software.++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN+THE SOFTWARE.+-}+-- |Provides a /linear/ colour space with the same gamut as+-- "Data.Colour.SRGB".+module Data.Colour.SRGB.Linear + (rgb, toRGB+ )+where++import Data.Colour.Internal+import Data.Colour.RGB++-- |Constructs a 'Colour' from RGB values using the /linear/ RGB colour+-- with the same gamut as sRGB.+rgb :: Fractional a => a -> a -> a -> Colour a+rgb = rgb709++-- |Return RGB values using the /linear/ RGB colour with the same gamut+-- as sRGB.+toRGB :: Fractional a => Colour a -> RGB a+toRGB = toRGB709
Tests.hs view
@@ -177,12 +177,11 @@ prop_fromToSRGB :: Word8 -> Word8 -> Word8 -> Bool prop_fromToSRGB r' g' b' = toSRGB24 (sRGB24 r' g' b') == RGB r' g' b'-+{- prop_fromToY'CbCr709 :: Word8 -> Word8 -> Word8 -> Bool prop_fromToY'CbCr709 y' cb cr = HDTV.toY'CbCr (HDTV.y'CbCr y' cb cr) == (y',cb,cr) -{- prop_fromToY'CbCr601 :: Word8 -> Word8 -> Word8 -> Bool prop_fromToY'CbCr601 y' cb cr = SDTV.toY'CbCr (SDTV.y'CbCr y' cb cr) == (y',cb,cr)@@ -273,7 +272,7 @@ ,("XYZ-from-to", test prop_fromToXYZ) ,("sRGB-to-from", test prop_toFromSRGB) ,("sRGB-from-to", test prop_fromToSRGB)- ,("Y'CbCr-709-from-to", test prop_fromToY'CbCr709)+-- ,("Y'CbCr-709-from-to", test prop_fromToY'CbCr709) -- ,("Y'CbCr-601-from-to", test prop_fromToY'CbCr601) ,("disolve-id", test prop_disolveId) ,("disolve-transparent", test prop_disolveTransparent)
colour.cabal view
@@ -1,5 +1,5 @@ Name: colour-Version: 1.0.0+Version: 1.1.0 Cabal-Version: >= 1.2 License: OtherLicense License-file: LICENSE@@ -19,6 +19,7 @@ Build-Depends: base Exposed-Modules: Data.Colour Data.Colour.SRGB+ Data.Colour.SRGB.Linear Data.Colour.RGBSpace Data.Colour.Names Other-Modules: Data.Colour.Internal