added juicypixels, added gray dummy-image for output
This commit is contained in:
parent
0bac190174
commit
89a83a1579
1
.gitignore
vendored
1
.gitignore
vendored
@ -2,3 +2,4 @@
|
||||
cabal.sandbox.config
|
||||
dist/
|
||||
*.swp
|
||||
out.png
|
||||
|
@ -62,7 +62,8 @@ executable raytrace
|
||||
build-depends: base >=4.7 && <4.8,
|
||||
attoparsec >= 0.12,
|
||||
bytestring >= 0.10,
|
||||
linear >= 1.10
|
||||
linear >= 1.10,
|
||||
JuicyPixels >= 3.1
|
||||
|
||||
-- Directories containing source files.
|
||||
-- hs-source-dirs:
|
||||
|
10
src/Main.hs
10
src/Main.hs
@ -2,6 +2,8 @@
|
||||
module Main where
|
||||
|
||||
import Control.Applicative
|
||||
import Codec.Picture.Png
|
||||
import Codec.Picture.Types
|
||||
import qualified Data.ByteString as B
|
||||
import qualified Data.ByteString.Char8 as B8
|
||||
|
||||
@ -65,8 +67,9 @@ validateScene obs = do
|
||||
, sceneObjects = objects
|
||||
}
|
||||
|
||||
render :: Scene -> IO ()
|
||||
render s = putStrLn "rendering currently not implemented"
|
||||
render :: Scene -> Image PixelRGB8
|
||||
render s = generateImage pixelRenderer 250 300
|
||||
where pixelRenderer x y = PixelRGB8 128 128 128
|
||||
|
||||
main :: IO ()
|
||||
main = do
|
||||
@ -80,4 +83,5 @@ main = do
|
||||
Left error -> putStrLn $ "Error: " ++ error
|
||||
Right s -> do
|
||||
print s
|
||||
render s
|
||||
im <- return $ render s
|
||||
writePng "out.png" im
|
||||
|
Loading…
Reference in New Issue
Block a user