Portability | non-portable (GHC only) |
---|---|
Stability | experimental |
Maintainer | marko.lauronen@pp1.inet.fi |
Safe Haskell | None |
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) Word8Source
Get image data as C-compatible StorableArray
hasAlphaChannel :: PNGImage -> BoolSource
Check if the image has alpha channel