{-# LINE 1 "src/SDL/Raw/Rotozoom.hsc" #-}
{-|
{-# LINE 2 "src/SDL/Raw/Rotozoom.hsc" #-}

Module      : SDL.Raw.Rotozoom
Copyright   : (c) 2015 Siniša Biđin
License     : MIT
Maintainer  : sinisa@bidin.eu
Stability   : experimental

Raw bindings to the @SDL2_gfx@ library, specifically the surface rotation and
zoom functionality from @SDL2_rotozoom.h@.

-}

{-# OPTIONS_GHC -fno-warn-missing-signatures #-}

{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE TemplateHaskell #-}

module SDL.Raw.Rotozoom
  ( pattern SMOOTHING_ON
  , pattern SMOOTHING_OFF
  , rotozoom
  , rotozoomXY
  , rotozoomSize
  , rotozoomSizeXY
  , zoom
  , zoomSize
  , shrink
  , rotate90
  ) where


{-# LINE 33 "src/SDL/Raw/Rotozoom.hsc" #-}

import Foreign.C.Types (CDouble(..), CInt(..))
import Foreign.Ptr     (Ptr)
import SDL.Raw.Helper  (liftF)
import SDL.Raw.Types   (Surface(..))

pattern SMOOTHING_OFF = (0)
{-# LINE 40 "src/SDL/Raw/Rotozoom.hsc" #-}
pattern SMOOTHING_ON  = (1)
{-# LINE 41 "src/SDL/Raw/Rotozoom.hsc" #-}

liftF "rotozoom" "rotozoomSurface"
  [t|Ptr Surface -> CDouble -> CDouble -> CInt -> IO (Ptr Surface)|]

liftF "rotozoomXY" "rotozoomSurfaceXY"
  [t|Ptr Surface -> CDouble -> CDouble -> CDouble -> CInt -> IO (Ptr Surface)|]

liftF "rotozoomSize" "rotozoomSize"
  [t|CInt -> CInt -> CDouble -> CDouble -> Ptr CInt -> Ptr CInt -> IO ()|]

liftF "rotozoomSizeXY" "rotozoomSizeXY"
  [t|CInt -> CInt -> CDouble -> CDouble -> CDouble -> Ptr CInt -> Ptr CInt -> IO ()|]

liftF "zoom" "zoomSurface"
  [t|Ptr Surface -> CDouble -> CDouble -> CInt -> IO (Ptr Surface)|]

liftF "zoomSize" "zoomSize"
  [t|CInt -> CInt -> CDouble -> CDouble -> Ptr CInt -> Ptr CInt -> IO ()|]

liftF "shrink" "shrinkSurface"
  [t|Ptr Surface -> CInt -> CInt -> IO (Ptr Surface)|]

liftF "rotate90" "rotateSurface90Degrees"
  [t|Ptr Surface -> CInt -> IO (Ptr Surface)|]