From f7f67c57a3f20020490f87a520e05236465a742d Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Thu, 14 Jan 2010 11:18:10 -0600 Subject: [PATCH] use clamp --- basis/images/processing/processing.factor | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/basis/images/processing/processing.factor b/basis/images/processing/processing.factor index cd6754550d..463337e653 100644 --- a/basis/images/processing/processing.factor +++ b/basis/images/processing/processing.factor @@ -16,7 +16,7 @@ IN: images.processing : matrix>image ( m -- image ) over matrix-dim >>dim swap flip flatten - [ 128 * 128 + 0 max 255 min >fixnum ] map + [ 128 * 128 + 0 255 clamp >fixnum ] map >byte-array >>bitmap L >>component-order ubyte-components >>component-type ; :: matrix-zoom ( m f -- m' ) @@ -30,7 +30,7 @@ IN: images.processing :: draw-grey ( value x,y image -- ) x,y image image-offset 3 * { 0 1 2 } [ - + value 128 + >fixnum 0 max 255 min swap image bitmap>> set-nth + + value 128 + >fixnum 0 255 clamp swap image bitmap>> set-nth ] with each ; :: draw-color ( value x,y color-id image -- )