-- 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 <tt>fname</tt>, a name of a C function <tt>cname</tt> and
--   the desired Haskell type <tt>ftype</tt>, this function generates:
--   
--   <ul>
--   <li>A foreign import of <tt>cname</tt>, named as <tt>fname'</tt>.</li>
--   <li>An always-inline MonadIO version of <tt>fname'</tt>, named
--   <tt>fname</tt>.</li>
--   </ul>
liftF :: String -> String -> Q Type -> Q [Dec]


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

-- | Should the <a>Ptr</a> <a>RWops</a> 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. <tt>"jpg"</tt> or
--   <tt>"PNG"</tt>.
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 <tt>SDL2_image</tt> library. These should allow you to
--   load various types of images as <tt>SDL</tt> <a>Surface</a>s, as well
--   as detect image formats.
--   
--   You can safely assume that any monadic function listed here is capable
--   of throwing an <a>SDLException</a> in case it encounters an error.
module SDL.Image

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

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

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

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

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

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

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

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

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

-- | Tries to detect the image format by attempting <a>formattedAs</a> with
--   each possible <a>Format</a>.
--   
--   If you're trying to test for a specific format, use a specific
--   <a>formattedAs</a> 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 <tt>SDL2_image</tt> 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
--   <tt>JPG</tt>, <tt>PNG</tt>, <tt>TIF</tt> or <tt>WEBP</tt>-formatted
--   file.
--   
--   You may call this function multiple times.
initialize :: (Foldable f, MonadIO m) => f InitFlag -> m ()

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

-- | Load support for reading <tt>JPG</tt> files.
InitJPG :: InitFlag

-- | Same, but for <tt>PNG</tt> files.
InitPNG :: InitFlag

-- | <tt>TIF</tt> files.
InitTIF :: InitFlag

-- | <tt>WEBP</tt> files.
InitWEBP :: InitFlag

-- | Gets the major, minor, patch versions of the linked
--   <tt>SDL2_image</tt> 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
