This commit is contained in:
Louis Dalibard 2024-12-24 16:33:57 +01:00
parent 8f7f1c89ed
commit c4930a5629

View File

@ -14,7 +14,7 @@ loadImage :: String -- ^ Path to the file
-> IO DynamicImage -> IO DynamicImage
loadImage input = either error id <$> readImage input loadImage input = either error id <$> readImage input
mainProcess :: (String,Float,Float, String, String) -> IO () mainProcess :: (String,String,String, String, String) -> IO ()
mainProcess (polarity,primaryScaleDark,primaryScaleLight, input, output) = do mainProcess (polarity,primaryScaleDark,primaryScaleLight, input, output) = do
putStrLn $ "Processing " ++ input putStrLn $ "Processing " ++ input
@ -28,7 +28,7 @@ mainProcess (polarity,primaryScaleDark,primaryScaleLight, input, output) = do
writeFile output $ encode outputTable writeFile output $ encode outputTable
putStrLn $ "Saved to " ++ output putStrLn $ "Saved to " ++ output
parseArguments :: [String] -> Either String (String, Float,Float,String, String) parseArguments :: [String] -> Either String (String, String,String,String, String)
parseArguments [polarity, primaryScaleDark, primaryScaleLight,input, output] = Right (polarity,primaryScaleDark, primaryScaleLight, input, output) parseArguments [polarity, primaryScaleDark, primaryScaleLight,input, output] = Right (polarity,primaryScaleDark, primaryScaleLight, input, output)
parseArguments [_, _,_,_] = Left "Please specify an output file" parseArguments [_, _,_,_] = Left "Please specify an output file"
parseArguments [_, _,_] = Left "Please specify an image" parseArguments [_, _,_] = Left "Please specify an image"