fixed colors/comments of PGM

This commit is contained in:
2021-12-09 13:01:48 +01:00
parent 546b1961f8
commit 211dbae5a4
2 changed files with 6 additions and 8 deletions

View File

@@ -105,7 +105,7 @@
low-points))
; write a PGM file for given heightmap and low points
; max altitude (9) is white
; basin limits are grey
; basins are red-ish (brighter the higher the point)
; low points are bright green
;
@@ -148,20 +148,18 @@
(when (< y (- height 1))
(y-loop (+ y 1))))
; show basins as redish areas
; show low points as full green pixels
(for-each
(lambda (lp)
; red channel to max on pixels of basins
; show basins as redish areas
(visit-basin heightmap lp
(lambda (x y)
(let [(ofs (offset x y))]
(vector-set! data ofs 255))))
; green channel to max on pixels of low point
; show low points as bright green
(let [(ofs (offset (low-point-x lp) (low-point-y lp)))]
(vector-set! data ofs 255)
(vector-set! data ofs 0)
(vector-set! data (+ 1 ofs) 255)
(vector-set! data (+ 2 ofs) 255)))
(vector-set! data (+ 2 ofs) 0)))
low-points)
; write pixels to file

File diff suppressed because one or more lines are too long