Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,22 @@
|
|||
(define (write-ppm image file)
|
||||
(define (write-image image)
|
||||
(define (write-row row)
|
||||
(define (write-colour colour)
|
||||
(if (not (null? colour))
|
||||
(begin (write-char (integer->char (car colour)))
|
||||
(write-colour (cdr colour)))))
|
||||
(if (not (null? row))
|
||||
(begin (write-colour (car row)) (write-row (cdr row)))))
|
||||
(if (not (null? image))
|
||||
(begin (write-row (car image)) (write-image (cdr image)))))
|
||||
(with-output-to-file file
|
||||
(lambda ()
|
||||
(begin (display "P6")
|
||||
(newline)
|
||||
(display (length (car image)))
|
||||
(display " ")
|
||||
(display (length image))
|
||||
(newline)
|
||||
(display 255)
|
||||
(newline)
|
||||
(write-image image)))))
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
(define image (make-image 800 600))
|
||||
(image-fill! image *black*)
|
||||
(image-set! image 400 300 *blue*)
|
||||
(write-ppm image "out.ppm")
|
||||
Loading…
Add table
Add a link
Reference in a new issue