| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Graphics.Gloss.Export
Contents
Description
Main module for exporting gloss pictures to image files, gif animations and juicy-pixels image datatypes The canvas seems limited to (1853,1025) beyond that it's transparent
Synopsis
- 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 ()
- exportPictureToPNG :: Size -> Color -> FilePath -> Picture -> IO ()
- exportPicturesToPNG :: Size -> Color -> FilePath -> Animation -> [Float] -> IO ()
- exportPictureToBitmap :: Size -> Color -> FilePath -> Picture -> IO ()
- exportPicturesToBitmap :: Size -> Color -> FilePath -> Animation -> [Float] -> IO ()
- exportPictureToTga :: Size -> Color -> FilePath -> Picture -> IO ()
- exportPicturesToTga :: Size -> Color -> FilePath -> Animation -> [Float] -> IO ()
- exportPictureToTiff :: Size -> Color -> FilePath -> Picture -> IO ()
- exportPicturesToTiff :: Size -> Color -> FilePath -> Animation -> [Float] -> IO ()
- exportPicturesToGif :: GifDelay -> GifLooping -> Size -> Color -> FilePath -> Animation -> [Float] -> IO ()
- type GifDelay = Int
- data GifLooping
For tinkering yourself
initialize :: Size -> IO State Source #
If you want to write your own functions, call this function before pictureToImage*
Arguments
| :: Size | (width, height) in pixels - as in Gloss.Display |
| -> Color | Background color |
| -> State | Result of |
| -> 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.
Arguments
| :: Size | (width, height) in pixels - as in Gloss.Display |
| -> Color | Background color |
| -> State | Result of |
| -> 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 #
Arguments
| :: (FilePath -> Image PixelRGBA8 -> IO ()) | function that saves an intermediate representation to a format. Written with writeXY from Codec.Picture in mind |
| -> Size | (width, heigth) in pixels - as in Gloss.Display |
| -> Color | Background color |
| -> FilePath | |
| -> Picture | |
| -> IO () |
Save a gloss Picture to a file.
exportPicturesToFormat Source #
Arguments
| :: (FilePath -> Image PixelRGBA8 -> IO ()) | function that saves an intermediate representation to a format. Written with writeXY from Codec.Picture in mind |
| -> Size | (width, height) in pixels - as in Gloss.Display |
| -> 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.
Writing to PNG
Save a gloss Picture as PNG
Arguments
| :: Size | width, height in pixels |
| -> Color | background color |
| -> FilePath | |
| -> 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 gloss animation as PNG
Writing to Bitmap
exportPictureToBitmap Source #
Save a gloss Picture as Bitmap
exportPicturesToBitmap Source #
Arguments
| :: Size | width, height in pixels |
| -> Color | background color |
| -> FilePath | |
| -> 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 gloss animation as Bitmap
Writing to Tga
Save a gloss Picture as Tga
Arguments
| :: Size | width, height in pixels |
| -> Color | background color |
| -> FilePath | |
| -> 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 gloss animation as Tga
Writing to Tiff
Save a gloss Picture as Tiff
Arguments
| :: Size | width, height in pixels |
| -> Color | background color |
| -> FilePath | |
| -> 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 gloss animation as Tiff
Writing to Gif
Arguments
| :: GifDelay | time between frames in centiseconds |
| -> GifLooping | |
| -> Size | width, height in pixels as in Gloss.Display |
| -> Color | background color |
| -> FilePath | |
| -> 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 gloss animation as PNG
Delay to wait before showing the next Gif image. The delay is expressed in 100th of seconds.
data GifLooping #
Help to control the behaviour of GIF animation looping.
Constructors
| LoopingNever | The animation will stop once the end is reached |
| LoopingForever | The animation will restart once the end is reached |
| LoopingRepeat Word16 | The animation will repeat n times before stoping |