options -- start
This commit is contained in:
parent
329bf273a5
commit
fd3996e926
1 changed files with 17 additions and 2 deletions
19
src/Main.hs
19
src/Main.hs
|
|
@ -17,6 +17,20 @@ import qualified Data.Array.Repa as R
|
|||
import qualified Data.Vector as Vec
|
||||
import qualified Debug.Trace as DT
|
||||
|
||||
data Options = Options {
|
||||
nRounds :: Int,
|
||||
nTrianglesPerRound :: Int,
|
||||
gen :: Maybe StdGen
|
||||
}
|
||||
|
||||
defaultOpts = Options {
|
||||
nRounds = 3,
|
||||
nTrianglesPerRound = 100,
|
||||
gen = Nothing
|
||||
}
|
||||
|
||||
|
||||
|
||||
genList :: StdGen -> [StdGen]
|
||||
genList = map mkStdGen . randoms
|
||||
|
||||
|
|
@ -58,8 +72,9 @@ renderTriangles image nRounds dimensions areaCoeff nTrianglesPerRound gen round'
|
|||
. genList
|
||||
$ gen
|
||||
|
||||
genImage :: String -> Int -> Int -> Double -> Int -> IO (Diagram B)
|
||||
genImage name nRounds nTrianglesPerRound areaCoeff randSeed = do
|
||||
genImage :: String -> Int -> Int -> Double -> IO (Diagram B)
|
||||
genImage name areaCoeff = do
|
||||
let
|
||||
image <- Img.readImageRGB VU name
|
||||
let img' = convImage image
|
||||
let dimensions = (rows image, cols image)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue