Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- type Size = (Int, Int)
- type Animation = Float -> Picture
- initialize :: Size -> IO State
- pictureToImageRGB8 :: Size -> Color -> State -> Picture -> IO (Image PixelRGB8, Ptr (PixelBaseComponent PixelRGB8))
- pictureToImageRGBA8 :: Size -> Color -> State -> Picture -> IO (Image PixelRGBA8, Ptr (PixelBaseComponent PixelRGBA8))
- exportPictureToFormat :: (FilePath -> Image PixelRGBA8 -> IO ()) -> Size -> Color -> FilePath -> Picture -> IO ()
- exportPicturesToFormat :: (FilePath -> Image PixelRGBA8 -> IO ()) -> Size -> Color -> FilePath -> Animation -> [Float] -> IO ()
Documentation
initialize :: Size -> IO State Source #
If you want to write your own functions, call this function before pictureToImage*
:: Size | |
-> Color | Background color |
-> State | |
-> Picture | |
-> IO (Image PixelRGB8, Ptr (PixelBaseComponent PixelRGB8)) | image and a pointer to memory |
convert a gloss Picture
into an Image
.
The pointer should be freed after the image is no longer needed in memory
Use 'free ptr' to free the memory.
:: Size | |
-> Color | Background color |
-> State | |
-> Picture | |
-> IO (Image PixelRGBA8, Ptr (PixelBaseComponent PixelRGBA8)) | image and a pointer to memory |
convert a gloss Picture
into an Image
.
The pointer should be freed after the image is no longer needed in memory
Use 'free ptr' to free the memory.
exportPictureToFormat Source #
:: (FilePath -> Image PixelRGBA8 -> IO ()) | function that saves an intermediate representation to a format. Written with writeXY from Codec.Picture in mind |
-> Size | (width, heigth) |
-> Color | Background color |
-> FilePath | |
-> Picture | |
-> IO () |
Save a gloss Picture to a file.
exportPicturesToFormat Source #
:: (FilePath -> Image PixelRGBA8 -> IO ()) | function that saves an intermediate representation to a format. Written with writeXY from Codec.Picture in mind |
-> Size | (width, height) |
-> Color | background color |
-> FilePath | must contain "%d", will be replaced by frame number |
-> Animation | function that maps from point in time to Picture. analog to Gloss.Animation |
-> [Float] | list of points in time at which to evaluate the animation |
-> IO () |
Save a series of gloss Picture to files of spcified format.