{-# LINE 1 "FreeType/Support/Outline.hsc" #-}
{-# LANGUAGE ForeignFunctionInterface #-}
{-# LANGUAGE PatternSynonyms #-}
module FreeType.Support.Outline
(
FT_Outline (..)
, ft_Outline_New
, ft_Outline_With
, ft_Outline_Done
, ft_Outline_Copy
, ft_Outline_Translate
, ft_Outline_Transform
, ft_Outline_Embolden
, ft_Outline_EmboldenXY
, ft_Outline_Reverse
, ft_Outline_Check
, ft_Outline_Get_CBox
, ft_Outline_Get_BBox
, ft_Outline_Get_Bitmap
, ft_Outline_Render
, ft_Outline_Decompose
, FT_Outline_Funcs (..)
, FT_Outline_MoveToFunc
, FT_Outline_LineToFunc
, FT_Outline_ConicToFunc
, FT_Outline_CubicToFunc
, FT_Orientation
, pattern FT_ORIENTATION_TRUETYPE
, pattern FT_ORIENTATION_POSTSCRIPT
, pattern FT_ORIENTATION_FILL_RIGHT
, pattern FT_ORIENTATION_FILL_LEFT
, pattern FT_ORIENTATION_NONE
, ft_Outline_Get_Orientation
, pattern FT_OUTLINE_NONE
, pattern FT_OUTLINE_OWNER
, pattern FT_OUTLINE_EVEN_ODD_FILL
, pattern FT_OUTLINE_REVERSE_FILL
, pattern FT_OUTLINE_IGNORE_DROPOUTS
, pattern FT_OUTLINE_SMART_DROPOUTS
, pattern FT_OUTLINE_INCLUDE_STUBS
, pattern FT_OUTLINE_HIGH_PRECISION
, pattern FT_OUTLINE_SINGLE_PASS
) where
import FreeType.Circular.Types
import FreeType.Core.Types.Types
import FreeType.Exception.Internal
import FreeType.Support.Outline.Internal
import FreeType.Support.Outline.Types
import FreeType.Support.Scanline.Types
import Control.Exception
import Foreign.Marshal.Alloc
import Foreign.Marshal.Utils
import Foreign.Ptr
import Foreign.Storable
ft_Outline_New
:: FT_Library
-> FT_UInt
-> FT_Int
-> IO (Ptr FT_Outline)
ft_Outline_New lib points contours = do
outlinePtr <- malloc
ftError "ft_Outline_New" $ ft_Outline_New' lib points contours outlinePtr
return outlinePtr
ft_Outline_With
:: FT_Library
-> FT_UInt
-> FT_Int
-> (Ptr FT_Outline -> IO a)
-> IO a
ft_Outline_With lib points contours f =
alloca $ \outlinePtr -> do
ftError "ft_Outline_New" $ ft_Outline_New' lib points contours outlinePtr
finally (f outlinePtr) . ftError "ft_Outline_Done" $ ft_Outline_Done' lib outlinePtr
ft_Outline_Done
:: FT_Library
-> Ptr FT_Outline
-> IO ()
ft_Outline_Done lib outlinePtr = do
ftError "ft_Outline_Done" $ ft_Outline_Done' lib outlinePtr
free outlinePtr
ft_Outline_Copy
:: Ptr FT_Outline
-> Ptr FT_Outline
-> IO ()
ft_Outline_Copy =
autoError "ft_Outline_Copy" ft_Outline_Copy'
foreign import ccall "FT_Outline_Translate"
ft_Outline_Translate
:: Ptr FT_Outline
-> FT_Pos
-> FT_Pos
-> IO ()
ft_Outline_Transform
:: Ptr FT_Outline
-> FT_Matrix
-> IO ()
ft_Outline_Transform outlinePtr mat =
with mat $ \matPtr ->
ft_Outline_Transform' outlinePtr matPtr
ft_Outline_Embolden
:: Ptr FT_Outline
-> FT_Pos
-> IO ()
ft_Outline_Embolden =
autoError "ft_Outline_Embolden" ft_Outline_Embolden'
ft_Outline_EmboldenXY
:: Ptr FT_Outline
-> FT_Pos
-> FT_Pos
-> IO ()
ft_Outline_EmboldenXY =
autoError "ft_Outline_EmboldenXY" ft_Outline_EmboldenXY'
foreign import ccall "FT_Outline_Reverse"
ft_Outline_Reverse
:: Ptr FT_Outline
-> IO ()
ft_Outline_Check
:: Ptr FT_Outline
-> IO ()
ft_Outline_Check =
autoError "ft_Outline_Check" ft_Outline_Check'
ft_Outline_Get_CBox
:: Ptr FT_Outline
-> IO FT_BBox
ft_Outline_Get_CBox outlinePtr =
alloca $ \bboxPtr -> do
ft_Outline_Get_CBox' outlinePtr bboxPtr
peek bboxPtr
ft_Outline_Get_BBox
:: Ptr FT_Outline
-> IO FT_BBox
ft_Outline_Get_BBox outlinePtr =
alloca $ \bboxPtr -> do
ftError "ft_Outline_Get_BBox" $ ft_Outline_Get_BBox' outlinePtr bboxPtr
peek bboxPtr
ft_Outline_Get_Bitmap
:: FT_Library
-> Ptr FT_Outline
-> Ptr FT_Bitmap
-> IO ()
ft_Outline_Get_Bitmap =
autoError "ft_Outline_Get_Bitmap" ft_Outline_Get_Bitmap'
ft_Outline_Render
:: FT_Library
-> Ptr FT_Outline
-> Ptr FT_Raster_Params
-> IO ()
ft_Outline_Render =
autoError "ft_Outline_Render" ft_Outline_Render'
ft_Outline_Decompose
:: Ptr FT_Outline
-> FT_Outline_Funcs
-> Ptr ()
-> IO ()
ft_Outline_Decompose outlinePtr funcs dataPtr =
with funcs $ \funcsPtr ->
ftError "ft_Outline_Decompose" $ ft_Outline_Decompose' outlinePtr funcsPtr dataPtr
pattern FT_ORIENTATION_TRUETYPE
, FT_ORIENTATION_POSTSCRIPT
, FT_ORIENTATION_FILL_RIGHT
, FT_ORIENTATION_FILL_LEFT
, FT_ORIENTATION_NONE
:: (Eq a, Num a) => a
pattern FT_ORIENTATION_TRUETYPE = 0
{-# LINE 253 "FreeType/Support/Outline.hsc" #-}
pattern FT_ORIENTATION_POSTSCRIPT = 1
{-# LINE 254 "FreeType/Support/Outline.hsc" #-}
pattern FT_ORIENTATION_FILL_RIGHT = 0
{-# LINE 255 "FreeType/Support/Outline.hsc" #-}
pattern FT_ORIENTATION_FILL_LEFT = 1
{-# LINE 256 "FreeType/Support/Outline.hsc" #-}
pattern FT_ORIENTATION_NONE = 2
{-# LINE 257 "FreeType/Support/Outline.hsc" #-}
foreign import ccall "FT_Outline_Get_Orientation"
ft_Outline_Get_Orientation
:: Ptr FT_Outline
-> IO FT_Orientation
pattern FT_OUTLINE_NONE
, FT_OUTLINE_OWNER
, FT_OUTLINE_EVEN_ODD_FILL
, FT_OUTLINE_REVERSE_FILL
, FT_OUTLINE_IGNORE_DROPOUTS
, FT_OUTLINE_SMART_DROPOUTS
, FT_OUTLINE_INCLUDE_STUBS
, FT_OUTLINE_HIGH_PRECISION
, FT_OUTLINE_SINGLE_PASS
:: (Eq a, Num a) => a
pattern FT_OUTLINE_NONE = 0
{-# LINE 278 "FreeType/Support/Outline.hsc" #-}
pattern FT_OUTLINE_OWNER = 1
{-# LINE 279 "FreeType/Support/Outline.hsc" #-}
pattern FT_OUTLINE_EVEN_ODD_FILL = 2
{-# LINE 280 "FreeType/Support/Outline.hsc" #-}
pattern FT_OUTLINE_REVERSE_FILL = 4
{-# LINE 281 "FreeType/Support/Outline.hsc" #-}
pattern FT_OUTLINE_IGNORE_DROPOUTS = 8
{-# LINE 282 "FreeType/Support/Outline.hsc" #-}
pattern FT_OUTLINE_SMART_DROPOUTS = 16
{-# LINE 283 "FreeType/Support/Outline.hsc" #-}
pattern FT_OUTLINE_INCLUDE_STUBS = 32
{-# LINE 284 "FreeType/Support/Outline.hsc" #-}
pattern FT_OUTLINE_HIGH_PRECISION = 256
{-# LINE 285 "FreeType/Support/Outline.hsc" #-}
pattern FT_OUTLINE_SINGLE_PASS = 512
{-# LINE 286 "FreeType/Support/Outline.hsc" #-}