Copyright | (c) Marko Lauronen 2008 |
---|---|
License | BSD |
Maintainer | marko.lauronen@pp1.inet.fi |
Stability | experimental |
Portability | non-portable (GHC only) |
Safe Haskell | None |
Language | Haskell98 |
A simple, pure Haskell PNG loader. Currently supports 24bit RGB(A) images with no interlacing. Also lacks support for color indexed (paletted) images.
The image is stored in a StorableArray for compatibility with OpenGL (the array supports getting Ptr Word8 to the image data using withStorableArray function).
Types
Functions
loadPNGFile :: FilePath -> IO (Either String PNGImage) Source
Load a PNG file, Left value contains a description of a problem as a String, if any
dimensions :: PNGImage -> (Width, Height) Source
Get dimensions of the image (in pixels)
imageData :: PNGImage -> StorableArray (Int, Int) Word8 Source
Get image data as C-compatible StorableArray
hasAlphaChannel :: PNGImage -> Bool Source
Check if the image has alpha channel