gd 3000.6 → 3000.6.1
raw patch · 2 files changed
+18/−2 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Graphics.GD: alphaBlending :: Bool -> Image -> IO ()
+ Graphics.GD: saveAlpha :: Bool -> Image -> IO ()
Files
- Graphics/GD.hsc +17/−1
- gd.cabal +1/−1
Graphics/GD.hsc view
@@ -38,7 +38,11 @@ drawString, measureString, drawStringCircle, -- * Colors- rgb, rgba, toRGBA+ rgb, rgba, toRGBA,+ -- * Misc+ saveAlpha,+ alphaBlending,+ ) where import Control.Exception (bracket)@@ -202,6 +206,12 @@ a = shiftR c 24 `mod` byte byte = 2 ^ (8::Int) +foreign import ccall "gd.h gdImageSaveAlpha" gdImageSaveAlpha+ :: Ptr GDImage -> CInt -> IO ()++foreign import ccall "gd.h gdImageAlphaBlending" gdImageAlphaBlending+ :: Ptr GDImage -> CInt -> IO ()+ -- We use a second level of indirection to allow storing a null pointer -- when the image has already been freed. This allows 'withImage' to -- free the @gdImage@ early.@@ -580,6 +590,12 @@ (double textFill) cFontName (double fontSize) cTopTxt cBottomTxt color unless (res == F.nullPtr) (C.peekCAString res >>= ioError . userError)++saveAlpha :: Bool -> Image -> IO ()+saveAlpha b i = withImagePtr i $ \p -> gdImageSaveAlpha p $ if b then 1 else 0++alphaBlending :: Bool -> Image -> IO ()+alphaBlending b i = withImagePtr i $ \p -> gdImageAlphaBlending p $ if b then 1 else 0 -- -- * Colors
gd.cabal view
@@ -1,7 +1,7 @@ Name: gd Category: Graphics License-File: LICENSE-Version: 3000.6+Version: 3000.6.1 Cabal-version: >= 1.2 Build-type: Simple Copyright: Bjorn Bringert