packages feed

gloss-raster 1.9.1.1 → 1.9.2.1

raw patch · 3 files changed

+63/−17 lines, 3 filesdep ~glossdep ~gloss-renderingPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependency ranges changed: gloss, gloss-rendering

API changes (from Hackage documentation)

- Graphics.Gloss.Raster.Array: rgb8 :: Int -> Int -> Int -> Color
- Graphics.Gloss.Raster.Field: rgb8 :: Int -> Int -> Int -> Color
+ Graphics.Gloss.Raster.Array: rgb' :: Float -> Float -> Float -> Color
+ Graphics.Gloss.Raster.Array: rgbI :: Int -> Int -> Int -> Color
+ Graphics.Gloss.Raster.Array: rgbI' :: Int -> Int -> Int -> Color
+ Graphics.Gloss.Raster.Field: rgb' :: Float -> Float -> Float -> Color
+ Graphics.Gloss.Raster.Field: rgbI :: Int -> Int -> Int -> Color
+ Graphics.Gloss.Raster.Field: rgbI' :: Int -> Int -> Int -> Color

Files

Graphics/Gloss/Raster/Array.hs view
@@ -17,7 +17,8 @@ module Graphics.Gloss.Raster.Array         ( -- * Color           module Graphics.Gloss.Data.Color-        , rgb, rgb8, rgb8w+        , rgb,  rgbI, rgb8w+        , rgb', rgbI'            -- * Display functions         , Display       (..)@@ -29,9 +30,11 @@ import Graphics.Gloss.Data.Color import Graphics.Gloss.Data.Picture import Graphics.Gloss.Data.Display+import Graphics.Gloss.Data.Bitmap import Graphics.Gloss.Interface.Pure.Game import Graphics.Gloss.Interface.IO.Animate import Graphics.Gloss.Interface.IO.Game+import Graphics.Gloss.Rendering import Data.Word import System.IO.Unsafe import Unsafe.Coerce@@ -45,7 +48,7 @@ -- Color ---------------------------------------------------------------------- -- | Construct a color from red, green, blue components. --  ---   Each component is clipped to the range [0..1]+--   Each component is clamped to the range [0..1] rgb  :: Float -> Float -> Float -> Color rgb r g b   = makeColor r g b 1.0 {-# INLINE rgb #-}@@ -53,16 +56,36 @@  -- | Construct a color from red, green, blue components. -----   Each component is clipped to the range [0..255]-rgb8 :: Int -> Int -> Int -> Color-rgb8 r g b  = makeColor8 r g b 255-{-# INLINE rgb8 #-}+--   Each component is clamped to the range [0..255]+rgbI :: Int -> Int -> Int -> Color+rgbI r g b  = makeColorI r g b 255+{-# INLINE rgbI #-}   -- | Construct a color from red, green, blue components. rgb8w :: Word8 -> Word8 -> Word8 -> Color-rgb8w r g b = makeColor8 (fromIntegral r) (fromIntegral g) (fromIntegral b) 255+rgb8w r g b = makeRawColorI (fromIntegral r) (fromIntegral g) (fromIntegral b) 255 {-# INLINE rgb8w #-}+++-- | Like `rgb`, but take pre-clamped components for speed.+--+--   If you're building a new color for every pixel then use this version, +--   however if your components are out of range then the picture you get will+--   be implementation dependent.+rgb' :: Float -> Float -> Float -> Color+rgb' r g b  = makeRawColor r g b 1.0+{-# INLINE rgb' #-}+++-- | Like `rgbI`, but take pre-clamped components for speed.+--+--   If you're building a new color for every pixel then use this version, +--   however if your components are out of range then the picture you get will+--   be implementation dependent.+rgbI' :: Int -> Int -> Int -> Color+rgbI' r g b  = makeRawColorI r g b 255+{-# INLINE rgbI' #-}   -- Animate --------------------------------------------------------------------
Graphics/Gloss/Raster/Field.hs view
@@ -18,7 +18,8 @@ module Graphics.Gloss.Raster.Field         ( -- * Color           module Graphics.Gloss.Data.Color-        , rgb, rgb8, rgb8w+        , rgb,  rgbI, rgb8w+        , rgb', rgbI'            -- * Display functions         , Display       (..)@@ -33,8 +34,10 @@ import Graphics.Gloss.Data.Color import Graphics.Gloss.Data.Picture import Graphics.Gloss.Data.Display+import Graphics.Gloss.Data.Bitmap import Graphics.Gloss.Interface.Pure.Game import Graphics.Gloss.Interface.IO.Animate+import Graphics.Gloss.Rendering import Data.Word import System.IO.Unsafe import Unsafe.Coerce@@ -48,7 +51,7 @@ -- Color ---------------------------------------------------------------------- -- | Construct a color from red, green, blue components. --  ---   Each component is clipped to the range [0..1]+--   Each component is clamped to the range [0..1] rgb  :: Float -> Float -> Float -> Color rgb r g b   = makeColor r g b 1.0 {-# INLINE rgb #-}@@ -56,16 +59,36 @@  -- | Construct a color from red, green, blue components. -----   Each component is clipped to the range [0..255]-rgb8 :: Int -> Int -> Int -> Color-rgb8 r g b  = makeColor8 r g b 255-{-# INLINE rgb8 #-}+--   Each component is clamped to the range [0..255]+rgbI :: Int -> Int -> Int -> Color+rgbI r g b  = makeColorI r g b 255+{-# INLINE rgbI #-}   -- | Construct a color from red, green, blue components. rgb8w :: Word8 -> Word8 -> Word8 -> Color-rgb8w r g b = makeColor8 (fromIntegral r) (fromIntegral g) (fromIntegral b) 255+rgb8w r g b = makeRawColorI (fromIntegral r) (fromIntegral g) (fromIntegral b) 255 {-# INLINE rgb8w #-}+++-- | Like `rgb`, but take pre-clamped components for speed.+--+--   If you're building a new color for every pixel then use this version, +--   however if your components are out of range then the picture you get will+--   be implementation dependent.+rgb' :: Float -> Float -> Float -> Color+rgb' r g b  = makeRawColor r g b 1.0+{-# INLINE rgb' #-}+++-- | Like `rgbI`, but take pre-clamped components for speed.+--+--   If you're building a new color for every pixel then use this version, +--   however if your components are out of range then the picture you get will+--   be implementation dependent.+rgbI' :: Int -> Int -> Int -> Color+rgbI' r g b  = makeRawColorI r g b 255+{-# INLINE rgbI' #-}   -- Animate --------------------------------------------------------------------
gloss-raster.cabal view
@@ -1,5 +1,5 @@ Name:                gloss-raster-Version:             1.9.1.1+Version:             1.9.2.1 License:             MIT License-file:        LICENSE Author:              Ben Lippmeier@@ -26,8 +26,8 @@         ghc-prim   == 0.3.*,         containers == 0.5.*,         repa       == 3.3.*,-        gloss      == 1.9.1.*,-        gloss-rendering == 1.9.1.*+        gloss      == 1.9.2.*,+        gloss-rendering == 1.9.2.*    ghc-options:         -Odph -fno-liberate-case