AC-Colour 1.1.4 → 1.1.5
raw patch · 3 files changed
+5/−48 lines, 3 filesdep −ghc-primPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependencies removed: ghc-prim
API changes (from Hackage documentation)
- Data.Colour.FastFloor: fast_floor :: Double -> Word8
Files
- AC-Colour.cabal +2/−9
- Data/Colour.hs +3/−4
- Data/Colour/FastFloor.hs +0/−35
AC-Colour.cabal view
@@ -1,6 +1,6 @@ Cabal-Version: >= 1.6 Name: AC-Colour -Version: 1.1.4 +Version: 1.1.5 Stability: Experimental Synopsis: Efficient RGB colour types. @@ -10,12 +10,6 @@ both @Double@ and @Word8@ channel types. It implements efficient conversions between the two (GHC-specific), and general arithmetic over colours. - . - Changes: - . - * Added sRGB support. - . - * Minor documentation improvements. Category: Data, Math, Numerical, Graphics License: BSD3 @@ -31,7 +25,6 @@ Data.Colour.Map Data.Colour.Word8 Data.Colour.Nonlinear - Data.Colour.FastFloor Data.Colour - Build-Depends: base >= 4 && < 5, ghc-prim >= 0.1.0.0 && < 0.3 + Build-Depends: base >= 4 && < 5 HS-Source-Dirs: .
Data/Colour.hs view
@@ -31,7 +31,6 @@ import Data.Colour.Double import Data.Colour.Word8 -import Data.Colour.FastFloor {- | Convert a 'Colour8' into a 'Colour'. Recall that @@ -58,7 +57,7 @@ cdemote :: Colour -> Colour8 cdemote (Colour r g b) = Colour8 { - red8 = fast_floor (r * 0xFF), - green8 = fast_floor (g * 0xFF), - blue8 = fast_floor (b * 0xFF) + red8 = floor (r * 0xFF), + green8 = floor (g * 0xFF), + blue8 = floor (b * 0xFF) }
− Data/Colour/FastFloor.hs
@@ -1,35 +0,0 @@-{-# LANGUAGE MagicHash #-} - -{- | - This module shouldn't need to exist. It exists because - GHC's implementation of 'floor' is currently (6.10.3) - very slow. See the following tickets: - - <http://hackage.haskell.org/trac/ghc/ticket/1434> - - <http://hackage.haskell.org/trac/ghc/ticket/2271> --} - -module Data.Colour.FastFloor where - -import GHC.Prim -import GHC.Types -import GHC.Word - -{- | - This is a special version of the regular 'floor' function. - It works by directly calling the low-level internal GHC - primitives, and thus is as fast as you'd expect for such - a trivial operation. - - (The standard 'floor' function does something crazy like - converting a @Double@ to a numerator/denominator @Integer@ - pair and then computing the integer part of the quotient as - an @Integer@, then truncating that to a @Word8@. Which, - obviously, is ludicrously slow.) - - Hopefully one day the need for this low-level hackery - will disappear. --} -fast_floor :: Double -> Word8 -fast_floor (D# d#) = W8# (int2Word# (double2Int# d#))