main formatting & cleanup

This commit is contained in:
Jack Wines 2024-02-06 20:28:25 -08:00
parent 5f98759aee
commit a1337127e0
No known key found for this signature in database
GPG key ID: 25B20640600571E6

View file

@ -105,7 +105,9 @@ deriving instance Generic (CL.RGB a)
deriving instance NFData a => NFData (CL.RGB a)
toDimensionVector :: (Int.BaseArray arr cs e, Fractional n) => Image arr cs e -> SizeSpec V2 n
toDimensionVector image = Diagrams.Prelude.dims $ p2 (fromIntegral $ cols image, fromIntegral $ rows image) .-. p2 (0.0, 0.0)
toDimensionVector image =
Diagrams.Prelude.dims $
p2 (fromIntegral $ cols image, fromIntegral $ rows image) .-. p2 (0.0, 0.0)
data CLIOptions = CLIOptions
{ input :: FilePath
@ -119,11 +121,8 @@ instance ParseRecord CLIOptions
main :: IO ()
main = do
CLIOptions{..} <- getRecord "image options"
let (Options{gen = gen}) = defaultOpts
gen' <- getStdGen -- for consistency, swap with something like: pure . mkStdGen $ 2344
let gens :: [StdGen] = map fst . iterate (split . snd) . split $ gen'
print gen'
image <- Img.readImageRGB VU input
let nums = zip gens $ map show [0 .. 60]
let dimVector = toDimensionVector image
renderSVG output dimVector (genImage' image gen' cornerCount)