ContentsIndex
Graphics.Plot.Image
Description

A helper to load BMP files from disc and cache them in the display state. Uses GL.BMP, and only supports images loadable by it.

Also has functions for drawing directly into off-screen images.

Synopsis
cache :: IORef RenderState -> FilePath -> IO Image
new :: Int -> Int -> IO Image
free :: Image -> IO ()
clear :: Image -> Color -> IO ()
colorToWord32 :: Color -> Word32
plotPoint :: Image -> Color -> Int -> Int -> IO ()
plotRectangle :: Image -> Color -> Int -> Int -> Int -> Int -> IO ()
pointOffset :: Image -> Int -> Int -> Int
plotGrid :: Image -> [[Color]] -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> IO ()
Documentation
cache
:: IORef RenderStateThe current state
-> FilePathThe path to the image.
-> IO Image
Loads an image from the file system and caches it in the display state. Subsequent calls to cacheImage with the same path will return the previously loaded image.
new :: Int -> Int -> IO Image
Create an off-screen image with the given size.
free :: Image -> IO ()
Free an image.
clear :: Image -> Color -> IO ()
Clear an image with the specified color.
colorToWord32 :: Color -> Word32
Convert a color to it's low level Word32 representation for the Image.
plotPoint :: Image -> Color -> Int -> Int -> IO ()
Plot a single point into an image.
plotRectangle :: Image -> Color -> Int -> Int -> Int -> Int -> IO ()
Plot a rectangle with the given dimensions into an image.
pointOffset :: Image -> Int -> Int -> Int
Return the offset into the image for the given point.
plotGrid :: Image -> [[Color]] -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> IO ()
Produced by Haddock version 0.7