gloss-raster-massiv-0.1.1.5: Massiv-based alternative for gloss-raster
Copyright(c) Matthew Mosior 2023
LicenseBSD-style
Maintainermattm.github@gmail.com
Portabilityportable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Graphics.Gloss.Raster.Array

Description

Massiv-based alternative for gloss-raster

This library utilizes massiv's superb performance characteristics to supply alternative rasterization functionality to that which is provided by the gloss-raster package.

Synopsis

Graphics.Gloss.Raster.Array Replacement functions - Display functions

animateArrayMassiv Source #

Arguments

:: Display

Display mode.

-> (Int, Int)

Number of pixels to draw per element.

-> (Float -> Array S Ix2 ColorMassiv)

A function to construct a delayed array for the given time. The function should return an array of the same extent each time it is applied.

It is passed the time in seconds since the program started.

-> IO () 

A more performant replacement of animateArray found in Graphics.Gloss.Raster.Array.

Animate a bitmap generated from a Massiv array.

playArrayMassiv Source #

Arguments

:: Display

Display mode.

-> (Int, Int)

Number of pixels to draw per element.

-> Int

Number of simulation steps to take for each second of real time

-> world

The initial world.

-> (world -> Array S Ix2 ColorMassiv)

Function to convert the world to an array.

-> (Event -> world -> world)

Function to handle input events.

-> (Float -> world -> world)

Function to step the world one iteration. It is passed the time in seconds since the program started.

-> IO () 

A more performant replacement of playArray found in Graphics.Gloss.Raster.Array.

Play with a bitmap generated from a Massiv array.

animateArrayMassivIO Source #

Arguments

:: Display

Display mode.

-> (Int, Int)

Number of pixels to draw per element.

-> (Float -> IO (Array S Ix2 ColorMassiv))

A function to construct a delayed array for the given time. The function should return an array of the same extent each time it is applied.

It is passed the time in seconds since the program started.

-> IO () 

A more performant replacement of animateArrayIO found in Graphics.Gloss.Raster.Array.

Animate a bitmap generated from a Massiv array, via the IO monad.

playArrayMassivIO Source #

Arguments

:: Display

Display mode.

-> (Int, Int)

Number of pixels to draw per element.

-> Int

Number of simulation steps to take for each second of real time

-> world

The initial world.

-> (world -> IO (Array S Ix2 ColorMassiv))

Function to convert the world to an array.

-> (Event -> world -> IO world)

Function to handle input events.

-> (Float -> world -> IO world)

Function to step the world one iteration. It is passed the time in seconds since the program started.

-> IO () 

A more performant replacement of playArrayIO found in Graphics.Gloss.Raster.Array.

Play with a bitmap generated from a Massiv array, via the IO monad.

makeFrame :: (Int, Int) -> Array S Ix2 ColorMassiv -> Picture Source #

A more performant replacement of makeFrame found in Graphics.Gloss.Raster.Array.

sizeOfDisplay :: Display -> IO (Int, Int) Source #

Function that takes a display and returns a tuple of the x and y scale.