{-# LINE 1 "FreeType/Support/Bitmap.hsc" #-}
module FreeType.Support.Bitmap
(
ft_Bitmap_Init
, ft_Bitmap_With
, ft_Bitmap_Copy
, ft_Bitmap_Embolden
, ft_Bitmap_Convert
, ft_Bitmap_Blend
, ft_GlyphSlot_Own_Bitmap
, ft_Bitmap_Done
) where
import FreeType.Core.Base.Types
import FreeType.Core.Color.Types
import FreeType.Core.Types.Types
import FreeType.Exception.Internal
import FreeType.Support.Bitmap.Internal
import Control.Exception
import Foreign.Marshal.Alloc
import Foreign.Marshal.Utils
import Foreign.Ptr
import Foreign.Storable
ft_Bitmap_Init :: IO (Ptr FT_Bitmap)
ft_Bitmap_Init = do
bitmapPtr <- malloc
ft_Bitmap_Init' bitmapPtr
return bitmapPtr
ft_Bitmap_With
:: FT_Library
-> (Ptr FT_Bitmap -> IO a)
-> IO a
ft_Bitmap_With lib f =
alloca $ \bitmapPtr -> do
ft_Bitmap_Init' bitmapPtr
finally (f bitmapPtr) . ftError "ft_Bitmap_Done" $ ft_Bitmap_Done' lib bitmapPtr
ft_Bitmap_Copy
:: FT_Library
-> Ptr FT_Bitmap
-> Ptr FT_Bitmap
-> IO ()
ft_Bitmap_Copy =
autoError "ft_Bitmap_Copy" ft_Bitmap_Copy'
ft_Bitmap_Embolden
:: FT_Library
-> Ptr FT_Bitmap
-> FT_Pos
-> FT_Pos
-> IO ()
ft_Bitmap_Embolden =
autoError "ft_Bitmap_Embolden" ft_Bitmap_Embolden'
ft_Bitmap_Convert
:: FT_Library
-> Ptr FT_Bitmap
-> Ptr FT_Bitmap
-> FT_Int
-> IO ()
ft_Bitmap_Convert =
autoError "ft_Bitmap_Convert" ft_Bitmap_Convert'
ft_Bitmap_Blend
:: FT_Library
-> Ptr FT_Bitmap
-> FT_Vector
-> Ptr FT_Bitmap
-> FT_Vector
-> FT_Color
-> IO FT_Vector
ft_Bitmap_Blend lib source sourceOff target targetOff color =
with sourceOff $ \sourceOffPtr ->
with targetOff $ \targetOffPtr ->
with color $ \colorPtr -> do
ftError "ft_Bitmap_Blend"
$ ft_Bitmap_Blend' lib source sourceOffPtr target targetOffPtr colorPtr
peek targetOffPtr
ft_GlyphSlot_Own_Bitmap
:: FT_GlyphSlot
-> IO ()
ft_GlyphSlot_Own_Bitmap =
autoError "ft_GlyphSlot_Own_Bitmap" ft_GlyphSlot_Own_Bitmap'
ft_Bitmap_Done
:: FT_Library
-> Ptr FT_Bitmap
-> IO ()
ft_Bitmap_Done lib bitmapPtr = do
ftError "ft_Bitmap_Done" $ ft_Bitmap_Done' lib bitmapPtr
free bitmapPtr