Chapter 2 done

This commit is contained in:
Patrick Stevens
2021-04-03 11:48:17 +01:00
parent 0487ef0e20
commit c0da461a26
2 changed files with 8 additions and 6 deletions

View File

@@ -45,5 +45,7 @@ Global
{94792D42-3D22-4FAE-A15B-B89AAF6DB732}.Release|x64.Build.0 = Release|Any CPU
{94792D42-3D22-4FAE-A15B-B89AAF6DB732}.Release|x86.ActiveCfg = Release|Any CPU
{94792D42-3D22-4FAE-A15B-B89AAF6DB732}.Release|x86.Build.0 = Release|Any CPU
{AE2CD8DA-FFA5-49BE-B5C9-1A96A3928325}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AE2CD8DA-FFA5-49BE-B5C9-1A96A3928325}.Debug|Any CPU.Build.0 = Debug|Any CPU
EndGlobalSection
EndGlobal

View File

@@ -4,17 +4,17 @@ namespace RayTracing
module SampleImages =
let gradient (progressIncrement : float<progress> -> unit) : float<progress> * Image Async =
let pixelAt i j =
let pixelAt height width =
{
Red = (byte i)
Green = (byte j)
Blue = 64uy
Red = (byte width)
Green = 255uy - (byte height)
Blue = 63uy
}
256.0<progress>,
async {
return Array.init 256 (fun i ->
let output = Array.init 256 (pixelAt i)
return Array.init 256 (fun height ->
let output = Array.init 256 (pixelAt height)
progressIncrement 1.0<progress>
output
)