aboutsummaryrefslogtreecommitdiffstats
path: root/src/Main.hs
blob: 0e5141a1421e23361f4395f79f9fd33113caf6f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
module Main where

import qualified Data.ByteString as B
import qualified Data.Text       as T
import           PFM

fixIntensity :: Int -> Int -> PFMColour -> Double
fixIntensity sizeY y (PFMColour r g b) =
    sin (fromIntegral y / fromIntegral sizeY * pi) * (f r + f g + f b) / 3
    where
        f = realToFrac
fixIntensity _ _ _ = error "Mono not supported"

findSplit :: [Double] -> Int
findSplit = 

main :: IO ()
main = do
    im <- B.readFile "data/grace_latlong.pfm"
    let grace = revColour $ parse im
    let height = pfmHeight grace - 1
    let fixedIntensities = [fixIntensity height y <$> c | c <- pfmColour grace, y <- [0..height]]