styled code a bit.

This commit is contained in:
Nicole Dresselhaus 2015-12-03 23:45:05 +01:00
parent f545662a47
commit 0a115a51a3

View File

@ -14,8 +14,8 @@ import System.IO (stdin)
data Options = Options data Options = Options
{ srcFile :: String { srcFile :: String
, width :: Int , width :: Int
, height :: Int , height :: Int
} }
options :: Parser Options options :: Parser Options
@ -55,12 +55,12 @@ conv (fp@(PixelRGB8 fr fg fb),PixelRGB8 br bg bb) = printf "\x1b[48;2;%d;%d;%dm\
where where
lumi :: Word8 -> Char lumi :: Word8 -> Char
lumi x lumi x
| x > 225 = '@' | x > 225 = '@'
| x > 180 = 'O' | x > 180 = 'O'
| x > 150 = 'X' | x > 150 = 'X'
| x > 50 = 'o' | x > 50 = 'o'
| x > 25 = 'x' | x > 25 = 'x'
| x > 10 = '.' | x > 10 = '.'
| otherwise = ' ' | otherwise = ' '
img2ascii :: ((PixelRGB8,PixelRGB8) -> String) -> (Image PixelRGB8,Image PixelRGB8) -> [[String]] img2ascii :: ((PixelRGB8,PixelRGB8) -> String) -> (Image PixelRGB8,Image PixelRGB8) -> [[String]]