In picture->pgm-file, always scale.
authorChris Hanson <org/chris-hanson/cph>
Tue, 1 Sep 1992 20:42:43 +0000 (20:42 +0000)
committerChris Hanson <org/chris-hanson/cph>
Tue, 1 Sep 1992 20:42:43 +0000 (20:42 +0000)
v7/src/6001/picture.scm

index 7a8357c07394f0f6b324c3989faef7c1c5c6d14f..61a09b9eff6dd601168786f21b2d92f8b05a3692 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/6001/picture.scm,v 1.13 1992/09/01 20:07:09 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/6001/picture.scm,v 1.14 1992/09/01 20:42:43 cph Exp $
 
 Copyright (c) 1991-92 Massachusetts Institute of Technology
 
@@ -315,16 +315,13 @@ MIT in each case. |#
         (data ( picture-data pic))
         (pmin (picture-min pic))
         (pmax (picture-max pic))
-        (scale-it? (or (< pmin 0) (> pmax 255)))
         (char-function
          (cond ((= pmin pmax) 
                 (lambda (x) x (ascii->char 0)))
-               (scale-it?
+               (else
                 (let ((scale (/ 255. (- pmax pmin))))
                   (lambda (x) 
-                    (ascii->char (round->exact (* (- x pmin) scale))))))
-               (else
-                (lambda (x) (ascii->char (round->exact x)))))))
+                    (ascii->char (round->exact (* (- x pmin) scale)))))))))
     (call-with-output-file file
       (lambda (port)
        (let ((write-chars