-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A wrapper around Sean Barrett's JPEG/PNG decoder -- -- Partial implementation of JPEG, PNG, TGA, BMP, PSD decoders, with a -- really simple API. @package stb-image @version 0.2 -- | A wrapper around stb_image, Sean Barrett's public domain -- JPEG/PNG decoder. The original can be found at -- http://nothings.org/stb_image.c. The version of -- stb_image used here is stbi-1.18. The current list -- of (partially) supported formats is JPEG, PNG, TGA, BMP, PSD. Please -- note that the library is not (fully) thread-safe! module Codec.Image.STB data Bitmap t :: * -> * type Image = Bitmap Word8 -- | Decodes an image from a compressed format stored in a strict -- ByteString. Supported formats (see stb_image.c for -- details!): -- -- -- -- If the operation fails, we return an error message. decodeImage :: ByteString -> IO (Either String Image) -- | Decodes an image, with the number of components per pixel forced by -- the user. decodeImage' :: Int -> ByteString -> IO (Either String Image) -- | Loads an image from a file. Catches IO exceptions and converts them to -- an error message. loadImage :: FilePath -> IO (Either String Image) -- | Force the number of components in the image. loadImage' :: FilePath -> Int -> IO (Either String Image)