-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/

-- | Haskell bindings to SDL2_image
--   
--   Haskell bindings to SDL2_image
@package sdl2-image
@version 2.1.0.0

-- | Exposes a way to automatically generate a foreign import alongside its
--   lifted, inlined MonadIO variant. Use this to simplify the package's
--   SDL.Raw.* modules.
module SDL.Raw.Helper

-- | Given a name fname, a name of a C function cname and
--   the desired Haskell type ftype, this function generates:
--   
--   
--   
- A foreign import of cname, named as fname'.
--   
- An always-inline MonadIO version of fname', named
--   fname.
--   
liftF :: String -> String -> Q Type -> Q [Dec]

-- | Raw bindings to the SDL2_image library. No error-handling is
--   done here. For more information about specific function behaviour, see
--   the SDL2_image documentation.
module SDL.Raw.Image

-- | Should the Ptr RWops be freed after an operation? 1 for
--   yes, 0 for no.
type Free = CInt
load :: MonadIO m => CString -> m (Ptr Surface)
load_RW :: MonadIO m => Ptr RWops -> Free -> m (Ptr Surface)

-- | A case-insensitive desired format, e.g. "jpg" or
--   "PNG".
type Format = CString
loadTyped_RW :: MonadIO m => Ptr RWops -> Free -> Format -> m (Ptr Surface)
loadCUR_RW :: MonadIO m => Ptr RWops -> m (Ptr Surface)
loadICO_RW :: MonadIO m => Ptr RWops -> m (Ptr Surface)
loadBMP_RW :: MonadIO m => Ptr RWops -> m (Ptr Surface)
loadPNM_RW :: MonadIO m => Ptr RWops -> m (Ptr Surface)
loadXPM_RW :: MonadIO m => Ptr RWops -> m (Ptr Surface)
loadXCF_RW :: MonadIO m => Ptr RWops -> m (Ptr Surface)
loadPCX_RW :: MonadIO m => Ptr RWops -> m (Ptr Surface)
loadGIF_RW :: MonadIO m => Ptr RWops -> m (Ptr Surface)
loadJPG_RW :: MonadIO m => Ptr RWops -> m (Ptr Surface)
loadTIF_RW :: MonadIO m => Ptr RWops -> m (Ptr Surface)
loadPNG_RW :: MonadIO m => Ptr RWops -> m (Ptr Surface)
loadTGA_RW :: MonadIO m => Ptr RWops -> m (Ptr Surface)
loadLBM_RW :: MonadIO m => Ptr RWops -> m (Ptr Surface)
loadXV_RW :: MonadIO m => Ptr RWops -> m (Ptr Surface)
loadWEBP_RW :: MonadIO m => Ptr RWops -> m (Ptr Surface)
isCUR :: MonadIO m => Ptr RWops -> m CInt
isICO :: MonadIO m => Ptr RWops -> m CInt
isBMP :: MonadIO m => Ptr RWops -> m CInt
isPNM :: MonadIO m => Ptr RWops -> m CInt
isXPM :: MonadIO m => Ptr RWops -> m CInt
isXCF :: MonadIO m => Ptr RWops -> m CInt
isPCX :: MonadIO m => Ptr RWops -> m CInt
isGIF :: MonadIO m => Ptr RWops -> m CInt
isJPG :: MonadIO m => Ptr RWops -> m CInt
isTIF :: MonadIO m => Ptr RWops -> m CInt
isPNG :: MonadIO m => Ptr RWops -> m CInt
isLBM :: MonadIO m => Ptr RWops -> m CInt
isXV :: MonadIO m => Ptr RWops -> m CInt
isWEBP :: MonadIO m => Ptr RWops -> m CInt
type InitFlags = CInt
pattern IMG_INIT_JPG :: (Eq a, Num a) => a
pattern IMG_INIT_PNG :: (Eq a, Num a) => a
pattern IMG_INIT_TIF :: (Eq a, Num a) => a
pattern IMG_INIT_WEBP :: (Eq a, Num a) => a
init :: MonadIO m => InitFlags -> m InitFlags
getVersion :: MonadIO m => m (Ptr Version)
quit :: MonadIO m => m ()

-- | Bindings to the SDL2_image library. These should allow you to
--   load various types of images as SDL Surfaces, as well
--   as detect image formats.
--   
--   You can safely assume that any monadic function listed here is capable
--   of throwing an SDLException in case it encounters an error.
module SDL.Image

-- | Loads any given file of a supported image type as a Surface,
--   including TGA if the filename ends with ".tga".
--   
--   If you have TGA files that don't have names ending with
--   ".tga", use loadTGA instead.
load :: MonadIO m => FilePath -> m Surface

-- | Reads an image from a ByteString.
--   
--   This will work for all supported image types, except TGA. If
--   you need to decode a TGA ByteString, use
--   decodeTGA instead.
decode :: MonadIO m => ByteString -> m Surface

-- | Same as load, but returning a Texture instead.
--   
--   For TGA files not ending in ".tga", use loadTextureTGA
--   instead.
loadTexture :: MonadIO m => Renderer -> FilePath -> m Texture

-- | Same as decode, but returning a Texture instead.
--   
--   If you need to decode a TGA ByteString, use
--   decodeTextureTGA instead.
decodeTexture :: MonadIO m => Renderer -> ByteString -> m Texture

-- | If your TGA files aren't in a filename ending with
--   ".tga", you can load them using this function.
loadTGA :: MonadIO m => FilePath -> m Surface

-- | Reads a TGA image from a ByteString.
--   
--   Assumes the input is a TGA-formatted image.
decodeTGA :: MonadIO m => ByteString -> m Surface

-- | Same as loadTGA, only returning a Texture instead.
loadTextureTGA :: MonadIO m => Renderer -> FilePath -> m Texture

-- | Same as decodeTGA, but returns a Texture instead.
decodeTextureTGA :: MonadIO m => Renderer -> ByteString -> m Texture

-- | Tests whether a ByteString contains an image of a given format.
formattedAs :: Format -> ByteString -> Bool

-- | Tries to detect the image format by attempting formattedAs with
--   each possible Format.
--   
--   If you're trying to test for a specific format, use a specific
--   formattedAs directly instead.
format :: ByteString -> Maybe Format

-- | Each of the supported image formats.
data Format
CUR :: Format
ICO :: Format
BMP :: Format
PNM :: Format
XPM :: Format
XCF :: Format
PCX :: Format
GIF :: Format
LBM :: Format
XV :: Format
JPG :: Format
PNG :: Format
TIF :: Format
WEBP :: Format

-- | Initializes SDL2_image by loading support for the chosen
--   image formats. Explicit initialization is optional.
--   
--   You should call this function if you prefer to load image support
--   yourself, at a time when your process isn't as busy. Otherwise, image
--   support will be loaded dynamically when you attempt to load a
--   JPG, PNG, TIF or WEBP-formatted
--   file.
--   
--   You may call this function multiple times.
initialize :: (Foldable f, MonadIO m) => f InitFlag -> m ()

-- | Flags intended to be fed to initialize.
--   
--   Each designates early loading of support for a particular image
--   format.
data InitFlag

-- | Load support for reading JPG files.
InitJPG :: InitFlag

-- | Same, but for PNG files.
InitPNG :: InitFlag

-- | TIF files.
InitTIF :: InitFlag

-- | WEBP files.
InitWEBP :: InitFlag

-- | Gets the major, minor, patch versions of the linked
--   SDL2_image library.
version :: (Integral a, MonadIO m) => m (a, a, a)

-- | Cleans up any loaded image libraries, freeing memory. You only need to
--   call this function once.
quit :: MonadIO m => m ()
instance GHC.Internal.Enum.Bounded SDL.Image.Format
instance GHC.Internal.Enum.Bounded SDL.Image.InitFlag
instance GHC.Internal.Enum.Enum SDL.Image.Format
instance GHC.Internal.Enum.Enum SDL.Image.InitFlag
instance GHC.Classes.Eq SDL.Image.Format
instance GHC.Classes.Eq SDL.Image.InitFlag
instance GHC.Internal.Generics.Generic SDL.Image.Format
instance GHC.Internal.Generics.Generic SDL.Image.InitFlag
instance GHC.Classes.Ord SDL.Image.Format
instance GHC.Classes.Ord SDL.Image.InitFlag
instance GHC.Internal.Read.Read SDL.Image.Format
instance GHC.Internal.Read.Read SDL.Image.InitFlag
instance GHC.Internal.Show.Show SDL.Image.Format
instance GHC.Internal.Show.Show SDL.Image.InitFlag
