*** empty log message ***
authorClaus Gittinger <cg@exept.de>
Wed, 24 Jan 2007 14:40:55 +0100
changeset 4717 c25149336a26
parent 4716 d4fb48e2c72d
child 4718 11e89d5330e7
*** empty log message ***
Image.st
--- a/Image.st	Wed Jan 24 14:40:34 2007 +0100
+++ b/Image.st	Wed Jan 24 14:40:55 2007 +0100
@@ -47,32 +47,32 @@
 "
     this class provides (some time in the future) representation
     for all kinds of images (monochrome, greyscale and color)
-    and will finally replace Form. 
+    and will finally replace Form.
     For now (only ;-) depths of 1, 2, 4, 8, 16 and 24 are supported.
 
-    An Image keeps all of its information in a device independent way, 
-    but may be associated to a device. 
-    The data held keeps all information which was originally present, 
+    An Image keeps all of its information in a device independent way,
+    but may be associated to a device.
+    The data held keeps all information which was originally present,
     even if the display-device has lower resolution.
-    Therefore, it is possible to process and manipulate images without loosing 
+    Therefore, it is possible to process and manipulate images without loosing
     color information.
 
     Images may be created manually (by providing a pixel array),
     by screen capture or by reading a file (using an ImageReader).
     This gives a device independent image.
     For display, a device representation is required, which can be
-    aquired by sending the 
-	'onDevice:aDevice' 
-    message to the image. This will create a (possibly dithered) device-form, 
+    aquired by sending the
+	'onDevice:aDevice'
+    message to the image. This will create a (possibly dithered) device-form,
     representing the image using the currently available colors.
 
-    In rare cases, an explicit monochrome representation of the image is needed 
+    In rare cases, an explicit monochrome representation of the image is needed
     (X servers take monochrome icons only), this can be created by sending
-    it the message 
+    it the message
 	'monochromeOn:aDevice'.
 
     Also, it is planned to generate another hi-color resolution version,
-    which uses its own colormap and allows the use of all 256 colors on an 8bit display 
+    which uses its own colormap and allows the use of all 256 colors on an 8bit display
     (this is not currently implemented).
 
     An images pixel interpretation is controlled by the photometric instance variable
@@ -82,18 +82,18 @@
     This may change in future versions for more application compatibility.
 
     To convert pictures from/to external file-formats, image readers are used
-    which have the file-format knowledge built in. 
-    There are readers for most common formats available 
+    which have the file-format knowledge built in.
+    There are readers for most common formats available
     (see ImageReader and especially subclasses such as TIFFReader, GIFReader etc.).
 
     File formats are handled by subclasses of ImageReader, which understand
     a specific format. You can add more readers, by adding an association
-    such as ('.jpg' -> JPEGReader) to the class variable 'FileFormats' 
+    such as ('.jpg' -> JPEGReader) to the class variable 'FileFormats'
     (see the classes #initialize method, which sets up some default, and the
     patches/display.rc files, which add more).
 
     Some algorithms used here (especially dithering & color allocation) are
-    experimental and far from being perfect (some are very slow). 
+    experimental and far from being perfect (some are very slow).
     For now, the most common cases have been optimized and perform reasonably
     fast - however, with uncommon depth/visualType combinations, you may
     run into slower fallback methods ...
@@ -158,7 +158,7 @@
 					    and for the UIPainter utility.
 
 	imageSequence                       the imageSequence, of which the
-					    instance is a frame or nil, 
+					    instance is a frame or nil,
 					    if its not part of a sequence.
 
 	bitsPerPixel                        not used in ST/X
@@ -190,7 +190,7 @@
 	ImageNotFoundQuerySignal
 			    <QuerySignal>   raised, if an image could not be loaded
 					    from a file. The parameter is the images
-					    fileName. 
+					    fileName.
 					    A handler may return a replacement
 					    image or proceed with nil.
 					    If unhandled, a nil is returned from the
@@ -199,7 +199,7 @@
 	BadImageFormatQuerySignal
 			    <QuerySignal>   raised, if an image could not be loaded
 					    from a file due to a file error or
-					    unsupported format. 
+					    unsupported format.
 					    A handler may return a replacement
 					    image or proceed with nil.
 					    If unhandled, a nil is returned from the
@@ -316,25 +316,25 @@
       (default photometric is #blackIs0)
 									[exBegin]
 	(Depth4Image
-	     width:8 
+	     width:8
 	     height:4
-	     fromArray:#[ 
+	     fromArray:#[
 			    16r00 16r11 16r22 16r33
 			    16r44 16r55 16r66 16r77
 			    16r88 16r99 16raa 16rbb
-			    16rcc 16rdd 16ree 16rff 
+			    16rcc 16rdd 16ree 16rff
 			]) inspect
 									[exEnd]
       the same, magnified:
 									[exBegin]
 	((Depth4Image
-	     width:4 
+	     width:4
 	     height:4
-	     fromArray:#[ 
+	     fromArray:#[
 			    16r01 16r23
 			    16r45 16r67
 			    16r89 16rab
-			    16rcd 16ref 
+			    16rcd 16ref
 			])
 	    magnifiedBy:30)
 		 inspect
@@ -342,14 +342,14 @@
       the following has the same effect:
 									[exBegin]
 	((Image
-	     width:4 
+	     width:4
 	     height:4
 	     depth:4
-	     fromArray:#[ 
+	     fromArray:#[
 			    16r01 16r23
 			    16r45 16r67
 			    16r89 16rab
-			    16rcd 16ref 
+			    16rcd 16ref
 			])
 	    magnifiedBy:30)
 		 inspect
@@ -357,13 +357,13 @@
       with reverse grey-interpretation:
 									[exBegin]
 	((Depth4Image
-	     width:4 
+	     width:4
 	     height:4
-	     fromArray:#[ 
+	     fromArray:#[
 			    16r01 16r23
 			    16r45 16r67
 			    16r89 16rab
-			    16rcd 16ref 
+			    16rcd 16ref
 			])
 	    photometric:#whiteIs0;
 	    magnifiedBy:30)
@@ -373,13 +373,13 @@
       with 1-bit-per-pixel rgb interpretation:
 									[exBegin]
 	((Depth4Image
-	     width:4 
+	     width:4
 	     height:4
-	     fromArray:#[ 
+	     fromArray:#[
 			    16r01 16r23
 			    16r45 16r67
 			    16r89 16rab
-			    16rcd 16ref 
+			    16rcd 16ref
 			])
 	    photometric:#rgb;
 	    samplesPerPixel:3;
@@ -391,13 +391,13 @@
       with 1/2/1 rgb interpretation:
 									[exBegin]
 	((Depth4Image
-	     width:4 
+	     width:4
 	     height:4
-	     fromArray:#[ 
+	     fromArray:#[
 			    16r01 16r23
 			    16r45 16r67
 			    16r89 16rab
-			    16rcd 16ref 
+			    16rcd 16ref
 			])
 	    photometric:#rgb;
 	    samplesPerPixel:3;
@@ -449,13 +449,13 @@
       a 2plane greyscale image:
 									[exBegin]
 	((Depth2Image
-	     width:4 
+	     width:4
 	     height:4
-	     fromArray:#[ 
+	     fromArray:#[
 			    4r0123
 			    4r1230
 			    4r2301
-			    4r3012 
+			    4r3012
 			])
 	    magnifiedBy:30)
 		 inspect
@@ -464,13 +464,13 @@
       with colors:
 									[exBegin]
 	((Depth2Image
-	     width:4 
+	     width:4
 	     height:4
-	     fromArray:#[ 
+	     fromArray:#[
 			    4r0123
 			    4r1230
 			    4r2301
-			    4r3012 
+			    4r3012
 			])
 	    colorMap:(Array with:(Color black)
 			    with:(Color red)
@@ -483,7 +483,7 @@
       depth8 image with 3/3/2 rgb interpretation:
 									[exBegin]
 	((Depth8Image
-	     width:16 
+	     width:16
 	     height:16
 	     fromArray:(ByteArray withAll:(0 to:16rFF)))
 	    photometric:#rgb;
@@ -496,7 +496,7 @@
       depth8 image with 2/2/2 rgb interpretation:
 									[exBegin]
 	((Depth8Image
-	     width:8 
+	     width:8
 	     height:8
 	     fromArray:(ByteArray withAll:(0 to:16r3F)))
 	    photometric:#rgb;
@@ -509,12 +509,12 @@
       trueColor image:
 									[exBegin]
 	((Depth24Image
-	     width:4 
+	     width:4
 	     height:4
-	     fromArray:#[ 
+	     fromArray:#[
 		    16rFF 16r00 16r00  16rFF 16r00 16r00  16rFF 16r00 16r00  16rFF 16r00 16r00
 		    16r00 16rFF 16r00  16r00 16rFF 16r00  16r00 16rFF 16r00  16r00 16rFF 16r00
-		    16r00 16r00 16rFF  16r00 16r00 16rFF  16r00 16r00 16rFF  16r00 16r00 16rFF 
+		    16r00 16r00 16rFF  16r00 16r00 16rFF  16r00 16r00 16rFF  16r00 16r00 16rFF
 		    16rFF 16rFF 16rFF  16rFF 16rFF 16rFF  16rFF 16rFF 16rFF  16rFF 16rFF 16rFF
 			])
 	    photometric:#rgb;
@@ -535,35 +535,35 @@
 
     magnifying (any factor):
 									[exBegin]
-	((Image fromFile:'goodies/bitmaps/gifImages/claus.gif') 
+	((Image fromFile:'goodies/bitmaps/gifImages/claus.gif')
 	    magnifiedTo:(48@48))
 		inspect
 									[exEnd]
 									[exBegin]
-	((Image fromFile:'goodies/bitmaps/gifImages/claus.gif') 
+	((Image fromFile:'goodies/bitmaps/gifImages/claus.gif')
 	    magnifiedBy:0.7)
 		inspect
 									[exEnd]
 
     rotating:
 									[exBegin]
-	((Image fromFile:'goodies/bitmaps/gifImages/claus.gif') 
+	((Image fromFile:'goodies/bitmaps/gifImages/claus.gif')
 	    rotated:90)
 		inspect
 									[exEnd]
 									[exBegin]
-	(((Image fromFile:'goodies/bitmaps/gifImages/claus.gif') 
+	(((Image fromFile:'goodies/bitmaps/gifImages/claus.gif')
 	    magnifiedBy:0.3@0.7) rotated:270)
 		inspect
 									[exEnd]
 									[exBegin]
-	(((Image fromFile:'goodies/bitmaps/gifImages/claus.gif') 
+	(((Image fromFile:'goodies/bitmaps/gifImages/claus.gif')
 	    ) rotated:30)
 		inspect
 									[exEnd]
     negative:
 									[exBegin]
-	((Image fromFile:'goodies/bitmaps/gifImages/claus.gif') 
+	((Image fromFile:'goodies/bitmaps/gifImages/claus.gif')
 	    negative)
 		inspect
 									[exEnd]
@@ -629,14 +629,14 @@
 	Lobby := Registry new.
 	ObjectMemory addDependent:self.
 
-	"/ define the algorithm to use for dithering - 
+	"/ define the algorithm to use for dithering -
 	"/ supported values are:
 	"/      #threshold
 	"/      #ordered
 	"/      #floydSteinberg
 	"/      #burkes
 
-	DitherAlgorithm := #floydSteinberg.   
+	DitherAlgorithm := #floydSteinberg.
 
 	(Display notNil and:[Display hasGrayscales]) ifFalse:[
 	    NumberOfDitherColors := 64
@@ -691,9 +691,9 @@
      see the 'smalltalk.rc'/'display.rc' startup files for a real (full) map."
 
     MIMETypes notNil ifTrue:[
-        MIMETypes imageReaderForSuffix:'xbm'  put:XBMReader.
-        MIMETypes imageReaderForSuffix:'tiff' put:TIFFReader.
-        MIMETypes imageReaderForSuffix:'gif'  put:GIFReader.
+	MIMETypes imageReaderForSuffix:'xbm'  put:XBMReader.
+	MIMETypes imageReaderForSuffix:'tiff' put:TIFFReader.
+	MIMETypes imageReaderForSuffix:'gif'  put:GIFReader.
     ].
 
     "
@@ -709,11 +709,11 @@
      see the 'smalltalk.rc'/'display.rc' startup files for a real (full) map."
 
     MIMETypes notNil ifTrue:[
-        MIMETypes mimeTypeForSuffix:'gif'       put:'image/gif'.
-        MIMETypes mimeTypeForSuffix:'tiff'      put:'image/tiff'.
-        MIMETypes mimeTypeForSuffix:'tif'       put:'image/tiff'.
-        MIMETypes mimeTypeForSuffix:'xbm'       put:'image/x-xbitmap'.
-        MIMETypes mimeTypeForSuffix:'xpm'       put:'image/x-xpixmap'.
+	MIMETypes mimeTypeForSuffix:'gif'       put:'image/gif'.
+	MIMETypes mimeTypeForSuffix:'tiff'      put:'image/tiff'.
+	MIMETypes mimeTypeForSuffix:'tif'       put:'image/tiff'.
+	MIMETypes mimeTypeForSuffix:'xbm'       put:'image/x-xbitmap'.
+	MIMETypes mimeTypeForSuffix:'xpm'       put:'image/x-xpixmap'.
     ].
 
     "
@@ -737,7 +737,7 @@
 !Image class methodsFor:'instance creation'!
 
 extent:ext
-    "create a new image, given extent. 
+    "create a new image, given extent.
      Assume a depth of 1, unless an explicit imageClass is the receiver."
 
     ^ self width:(ext x) height:(ext y)
@@ -749,7 +749,7 @@
 extent:ext depth:d
     "ST-80 compatibility"
 
-    ^ self width:ext x height:ext y depth:d 
+    ^ self width:ext x height:ext y depth:d
 !
 
 extent:ext depth:d bits:bits
@@ -878,8 +878,8 @@
     "create & return an Image given another image. This can be used to
      convert an image to another depth."
 
-    (self == Image 
-    or:[anImage class == self 
+    (self == Image
+    or:[anImage class == self
 	and:[photometricOrNil isNil or:[photometricOrNil == anImage photometric]]]) ifTrue:[^ anImage].
     ^ self new fromImage:anImage photometric:photometricOrNil.
 
@@ -946,15 +946,15 @@
 !
 
 fromSubImage:anImage in:aRectangle
-    "create & return an Image from a rectangular area in another image. 
+    "create & return an Image from a rectangular area in another image.
      This can also be used to get a subimage in another depth."
 
     |cls newImage|
 
     self == Image ifTrue:[
-        cls := (self implementorForDepth:anImage depth).
+	cls := (self implementorForDepth:anImage depth).
     ] ifFalse:[
-        cls := self.
+	cls := self.
     ].
     newImage := cls new.
     ^ newImage fromSubImage:anImage in:aRectangle.
@@ -1035,11 +1035,11 @@
      Data must be a ByteArray containing correctly aligned bits for the specified
      depth (8-bit padded)."
 
-    ^ (self newForDepth:d) 
+    ^ (self newForDepth:d)
 	width:w height:h depth:d fromArray:pixelData
 
     "
-     Image width:8 
+     Image width:8
 	   height:8
 	   depth:1
 	   fromArray:#[2r11001100
@@ -1053,9 +1053,9 @@
     "
 
     "
-     Image width:8 
+     Image width:8
 	   height:8
-	   depth:2 
+	   depth:2
 	   fromArray:#[4r1100 4r1100
 		       4r0011 4r0011
 		       4r1100 4r1100
@@ -1067,9 +1067,9 @@
     "
 
     "
-     Image width:8 
+     Image width:8
 	   height:8
-	   depth:4 
+	   depth:4
 	   fromArray:#[16r00 16r01 16rf0 16rf1
 		       16r02 16r03 16rf2 16rf3
 		       16r04 16r05 16rf4 16rf5
@@ -1088,7 +1088,7 @@
      Data must be a ByteArray containing correctly aligned bits for the specified
      depth."
 
-    |img newBits 
+    |img newBits
      srcRowBytes "{ Class: SmallInteger }"
      dstRowBytes "{ Class: SmallInteger }"
      nextDstIndex "{ Class: SmallInteger }"
@@ -1110,7 +1110,7 @@
 
 	1 to:h do:[:row |
 	    nextDstIndex := dstIndex + dstRowBytes.
-	    newBits replaceFrom:dstIndex 
+	    newBits replaceFrom:dstIndex
 			     to:(nextDstIndex - 1)
 			   with:pixelData
 		     startingAt:srcIndex.
@@ -1153,8 +1153,8 @@
     ^ cls new width:w height:h depth:d fromArray:pixels
 
     "
-     Image width:8 
-	   height:8 
+     Image width:8
+	   height:8
 	   fromArray:#[2r11001100
 		       2r00110011
 		       2r11001100
@@ -1266,20 +1266,20 @@
 
 !Image class methodsFor:'cleanup'!
 
-releaseResourcesOnDevice:aDevice 
+releaseResourcesOnDevice:aDevice
     "this is sent when a display connection is closed,
      to release all cached Images from that device"
-    
-    Lobby 
-        unregisterAllForWhich:[:eachImage | 
-            |ok|
-
-            ok := eachImage graphicsDevice == aDevice.
-            ok ifTrue:[
-                eachImage releaseFromDevice
-            ].
-            ok
-        ]
+
+    Lobby
+	unregisterAllForWhich:[:eachImage |
+	    |ok|
+
+	    ok := eachImage graphicsDevice == aDevice.
+	    ok ifTrue:[
+		eachImage releaseFromDevice
+	    ].
+	    ok
+	]
 
     "Created: 16.1.1997 / 19:30:44 / cg"
     "Modified: 16.1.1997 / 19:33:49 / cg"
@@ -1298,7 +1298,7 @@
      the ImageNotFoundQuerySignal is raised, which may be handled to
      proceed with some replacement image. If unhandled, nil is returned."
 
-    |image name fn nm inStream suffix readerClass 
+    |image name fn nm inStream suffix readerClass
      mustDecompress inPipe readersErrorMsg|
 
     "before trying each reader, check if the file is readable"
@@ -1307,14 +1307,14 @@
 
     inStream := Smalltalk systemFileStreamFor:name.
     inStream isNil ifTrue:[
-        inStream := Smalltalk bitmapFileStreamFor:name.
-        inStream isNil ifTrue:[
-            "this signal is a query - if noone seems to care, return nil.
-             However, a handler may provide a replacement image."
-            ^ ImageNotFoundQuerySignal
-                        raiseRequestWith:aFileName
-                        errorString:('IMAGE [warning]: ''' , name pathName, ''' does not exist or is not readable').
-        ].
+	inStream := Smalltalk bitmapFileStreamFor:name.
+	inStream isNil ifTrue:[
+	    "this signal is a query - if noone seems to care, return nil.
+	     However, a handler may provide a replacement image."
+	    ^ ImageNotFoundQuerySignal
+			raiseRequestWith:aFileName
+			errorString:('IMAGE [warning]: ''' , name pathName, ''' does not exist or is not readable').
+	].
     ].
     fn := inStream pathName asFilename.
     inStream close.
@@ -1324,56 +1324,56 @@
 
     "handle compressed-suffix"
     (#('Z' 'gz') includes:suffix) ifTrue:[
-        fn := fn withoutSuffix.
-        nm := fn name.
-        suffix := fn suffix.
-        mustDecompress := true.
+	fn := fn withoutSuffix.
+	nm := fn name.
+	suffix := fn suffix.
+	mustDecompress := true.
     ].
     suffix isEmpty ifTrue:[
-        suffix := nm.
+	suffix := nm.
     ].
 
     "get the imageReader class from the files extension and ask it first"
     readerClass := MIMETypes imageReaderForSuffix:suffix.
     readerClass notNil ifTrue:[
-        mustDecompress == true ifTrue:[
-            inPipe := PipeStream readingFrom:'gunzip <' , fn pathName.
-            inPipe notNil ifTrue:[
-                [
-                    image := readerClass fromStream:inPipe.
-                ] ensure:[
-                    inPipe close
-                ].
-            ]
-        ] ifFalse:[
-            BadImageFormatQuerySignal handle:[:ex |
-                Transcript showCR:(readersErrorMsg := ex description).
-                image := nil.
-                ex return.
-            ] do:[
-                image := readerClass fromFile:fn.
-            ].
-        ].
-        image notNil ifTrue:[^ image].
+	mustDecompress == true ifTrue:[
+	    inPipe := PipeStream readingFrom:'gunzip <' , fn pathName.
+	    inPipe notNil ifTrue:[
+		[
+		    image := readerClass fromStream:inPipe.
+		] ensure:[
+		    inPipe close
+		].
+	    ]
+	] ifFalse:[
+	    BadImageFormatQuerySignal handle:[:ex |
+		Transcript showCR:(readersErrorMsg := ex description).
+		image := nil.
+		ex return.
+	    ] do:[
+		image := readerClass fromFile:fn.
+	    ].
+	].
+	image notNil ifTrue:[^ image].
     ].
 
     (readerClass isNil or:[readersErrorMsg notNil]) ifTrue:[
-        "no known extension (or wrong extension)
-         - ask all readers if they know this format ...
-         ... these look into the file, and investigate the header.
-         therefore, it takes a bit longer."
-
-        MIMETypes imageReaderClasses do:[:mimeReaderClass |
-            (mimeReaderClass notNil 
-            and:[mimeReaderClass ~~ readerClass]) ifTrue:[
-               (mimeReaderClass isValidImageFile:name) ifTrue:[
-                    image := mimeReaderClass fromFile:name.
-                    image notNil ifTrue:[
-                        ^ image
-                    ]
-                ]
-            ]
-        ].
+	"no known extension (or wrong extension)
+	 - ask all readers if they know this format ...
+	 ... these look into the file, and investigate the header.
+	 therefore, it takes a bit longer."
+
+	MIMETypes imageReaderClasses do:[:mimeReaderClass |
+	    (mimeReaderClass notNil
+	    and:[mimeReaderClass ~~ readerClass]) ifTrue:[
+	       (mimeReaderClass isValidImageFile:name) ifTrue:[
+		    image := mimeReaderClass fromFile:name.
+		    image notNil ifTrue:[
+			^ image
+		    ]
+		]
+	    ]
+	].
     ].
 
     "nope - unknown format
@@ -1381,8 +1381,8 @@
      However, a handler may provide a replacement image."
 
     ^ BadImageFormatQuerySignal
-        raiseRequestWith:aFileName                                                                                            
-        errorString:(readersErrorMsg ? ('IMAGE [warning]: unknown image file format: ''' , aFileName asFilename pathName , '''')).
+	raiseRequestWith:aFileName
+	errorString:(readersErrorMsg ? ('IMAGE [warning]: unknown image file format: ''' , aFileName asFilename pathName , '''')).
 
     "
      Image fromFile:'goodies/bitmaps/gifImages/claus.gif'
@@ -1400,21 +1400,21 @@
 
     "giving a message for non-existing images:
 
-     Image imageNotFoundQuerySignal 
+     Image imageNotFoundQuerySignal
      handle:[:ex |
-        Transcript showCR:ex description.
-        ex proceedWith:nil
+	Transcript showCR:ex description.
+	ex proceedWith:nil
      ] do:[
-         Image fromFile:'fooBar'
+	 Image fromFile:'fooBar'
      ]
     "
 
     "giving a replacement for non-existing images:
 
-     Image imageNotFoundQuerySignal 
+     Image imageNotFoundQuerySignal
      answer:(Image fromFile:'libtool/bitmaps/SmalltalkX.xbm')
      do:[
-         Image fromFile:'fooBar'
+	 Image fromFile:'fooBar'
      ]
     "
 
@@ -1444,7 +1444,7 @@
 
 fromFile:aFileName on:aDevice
     "read an image from a file and prepare a device representation.
-     Return nil (or whatever a handler returned), 
+     Return nil (or whatever a handler returned),
      if the file is unreadable or does not contain an appropriate image."
 
     |img|
@@ -1461,7 +1461,7 @@
 fromFile:aFileName resolution:res
     "read an image from a file and (if required) scale the image
      as appropriate (only req'd for very high resolution displays).
-     Return nil (or whatever a handler returned), 
+     Return nil (or whatever a handler returned),
      if the file is unreadable or does not contain an appropriate image."
 
     ^ self fromFile:aFileName resolution:res on:nil
@@ -1474,7 +1474,7 @@
     "read an image from a file and (if required) scale the image
      as appropriate (only req'd with very high resolution displays).
      Prepare a device representation.
-     Return nil (or whatever a handler returned), 
+     Return nil (or whatever a handler returned),
      if the file is unreadable or does not contain an appropriate image."
 
     |img dev dpiH mag|
@@ -1513,7 +1513,7 @@
      out the file format itself (by contents)
      and lets the appropriate reader read the file.
      To do this, the stream must be positionable.
-     Return nil (or whatever a handler returned), 
+     Return nil (or whatever a handler returned),
      if the stream does not contain an appropriate image."
 
     |image|
@@ -1523,10 +1523,10 @@
      this format ...
     "
     MIMETypes imageReaderClasses do:[:readerClass |
-        readerClass notNil ifTrue:[
-            image := readerClass fromStream:aStream.
-            image notNil ifTrue:[^ image].
-        ]
+	readerClass notNil ifTrue:[
+	    image := readerClass fromStream:aStream.
+	    image notNil ifTrue:[^ image].
+	]
     ].
 
     "
@@ -1535,8 +1535,8 @@
 "/    'Image [info]: unknown image file format in stream: ' infoPrintCR.
 
     ^ ImageNotFoundQuerySignal
-                raiseRequestWith:aStream
-                errorString:('IMAGE [warning]: unknown image file format in stream').
+		raiseRequestWith:aStream
+		errorString:('IMAGE [warning]: unknown image file format in stream').
 
     "
      Image fromFile:'goodies/bitmaps/gifImages/claus.gif'
@@ -1563,7 +1563,7 @@
      Use this, if you know the files format, but it has an invalid
      extension (or non-definite header), so #fromStream: could not
      find out the images format.
-     Return nil (or whatever a handler returned), 
+     Return nil (or whatever a handler returned),
      if the stream does not contain an appropriate image."
 
     |image|
@@ -1587,7 +1587,7 @@
 !Image class methodsFor:'misc'!
 
 ditherAlgorithm
-    "return the way we dither - 
+    "return the way we dither -
 	#threshold, or nil        -> no dither
 	#pattern, or #ordered     -> orderedDither (ugly, but fast)
 	#error or #floydSteinberg -> errorDiffusion; much better
@@ -1599,7 +1599,7 @@
 !
 
 ditherAlgorithm:aSymbol
-    "define how to dither - 
+    "define how to dither -
 	#threshold, or nil        -> no dither
 	#pattern, or #ordered     -> orderedDither (ugly, but fast)
 	#error or #floydSteinberg -> errorDiffusion; much better
@@ -1628,7 +1628,7 @@
 orderedDitherMatrixOfSize:sz
     sz == 2 ifTrue:[
 	^ #[
-		0 2 
+		0 2
 		3 1
 	   ].
     ].
@@ -1646,12 +1646,12 @@
 	^  #[
 		0 32  8 40    2 34 10 42
 	       48 16 56 24   50 18 58 26
-	       12 44  4 36   14 46  6 38    
+	       12 44  4 36   14 46  6 38
 	       60 28 52 20   62 30 54 22
 
 		3 35 11 43    1 33  9 41
 	       51 19 59 27   49 17 57 25
-	       15 47  7 39   13 45  5 37    
+	       15 47  7 39   13 45  5 37
 	       63 31 55 23   61 29 53 21
 	    ].
     ].
@@ -1775,9 +1775,9 @@
     ^ MIMETypes mimeTypeForSuffix:suffix
 
     "
-     Image mimeTypeFromSuffix:'gif'      
-     Image mimeTypeFromSuffix:'tiff'    
-     Image mimeTypeFromSuffix:'foobar'  
+     Image mimeTypeFromSuffix:'gif'
+     Image mimeTypeFromSuffix:'tiff'
+     Image mimeTypeFromSuffix:'foobar'
     "
 
     "Modified: 1.7.1997 / 00:17:27 / cg"
@@ -1794,7 +1794,7 @@
     |display|
 
     display := Screen current.
-    ^ self 
+    ^ self
 	fromScreen:(0@0 corner:(display width @ display height))
 	on:display
 	grab:true
@@ -1813,8 +1813,8 @@
 	      it may not work from within a buttonMotion
 	      (use #fromScreen:on:grab: with a false grabArg then)."
 
-    ^ self 
-	fromScreen:aRectangle 
+    ^ self
+	fromScreen:aRectangle
 	on:Screen current
 	grab:true
 
@@ -1834,8 +1834,8 @@
 	      (use #fromScreen:on:grab: with a false grabArg then)."
 
     ^ self
-	fromScreen:aRectangle 
-	on:aDevice 
+	fromScreen:aRectangle
+	on:aDevice
 	grab:true
 
     "
@@ -1859,8 +1859,8 @@
      is grabbed (i.e. blocked for others) and a camera cursor is
      shown while the readout is done.
      WARNING: with doGrab true, this temporarily grabs the display
-              and it may not work from within a buttonMotion
-              (use with a false grabArg then)."
+	      and it may not work from within a buttonMotion
+	      (use with a false grabArg then)."
 
     |depth vis img|
 
@@ -1873,9 +1873,9 @@
     "/
     vis := aDisplay visualType.
     (vis == #TrueColor or:[vis == #DirectColor]) ifTrue:[
-        depth > 8 ifTrue:[
-            depth := 24.
-        ]
+	depth > 8 ifTrue:[
+	    depth := 24.
+	]
     ].
 
     img := self newForDepth:depth.
@@ -1885,7 +1885,7 @@
 !
 
 fromScreenArea
-    "return an image of a part of the screen; 
+    "return an image of a part of the screen;
      let user specify screen area.
      This is the same as #fromUser - kept for backward compatibility.
      Use #fromUser for ST-80 compatibility.
@@ -1929,16 +1929,16 @@
 fromView:aView
     "return an image taken from a views contents as currently
      on the screen. The returned image has the same depth and photometric
-     as the Display. 
-     Notice, that for invisible or partial covered views, 
-     the returned Image is NOT correct. 
+     as the Display.
+     Notice, that for invisible or partial covered views,
+     the returned Image is NOT correct.
      You may want to raise the view before using this method.
      WARNING: this temporarily grabs the display
 	      it may not work from within a buttonMotion
 	      (use #fromView:grab: with a false grabArg then)."
 
     ^ self
-	fromView:aView 
+	fromView:aView
 	grab:true
 
     "
@@ -1964,13 +1964,13 @@
      is grabbed (i.e. blocked for others) and a camera cursor is
      shown while the readout is done.
      The returned image has the same depth and photometric
-     as the Display. 
-     Notice, that for invisible or partial covered views, 
-     the returned Image is NOT correct. 
+     as the Display.
+     Notice, that for invisible or partial covered views,
+     the returned Image is NOT correct.
      You may want to raise the view before using this method.
      WARNING: with doGrab true, this temporarily grabs the display
-              and it may not work from within a buttonMotion
-              (use with a false grabArg then)."
+	      and it may not work from within a buttonMotion
+	      (use with a false grabArg then)."
 
     ^ self fromView:aView grab:doGrab withDecoration:false
 
@@ -1980,18 +1980,18 @@
 
 fromView:aView grab:doGrab withDecoration:withDecoration
     "return an image taken from a views contents as currently
-     on the screen, optionally with decoration included. 
+     on the screen, optionally with decoration included.
      If the doGrab argument is true, the display
      is grabbed (i.e. blocked for others) and a camera cursor is
      shown while the readout is done.
      The returned image has the same depth and photometric
-     as the Display. 
-     Notice, that for invisible or partial covered views, 
-     the returned Image is NOT correct. 
+     as the Display.
+     Notice, that for invisible or partial covered views,
+     the returned Image is NOT correct.
      You may want to raise the view before using this method.
      WARNING: with doGrab true, this temporarily grabs the display
-              and it may not work from within a buttonMotion
-              (use with a false grabArg then)."
+	      and it may not work from within a buttonMotion
+	      (use with a false grabArg then)."
 
     |org ext device cH bW bH|
 
@@ -1999,21 +1999,21 @@
     org := device translatePoint:(0@0) fromView:aView toView:nil.
     ext := aView extent.
     withDecoration ifTrue:[
-        device platformName = 'WIN32' ifTrue:[
-            cH := device captionHeight.
-            bW := (device getSystemMetrics: #SM_CXFRAME )
-                  "+ ( device getSystemMetrics: #borderFrameWidth )".
-            bH := (device getSystemMetrics: #SM_CYFRAME )
-                  " + ( device getSystemMetrics: #borderFrameHeight )".
-            org := org - (bW @ (bH + cH)).
-            ext := ext + ((bW + bW) @ (bH+bH+cH)).
-        ].
+	device platformName = 'WIN32' ifTrue:[
+	    cH := device captionHeight.
+	    bW := (device getSystemMetrics: #SM_CXFRAME )
+		  "+ ( device getSystemMetrics: #borderFrameWidth )".
+	    bH := (device getSystemMetrics: #SM_CYFRAME )
+		  " + ( device getSystemMetrics: #borderFrameHeight )".
+	    org := org - (bW @ (bH + cH)).
+	    ext := ext + ((bW + bW) @ (bH+bH+cH)).
+	].
     ].
     ^ self fromScreen:(org extent:ext) on:device grab:doGrab
 
     "
-     Transcript topView raise. (Image fromView:Transcript topView grab:false withDecoration:false) inspect   
-     Transcript topView raise. (Image fromView:Transcript topView grab:false withDecoration:true) inspect     
+     Transcript topView raise. (Image fromView:Transcript topView grab:false withDecoration:false) inspect
+     Transcript topView raise. (Image fromView:Transcript topView grab:false withDecoration:true) inspect
     "
 
     "Created: / 26-03-1997 / 10:34:20 / cg"
@@ -2048,7 +2048,7 @@
      |img|
      img := Image extent:100@100 depth:24.
      img photometric:#rgb.
-     img data:(ByteArray new:100*100*3).   
+     img data:(ByteArray new:100*100*3).
      img fillWhite:(0@0 corner:100@100).
      img fillBlack:(10@10 corner:90@90).
      img inspect.
@@ -2070,7 +2070,7 @@
 
 asCachedImage
     "return the receiver associated to the current screens device.
-     For ST-80 compatibility 
+     For ST-80 compatibility
      (ST/X uses Image for both device- and nonDevice-images)"
 
     ^ self onDevice:Screen current
@@ -2080,7 +2080,7 @@
 
 asRetainedMedium
     "return the receiver associated to the current screens device.
-     For ST-80 compatibility 
+     For ST-80 compatibility
      (ST/X uses Image for both device- and nonDevice-images)"
 
     ^ self onDevice:Screen current
@@ -2154,13 +2154,13 @@
     |orgX orgY tW tH|
 
     origin ~= (0@0) ifTrue:[
-        self halt:'unimplemented'.
+	self halt:'unimplemented'.
     ].
     bounds ~= self bounds ifTrue:[
-        self halt:'unimplemented'.
+	self halt:'unimplemented'.
     ].
     rule ~= #over ifTrue:[
-        self halt:'unimplemented'.
+	self halt:'unimplemented'.
     ].
 
     orgX := origin x.
@@ -2168,21 +2168,21 @@
     tW := tile width.
     tH := tile height.
     (bounds top) to:(bounds bottom) by:tH do:[:dstY |
-        (bounds left) to:(bounds right) by:(tile width) do:[:dstX |
-            self 
-                copyFrom:tile 
-                x:orgX y:orgY 
-                toX:dstX y:dstY 
-                width:tW height:tH.
-        ].
+	(bounds left) to:(bounds right) by:(tile width) do:[:dstX |
+	    self
+		copyFrom:tile
+		x:orgX y:orgY
+		toX:dstX y:dstY
+		width:tW height:tH.
+	].
     ].
 !
 
 valueAtPoint:aPoint put:aColorValue
     aColorValue isInteger ifFalse:[
-        self colorAtX:aPoint x y:aPoint y put:aColorValue
+	self colorAtX:aPoint x y:aPoint y put:aColorValue
     ] ifTrue:[
-        self pixelAtX:aPoint x y:aPoint y put:aColorValue
+	self pixelAtX:aPoint x y:aPoint y put:aColorValue
     ]
 ! !
 
@@ -2410,13 +2410,13 @@
     ^ monoDeviceForm id
 !
 
-palette 
+palette
     "return the colormap; ST-80 compatibility"
 
     ^ colorMap
 !
 
-palette:aColormap 
+palette:aColormap
     "set the colormap; ST-80 compatibility"
 
     self colorMap:aColormap
@@ -2458,7 +2458,7 @@
 !Image methodsFor:'accessing-pixels'!
 
 at:aPoint
-    "WARNING: for now, this returns a pixels color 
+    "WARNING: for now, this returns a pixels color
      (backward compatibility with ST/X)
      In the future, this will return a pixel value (ST-80 compatibility)
      Use #colorAt: - for future compatibility.
@@ -2480,7 +2480,7 @@
 !
 
 at:aPoint put:aColor
-    "WARNING: for now, this expects a pixels color 
+    "WARNING: for now, this expects a pixels color
      (backward compatibility with ST/X)
      In the future, this will expect a pixel value (ST-80 compatibility)
      Use #colorAt:put: - for future compatibility.
@@ -2509,7 +2509,7 @@
 
     |maskVal|
 
-    (aColorOrPixelOrNil notNil and:[aColorOrPixelOrNil ~= Color noColor]) ifTrue:[   
+    (aColorOrPixelOrNil notNil and:[aColorOrPixelOrNil ~= Color noColor]) ifTrue:[
 	maskVal := 1.
 	aColorOrPixelOrNil isInteger ifTrue:[
 	    self pixelAt:aPoint put:aColorOrPixelOrNil.
@@ -2522,7 +2522,7 @@
     ].
     mask notNil ifTrue:[
 	mask pixelAt:aPoint put:maskVal
-    ].  
+    ].
 
     "Modified: / 30.9.1998 / 22:42:44 / cg"
 !
@@ -2535,7 +2535,7 @@
 
     |pixVal maskVal|
 
-    aPixelValueOrNil notNil ifTrue:[   
+    aPixelValueOrNil notNil ifTrue:[
 	pixVal := aPixelValueOrNil.
 	maskVal := 1.
     ] ifFalse:[
@@ -2544,7 +2544,7 @@
     ].
     mask notNil ifTrue:[
 	mask pixelAt:aPoint put:maskVal
-    ].  
+    ].
     self pixelAt:aPoint put:pixVal
 
     "Modified: / 30.9.1998 / 22:42:44 / cg"
@@ -2567,7 +2567,7 @@
 !
 
 atX:x y:y
-    "WARNING: for now, this returns a pixels color 
+    "WARNING: for now, this returns a pixels color
      (backward compatibility with ST/X)
      In the future, this will return a pixel value (ST-80 compatibility)
      Use #colorAt: - for future compatibility.
@@ -2586,7 +2586,7 @@
 !
 
 atX:x y:y put:aColor
-    "WARNING: for now, this expects a pixels color 
+    "WARNING: for now, this expects a pixels color
      (backward compatibility with ST/X)
      In the future, this will expect a pixel value (ST-80 compatibility)
      Use #colorAt:put: - for future compatibility.
@@ -2600,8 +2600,8 @@
      (it is meant to access individual pixels - for example, in a bitmap editor)"
 
     aColor isInteger ifTrue:[
-        'Image [warning]: the Image>>atX:y:put: will change semantics soon; use #colorAtX:y:put:' infoPrintCR.
-        ^ self pixelAtX:x y:y put:aColor
+	'Image [warning]: the Image>>atX:y:put: will change semantics soon; use #colorAtX:y:put:' infoPrintCR.
+	^ self pixelAtX:x y:y put:aColor
     ].
     ^ self colorAtX:x y:y put:aColor
 
@@ -2629,8 +2629,8 @@
 bits
     "return the raw image data; depending on the photometric,
      this has to be interpreted as monochrome, greyscale,
-     palette or rgb data. 
-     It is also packed to be dense, so a 4 bitPerSample palette image 
+     palette or rgb data.
+     It is also packed to be dense, so a 4 bitPerSample palette image
      will store 2 pixels per byte, whereas a 2-bitPerPixel image will store
      4 pixels per byte."
 
@@ -2784,7 +2784,7 @@
      The returned numbers interpretation depends on the photometric
      and the colormap. (see also Image>>at: and Image>>atX:y:)
      You should not use this method for image-processing of
-     big images, its very slow ... 
+     big images, its very slow ...
      (it is meant to access individual pixels - for example, in a bitmap editor)"
 
     ^ self subclassResponsibility
@@ -2910,7 +2910,7 @@
 !
 
 valueAt:aPoint
-    "WARNING: for now, this returns a pixels value 
+    "WARNING: for now, this returns a pixels value
      (backward compatibility with ST/X)
      In the future, this will return a color (ST-80 compatibility)
      Use #pixelAt: - for future compatibility.
@@ -2931,7 +2931,7 @@
 !
 
 valueAtX:x y:y
-    "WARNING: for now, this returns a pixels value 
+    "WARNING: for now, this returns a pixels value
      (backward compatibility with ST/X)
      In the future, this will return a color (ST-80 compatibility)
      Use #pixelAt: - for future compatibility.
@@ -2942,7 +2942,7 @@
      The returned numbers interpretation depends on the photometric
      and the colormap. (see also Image>>at: and Image>>atX:y:)
      You should not use this method for image-processing of
-     big images, its very slow ... 
+     big images, its very slow ...
      (it is meant to access individual pixels - for example, in a bitmap editor)"
 
     'Image [warning]: the Image>>valueAtX:y: will change semantics soon; use #pixelAtX:y' infoPrintCR.
@@ -2967,7 +2967,7 @@
 !
 
 bitsPerSample:aCollection
-    "set the number of bits per sample. 
+    "set the number of bits per sample.
 
      This interface is only to be used when initializing
      instances or by image readers. Calling for a change of an
@@ -2988,11 +2988,11 @@
     depth := self depth.
     bitsPerPixel := d.
     d == 24 ifTrue:[
-        samplesPerPixel := 3.
-        bitsPerSample := #[8 8 8]
+	samplesPerPixel := 3.
+	bitsPerSample := #[8 8 8]
     ] ifFalse:[
-        samplesPerPixel := 1.
-        bitsPerSample := ByteArray with:d 
+	samplesPerPixel := 1.
+	bitsPerSample := ByteArray with:d
     ]
 
     "Modified: 20.2.1997 / 14:39:10 / cg"
@@ -3026,7 +3026,7 @@
 photometric:aSymbol
     "set the photometric interpretation of the pixel values.
      The argument, aSymbol is one of:
-        #blackIs0, #whiteIs0, #palette, #rgb
+	#blackIs0, #whiteIs0, #palette, #rgb
      See TIFF documentation, from which the photometric concept is borrowed.
 
      This interface is only to be used when initializing
@@ -3037,19 +3037,19 @@
 
     photometric := aSymbol.
     bitsPerSample isNil ifTrue:[
-        photometric == #rgb ifTrue:[
-            b := self class imageDepth // 3.
-            bitsPerSample := ByteArray with:b with:b with:b
-        ] ifFalse:[
-            bitsPerSample := ByteArray with:(self class imageDepth)
-        ].
+	photometric == #rgb ifTrue:[
+	    b := self class imageDepth // 3.
+	    bitsPerSample := ByteArray with:b with:b with:b
+	] ifFalse:[
+	    bitsPerSample := ByteArray with:(self class imageDepth)
+	].
     ].
     samplesPerPixel isNil ifTrue:[
-        photometric == #rgb ifTrue:[
-            samplesPerPixel := 3
-        ] ifFalse:[
-            samplesPerPixel := 1
-        ]
+	photometric == #rgb ifTrue:[
+	    samplesPerPixel := 3
+	] ifFalse:[
+	    samplesPerPixel := 1
+	]
     ].
 
     "Modified: 10.6.1996 / 18:21:29 / cg"
@@ -3079,7 +3079,7 @@
     "Modified: 23.4.1996 / 11:08:48 / cg"
 !
 
-width:w height:h 
+width:w height:h
     "set the width and height of the image.
 
      This interface is only to be used when initializing
@@ -3148,13 +3148,13 @@
      existing image may confuse later pixel interpretation."
 
     ^ self
-	width:w 
-	height:h 
-	photometric:p 
-	samplesPerPixel:spp 
-	bitsPerSample:bps 
-	colorMap:cm 
-	bits:pixels 
+	width:w
+	height:h
+	photometric:p
+	samplesPerPixel:spp
+	bitsPerSample:bps
+	colorMap:cm
+	bits:pixels
 	mask:nil
 
     "Modified: 20.6.1996 / 17:10:24 / cg"
@@ -3271,14 +3271,14 @@
      |i|
 
      i := Depth4Image
-             width:4 
-             height:4
-             fromArray:#[ 
-                            16r01 16r23
-                            16r45 16r67
-                            16r89 16rab
-                            16rcd 16ref 
-                        ].
+	     width:4
+	     height:4
+	     fromArray:#[
+			    16r01 16r23
+			    16r45 16r67
+			    16r89 16rab
+			    16rcd 16ref
+			].
      i := i magnifiedBy:30.
      i inspect.
      i asFloydSteinbergDitheredMonochromeImage inspect.
@@ -3315,10 +3315,10 @@
     "return an error-diffusion dithered monochrome image from the receiver image."
 
     DitherAlgorithm == #burkes ifTrue:[
-        ^ self asBurkesDitheredMonochromeImage
+	^ self asBurkesDitheredMonochromeImage
     ].
     DitherAlgorithm == #stevensonArce ifTrue:[
-        ^ self asStevensonArceDitheredMonochromeImage
+	^ self asStevensonArceDitheredMonochromeImage
     ].
     ^ self asFloydSteinbergDitheredMonochromeImage
 
@@ -3344,14 +3344,14 @@
      |i|
 
      i := Depth4Image
-             width:4 
-             height:4
-             fromArray:#[ 
-                            16r01 16r23
-                            16r45 16r67
-                            16r89 16rab
-                            16rcd 16ref 
-                        ].
+	     width:4
+	     height:4
+	     fromArray:#[
+			    16r01 16r23
+			    16r45 16r67
+			    16r89 16rab
+			    16rcd 16ref
+			].
      i := i magnifiedBy:30.
      i inspect.
      i asErrorDitheredMonochromeImage inspect.
@@ -3361,8 +3361,8 @@
     "Modified: 10.6.1996 / 14:22:30 / cg"
 !
 
-asFloydSteinbergDitheredDepth8FormOn:aDevice colors:fixColors 
-    "return a floyd-steinberg dithered pseudoForm from the picture. 
+asFloydSteinbergDitheredDepth8FormOn:aDevice colors:fixColors
+    "return a floyd-steinberg dithered pseudoForm from the picture.
      Use the colors in the fixColors array.
      By passing the ditherColors as extra array, this method can
      also be used to dither an 8bit image into a smaller number of colors,
@@ -3372,9 +3372,9 @@
 
     deviceDepth := aDevice depth.
     deviceDepth == 8 ifFalse:[
-        (aDevice supportedImageFormatForDepth:8) isNil ifTrue:[
-            ^ nil.
-        ]
+	(aDevice supportedImageFormatForDepth:8) isNil ifTrue:[
+	    ^ nil.
+	]
     ].
 
     pseudoBits := self floydSteinbergDitheredDepth8BitsColors:fixColors.
@@ -3389,51 +3389,51 @@
     "/
     map := Array new:256.
     fixColors do:[:clr |
-        map at:clr colorId + 1 put:clr
-    ].
-    f colorMap:map. 
+	map at:clr colorId + 1 put:clr
+    ].
+    f colorMap:map.
     f initGC.
     f bits:pseudoBits.
-    aDevice 
-        drawBits:pseudoBits 
-        bitsPerPixel:8 
-        depth:deviceDepth  
-        padding:8
-        width:width height:height
-        x:0 y:0
-        into:(f id) x:0 y:0 
-        width:width height:height 
-        with:(f gcId).
+    aDevice
+	drawBits:pseudoBits
+	bitsPerPixel:8
+	depth:deviceDepth
+	padding:8
+	width:width height:height
+	x:0 y:0
+	into:(f id) x:0 y:0
+	width:width height:height
+	with:(f gcId).
     ^ f
 
     "
-     example: 
-        color reduction from Depth8 to Depth4 (dithering) can be done by:
+     example:
+	color reduction from Depth8 to Depth4 (dithering) can be done by:
 
      |img8 reducedImg8 img4 map form|
 
-     map := #( 
-                  (0     0   0)
-                  (0     0 100)
-                  (0    50   0)
-                  (0    50 100)
-                  (0   100   0)
-                  (0   100 100)
-                  (100   0   0)
-                  (100   0 100)
-                  (100  50   0)
-                  (100  50 100)
-                  (100 100   0)
-                  (100 100 100)) collect:[:rgb | (Color red:(rgb at:1)
-                                                      green:(rgb at:2)
-                                                       blue:(rgb at:3)) onDevice:Display].
+     map := #(
+		  (0     0   0)
+		  (0     0 100)
+		  (0    50   0)
+		  (0    50 100)
+		  (0   100   0)
+		  (0   100 100)
+		  (100   0   0)
+		  (100   0 100)
+		  (100  50   0)
+		  (100  50 100)
+		  (100 100   0)
+		  (100 100 100)) collect:[:rgb | (Color red:(rgb at:1)
+						      green:(rgb at:2)
+						       blue:(rgb at:3)) onDevice:Display].
 
      img8 := Image fromFile:'goodies/bitmaps/bf.im8'.
-     form := img8 paletteImageAsDitheredPseudoFormOn:Display 
-                      colors:map 
-                        nRed:2
-                      nGreen:3
-                       nBlue:2.
+     form := img8 paletteImageAsDitheredPseudoFormOn:Display
+		      colors:map
+			nRed:2
+		      nGreen:3
+		       nBlue:2.
      img8 := Depth8Image fromForm:form.    'dithered version of original image'.
      img4 := Depth4Image fromImage:img8.
     "
@@ -3442,11 +3442,11 @@
     "Created: 23.6.1997 / 15:25:37 / cg"
 !
 
-asFloydSteinbergDitheredDepth8FormOn:aDevice colors:fixColors nRed:nRed nGreen:nGreen nBlue:nBlue 
-    "return a floyd-steinberg dithered pseudoForm from the palette picture. 
+asFloydSteinbergDitheredDepth8FormOn:aDevice colors:fixColors nRed:nRed nGreen:nGreen nBlue:nBlue
+    "return a floyd-steinberg dithered pseudoForm from the palette picture.
      Use the colors in the fixColors array, which must be fixR x fixG x fixB
      colors assigned to aDevice, such as the preallocated colors of the
-     Color class. 
+     Color class.
      By passing the ditherColors as extra array, this method can
      also be used to dither an 8bit image into a smaller number of colors,
      for example to create dithered Depth4Images from Depth8Images."
@@ -3455,9 +3455,9 @@
 
     deviceDepth := aDevice depth.
     deviceDepth == 8 ifFalse:[
-        (aDevice supportedImageFormatForDepth:8) isNil ifTrue:[
-            ^ nil
-        ]
+	(aDevice supportedImageFormatForDepth:8) isNil ifTrue:[
+	    ^ nil
+	]
     ].
 
     pseudoBits := self floydSteinbergDitheredDepth8BitsColors:fixColors nRed:nRed nGreen:nGreen nBlue:nBlue.
@@ -3472,51 +3472,51 @@
     "/
     map := Array new:256.
     fixColors do:[:clr |
-        map at:clr colorId + 1 put:clr
-    ].
-    f colorMap:map. 
+	map at:clr colorId + 1 put:clr
+    ].
+    f colorMap:map.
     f initGC.
     f bits:pseudoBits.
-    aDevice 
-        drawBits:pseudoBits 
-        bitsPerPixel:8 
-        depth:deviceDepth  
-        padding:8
-        width:width height:height
-        x:0 y:0
-        into:(f id) x:0 y:0 
-        width:width height:height 
-        with:(f gcId).
+    aDevice
+	drawBits:pseudoBits
+	bitsPerPixel:8
+	depth:deviceDepth
+	padding:8
+	width:width height:height
+	x:0 y:0
+	into:(f id) x:0 y:0
+	width:width height:height
+	with:(f gcId).
     ^ f
 
     "
-     example: 
-        color reduction from Depth8 to Depth4 (dithering) can be done by:
+     example:
+	color reduction from Depth8 to Depth4 (dithering) can be done by:
 
      |img8 reducedImg8 img4 map form|
 
-     map := #( 
-                  (0     0   0)
-                  (0     0 100)
-                  (0    50   0)
-                  (0    50 100)
-                  (0   100   0)
-                  (0   100 100)
-                  (100   0   0)
-                  (100   0 100)
-                  (100  50   0)
-                  (100  50 100)
-                  (100 100   0)
-                  (100 100 100)) collect:[:rgb | (Color red:(rgb at:1)
-                                                      green:(rgb at:2)
-                                                       blue:(rgb at:3)) onDevice:Display].
+     map := #(
+		  (0     0   0)
+		  (0     0 100)
+		  (0    50   0)
+		  (0    50 100)
+		  (0   100   0)
+		  (0   100 100)
+		  (100   0   0)
+		  (100   0 100)
+		  (100  50   0)
+		  (100  50 100)
+		  (100 100   0)
+		  (100 100 100)) collect:[:rgb | (Color red:(rgb at:1)
+						      green:(rgb at:2)
+						       blue:(rgb at:3)) onDevice:Display].
 
      img8 := Image fromFile:'goodies/bitmaps/bf.im8'.
-     form := img8 paletteImageAsDitheredPseudoFormOn:Display 
-                      colors:map 
-                        nRed:2
-                      nGreen:3
-                       nBlue:2.
+     form := img8 paletteImageAsDitheredPseudoFormOn:Display
+		      colors:map
+			nRed:2
+		      nGreen:3
+		       nBlue:2.
      img8 := Depth8Image fromForm:form.    'dithered version of original image'.
      img4 := Depth4Image fromImage:img8.
     "
@@ -3587,7 +3587,7 @@
      |i|
 
      i := Depth24Image width:4 height:1
-	  fromArray:#[ 
+	  fromArray:#[
 	    16rFF 16r00 16r00   16rFF 16r00 16r00  16rFF 16r00 16r00  16rFF 16r00 16r00
 	    16rFF 16r00 16r00   16rFF 16r00 16r00  16rFF 16r00 16r00  16rFF 16r00 16r00
 	    16rFF 16r00 16r00   16rFF 16r00 16r00  16rFF 16r00 16r00  16rFF 16r00 16r00
@@ -3604,7 +3604,7 @@
      |i|
 
      i := Depth24Image width:4 height:6
-	  fromArray:#[ 
+	  fromArray:#[
 	    16r00 16r00 16r00   16r00 16r00 16r80  16r00 16r00 16rff  16r00 16r80 16r00
 	    16r00 16r80 16r80   16r00 16rFF 16r00  16r00 16rFF 16r80  16r00 16rFF 16rFF
 	    16r80 16r00 16r00   16r80 16r00 16r80  16r80 16r00 16rff  16r80 16r80 16r00
@@ -3642,13 +3642,13 @@
      |i|
 
      i := Depth4Image
-	     width:4 
+	     width:4
 	     height:4
-	     fromArray:#[ 
+	     fromArray:#[
 			    16r01 16r23
 			    16r45 16r67
 			    16r89 16rab
-			    16rcd 16ref 
+			    16rcd 16ref
 			].
      i := i magnifiedBy:30.
      i inspect.
@@ -3729,13 +3729,13 @@
      |i|
 
      i := Depth4Image
-	     width:4 
+	     width:4
 	     height:4
-	     fromArray:#[ 
+	     fromArray:#[
 			    16r01 16r23
 			    16r45 16r67
 			    16r89 16rab
-			    16rcd 16ref 
+			    16rcd 16ref
 			].
      i := i magnifiedBy:30.
      i inspect.
@@ -3756,22 +3756,22 @@
 
     deviceDepth := aDevice depth.
     has8BitImage := (deviceDepth == 8)
-                    or:[ (aDevice supportedImageFormatForDepth:8) notNil ].
+		    or:[ (aDevice supportedImageFormatForDepth:8) notNil ].
 
     has8BitImage ifFalse:[
-        deviceDepth == 4 ifFalse:[^ nil].
-
-        pseudoBits8 := self nfloydSteinbergDitheredDepth8BitsColors:colors.
-        pseudoBits8 isNil ifTrue:[^ nil].
-        "/ convert to devices depth
-
-        pseudoBits := ByteArray new:(width*4+7//8 * height).
-        pseudoBits8 compressPixels:4 width:width height:height into:pseudoBits mapping:nil.
-        d := 4.
+	deviceDepth == 4 ifFalse:[^ nil].
+
+	pseudoBits8 := self nfloydSteinbergDitheredDepth8BitsColors:colors.
+	pseudoBits8 isNil ifTrue:[^ nil].
+	"/ convert to devices depth
+
+	pseudoBits := ByteArray new:(width*4+7//8 * height).
+	pseudoBits8 compressPixels:4 width:width height:height into:pseudoBits mapping:nil.
+	d := 4.
     ] ifTrue:[
-        pseudoBits := self nfloydSteinbergDitheredDepth8BitsColors:colors.
-        pseudoBits isNil ifTrue:[^ nil].
-        d := 8.
+	pseudoBits := self nfloydSteinbergDitheredDepth8BitsColors:colors.
+	pseudoBits isNil ifTrue:[^ nil].
+	d := 8.
     ].
 
     f := Form width:width height:height depth:deviceDepth on:aDevice.
@@ -3783,23 +3783,23 @@
     "/
     map := Array new:256 withAll:0.
     colors do:[:clr |
-        clr notNil ifTrue:[
-            map at:clr colorId + 1 put:clr
-        ]
-    ].
-    f colorMap:map. 
+	clr notNil ifTrue:[
+	    map at:clr colorId + 1 put:clr
+	]
+    ].
+    f colorMap:map.
     f initGC.
     f bits:pseudoBits.
-    aDevice 
-        drawBits:pseudoBits 
-        bitsPerPixel:d 
-        depth:deviceDepth  
-        padding:8
-        width:width height:height
-        x:0 y:0
-        into:(f id) x:0 y:0 
-        width:width height:height 
-        with:(f gcId).
+    aDevice
+	drawBits:pseudoBits
+	bitsPerPixel:d
+	depth:deviceDepth
+	padding:8
+	width:width height:height
+	x:0 y:0
+	into:(f id) x:0 y:0
+	width:width height:height
+	with:(f gcId).
     ^ f
 
     "
@@ -3828,58 +3828,58 @@
     ((aDevice == device) and:[deviceForm notNil]) ifTrue:[^ deviceForm].
 
     mask notNil ifTrue:[
-        mask := mask onDevice:aDevice
+	mask := mask onDevice:aDevice
     ].
 
     (aDevice depth == 1
     or:[aDevice hasGrayscales not]) ifTrue:[
-        form := self asMonochromeFormOn:aDevice.
+	form := self asMonochromeFormOn:aDevice.
     ] ifFalse:[
-        ((visual := aDevice visualType) == #StaticGray) ifTrue:[
-            form := self asGrayFormOn:aDevice.
-        ] ifFalse:[
-            (visual == #PseudoColor
-             or:[visual == #StaticColor]) ifTrue:[
-                form := self asPseudoFormQuickOn:aDevice.
-            ].
-        ]
+	((visual := aDevice visualType) == #StaticGray) ifTrue:[
+	    form := self asGrayFormOn:aDevice.
+	] ifFalse:[
+	    (visual == #PseudoColor
+	     or:[visual == #StaticColor]) ifTrue:[
+		form := self asPseudoFormQuickOn:aDevice.
+	    ].
+	]
     ].
 
     form isNil ifTrue:[
-        (photometric == #palette) ifTrue:[
-            form := self paletteImageAsFormOn:aDevice
-        ] ifFalse:[
-            (photometric == #rgb) ifTrue:[
-                form := self rgbImageAsFormOn:aDevice
-            ] ifFalse:[
-                (photometric == #cmy or:[photometric == #cmyk]) ifTrue:[
-                    form := self rgbImageAsFormOn:aDevice
-                ] ifFalse:[
-                    form := self greyImageAsFormOn:aDevice
-                ]
-            ]
-        ].
+	(photometric == #palette) ifTrue:[
+	    form := self paletteImageAsFormOn:aDevice
+	] ifFalse:[
+	    (photometric == #rgb) ifTrue:[
+		form := self rgbImageAsFormOn:aDevice
+	    ] ifFalse:[
+		(photometric == #cmy or:[photometric == #cmyk]) ifTrue:[
+		    form := self rgbImageAsFormOn:aDevice
+		] ifFalse:[
+		    form := self greyImageAsFormOn:aDevice
+		]
+	    ]
+	].
     ].
 
     (device isNil or:[aDevice == device]) ifTrue:[
-        "remember this form in the receiver ..."
-
-        form notNil ifTrue:[
-            form := form asImageForm.
-            deviceForm := form.
-            maskedPixelsAre0 := nil.
-            device isNil ifTrue:[
-                device := aDevice.
-                Lobby register:self
-            ] ifFalse:[
-                Lobby registerChange:self
-            ].
-            "
-             can save space, by not keeping the images data-bits
-             twice (here and in the device form)
-            "
-            form forgetBits
-        ]
+	"remember this form in the receiver ..."
+
+	form notNil ifTrue:[
+	    form := form asImageForm.
+	    deviceForm := form.
+	    maskedPixelsAre0 := nil.
+	    device isNil ifTrue:[
+		device := aDevice.
+		Lobby register:self
+	    ] ifFalse:[
+		Lobby registerChange:self
+	    ].
+	    "
+	     can save space, by not keeping the images data-bits
+	     twice (here and in the device form)
+	    "
+	    form forgetBits
+	]
     ].
 
     ^ form
@@ -3941,7 +3941,7 @@
     "get a gray image from the receiver"
 
     (self colorMap notNil and:[depth == self depth]) ifTrue:[
-        ^ self copyWithColorMapProcessing:[:clr | Color brightness:(clr brightness)].
+	^ self copyWithColorMapProcessing:[:clr | Color brightness:(clr brightness)].
     ].
     ^ self asGrayImageDepth:depth dither:DitherAlgorithm.
 
@@ -4007,30 +4007,30 @@
 
     ((aDevice == device) and:[monoDeviceForm notNil]) ifTrue:[^ monoDeviceForm].
     self depth == 1 ifTrue:[
-        ((aDevice == device) and:[deviceForm notNil]) ifTrue:[^ deviceForm].
-        ^ self asFormOn:aDevice
+	((aDevice == device) and:[deviceForm notNil]) ifTrue:[^ deviceForm].
+	^ self asFormOn:aDevice
     ].
 
     form := self asMonochromeFormOn:aDevice dither:DitherAlgorithm.
 
     (device isNil or:[aDevice == device]) ifTrue:[
-        "remember this form in the receiver ..."
-
-        form notNil ifTrue:[
-            form := form asImageForm.
-            monoDeviceForm := form.
-            device isNil ifTrue:[
-                device := aDevice.
-                Lobby register:self
-            ] ifFalse:[
-                Lobby registerChange:self
-            ].
-            "
-             can save space, by not keeping the images data-bits
-             twice (here and in the device form)
-            "
-            form forgetBits
-        ]
+	"remember this form in the receiver ..."
+
+	form notNil ifTrue:[
+	    form := form asImageForm.
+	    monoDeviceForm := form.
+	    device isNil ifTrue:[
+		device := aDevice.
+		Lobby register:self
+	    ] ifFalse:[
+		Lobby registerChange:self
+	    ].
+	    "
+	     can save space, by not keeping the images data-bits
+	     twice (here and in the device form)
+	    "
+	    form forgetBits
+	]
     ].
 
     ^ form
@@ -4078,9 +4078,9 @@
     "Modified: 10.6.1996 / 20:18:05 / cg"
 !
 
-asNearestPaintDepth8FormOn:aDevice colors:fixColors 
-    "return a nearest paint pseudoForm from the palette picture. 
-     Use the colors in the fixColors array. 
+asNearestPaintDepth8FormOn:aDevice colors:fixColors
+    "return a nearest paint pseudoForm from the palette picture.
+     Use the colors in the fixColors array.
      By passing the ditherColors as extra array, this method can
      also be used to dither an 8bit image into a smaller number of colors,
      for example to create dithered Depth4Images from Depth8Images."
@@ -4088,33 +4088,33 @@
     ^ self asNearestPaintDepth8FormOn:aDevice colors:fixColors nRed:nil nGreen:nil nBlue:nil.
 
     "
-     example: 
-        color reduction from Depth8 to Depth4 can be done by:
+     example:
+	color reduction from Depth8 to Depth4 can be done by:
 
      |img8 reducedImg8 img4 map form|
 
-     map := #( 
-                  (0     0   0)
-                  (0     0 100)
-                  (0    50   0)
-                  (0    50 100)
-                  (0   100   0)
-                  (0   100 100)
-                  (100   0   0)
-                  (100   0 100)
-                  (100  50   0)
-                  (100  50 100)
-                  (100 100   0)
-                  (100 100 100)) collect:[:rgb | (Color red:(rgb at:1)
-                                                      green:(rgb at:2)
-                                                       blue:(rgb at:3)) onDevice:Display].
+     map := #(
+		  (0     0   0)
+		  (0     0 100)
+		  (0    50   0)
+		  (0    50 100)
+		  (0   100   0)
+		  (0   100 100)
+		  (100   0   0)
+		  (100   0 100)
+		  (100  50   0)
+		  (100  50 100)
+		  (100 100   0)
+		  (100 100 100)) collect:[:rgb | (Color red:(rgb at:1)
+						      green:(rgb at:2)
+						       blue:(rgb at:3)) onDevice:Display].
 
      img8 := Image fromFile:'goodies/bitmaps/claus.gif'.
-     form := img8 asNearestPaintDepth8FormOn:Display 
-                      colors:map 
-                        nRed:2
-                      nGreen:3
-                       nBlue:2.
+     form := img8 asNearestPaintDepth8FormOn:Display
+		      colors:map
+			nRed:2
+		      nGreen:3
+		       nBlue:2.
      img8 := Depth8Image fromForm:form.    'dithered version of original image'.
      img4 := Depth4Image fromImage:img8.
     "
@@ -4123,11 +4123,11 @@
     "Created: 23.6.1997 / 15:26:09 / cg"
 !
 
-asNearestPaintDepth8FormOn:aDevice colors:fixColors nRed:nRed nGreen:nGreen nBlue:nBlue 
-    "return a nearest paint pseudoForm from the palette picture. 
+asNearestPaintDepth8FormOn:aDevice colors:fixColors nRed:nRed nGreen:nGreen nBlue:nBlue
+    "return a nearest paint pseudoForm from the palette picture.
      Use the colors in the fixColors array, which must be fixR x fixG x fixB
      colors assigned to aDevice, such as the preallocated colors of the
-     Color class. 
+     Color class.
      By passing the ditherColors as extra array, this method can
      also be used to dither an 8bit image into a smaller number of colors,
      for example to create dithered Depth4Images from Depth8Images."
@@ -4136,9 +4136,9 @@
 
     deviceDepth := aDevice depth.
     deviceDepth == 8 ifFalse:[
-        (aDevice supportedImageFormatForDepth:8) isNil ifTrue:[
-            ^ nil
-        ]
+	(aDevice supportedImageFormatForDepth:8) isNil ifTrue:[
+	    ^ nil
+	]
     ].
 
     pseudoBits := self nearestPaintDepth8BitsColors:fixColors nRed:nRed nGreen:nGreen nBlue:nBlue.
@@ -4153,51 +4153,51 @@
     "/
     map := Array new:256.
     fixColors do:[:clr |
-        map at:clr colorId + 1 put:clr
-    ].
-    f colorMap:map. 
+	map at:clr colorId + 1 put:clr
+    ].
+    f colorMap:map.
     f initGC.
     f bits:pseudoBits.
-    aDevice 
-        drawBits:pseudoBits 
-        bitsPerPixel:8 
-        depth:deviceDepth  
-        padding:8
-        width:width height:height
-        x:0 y:0
-        into:(f id) x:0 y:0 
-        width:width height:height 
-        with:(f gcId).
+    aDevice
+	drawBits:pseudoBits
+	bitsPerPixel:8
+	depth:deviceDepth
+	padding:8
+	width:width height:height
+	x:0 y:0
+	into:(f id) x:0 y:0
+	width:width height:height
+	with:(f gcId).
     ^ f
 
     "
-     example: 
-        color reduction from Depth8 to Depth4 (dithering) can be done by:
+     example:
+	color reduction from Depth8 to Depth4 (dithering) can be done by:
 
      |img8 reducedImg8 img4 map form|
 
-     map := #( 
-                  (0     0   0)
-                  (0     0 100)
-                  (0    50   0)
-                  (0    50 100)
-                  (0   100   0)
-                  (0   100 100)
-                  (100   0   0)
-                  (100   0 100)
-                  (100  50   0)
-                  (100  50 100)
-                  (100 100   0)
-                  (100 100 100)) collect:[:rgb | (Color red:(rgb at:1)
-                                                      green:(rgb at:2)
-                                                       blue:(rgb at:3)) onDevice:Display].
+     map := #(
+		  (0     0   0)
+		  (0     0 100)
+		  (0    50   0)
+		  (0    50 100)
+		  (0   100   0)
+		  (0   100 100)
+		  (100   0   0)
+		  (100   0 100)
+		  (100  50   0)
+		  (100  50 100)
+		  (100 100   0)
+		  (100 100 100)) collect:[:rgb | (Color red:(rgb at:1)
+						      green:(rgb at:2)
+						       blue:(rgb at:3)) onDevice:Display].
 
      img8 := Image fromFile:'goodies/bitmaps/claus.gif'.
-     form := img8 asNearestPaintDepth8FormOn:Display 
-                      colors:map 
-                        nRed:2
-                      nGreen:3
-                       nBlue:2.
+     form := img8 asNearestPaintDepth8FormOn:Display
+		      colors:map
+			nRed:2
+		      nGreen:3
+		       nBlue:2.
      img8 := Depth8Image fromForm:form.    'dithered version of original image'.
      img4 := Depth4Image fromImage:img8.
     "
@@ -4206,7 +4206,7 @@
     "Modified: 17.6.1996 / 18:52:47 / cg"
 !
 
-asNearestPaintImageDepth:d colors:colors 
+asNearestPaintImageDepth:d colors:colors
     "return a threshold image from the receiver picture, using colors in colors."
 
     |newBits|
@@ -4228,7 +4228,7 @@
     |depth bits|
 
     depth := aDevice depth.
-    (depth == 1 
+    (depth == 1
     or:[aDevice hasGrayscales not]) ifTrue:[
 	"/ for monochrome, there is highly specialized
 	"/ monochrome dither code available
@@ -4262,26 +4262,26 @@
     dither := self class orderedDitherMatrixOfSize:8.
 
     (depth == 1) ifTrue:[
-        "/ for monochrome, there is highly specialized
-        "/ monochrome dither code available
-
-        ^ Depth1Image
-            width:width
-            height:height
-            fromArray:(
-                self
-                    orderedDitheredMonochromeBitsWithDitherMatrix:dither
-                    ditherWidth:8)
+	"/ for monochrome, there is highly specialized
+	"/ monochrome dither code available
+
+	^ Depth1Image
+	    width:width
+	    height:height
+	    fromArray:(
+		self
+		    orderedDitheredMonochromeBitsWithDitherMatrix:dither
+		    ditherWidth:8)
     ].
 
     ^ (self class implementorForDepth:depth)
-        width:width
-        height:height
-        fromArray:(
-            self
-                orderedDitheredGrayBitsWithDitherMatrix:dither
-                ditherWidth:8
-                depth:depth)
+	width:width
+	height:height
+	fromArray:(
+	    self
+		orderedDitheredGrayBitsWithDitherMatrix:dither
+		ditherWidth:8
+		depth:depth)
 
     "
      |i i1 i2 i4 i8|
@@ -4335,13 +4335,13 @@
     "/ distinct colors present. Use 8x8 for high-number,
     "/ 4x4 for small number of colors ...
 
-    ^ self 
-        asOrderedDitheredMonochromeFormOn:aDevice 
-        ditherMatrix:(self class orderedDitherMatrixOfSize:4)
-        ditherWidth:4
-
-"/    ^ self 
-"/        asOrderedDitheredMonochromeFormOn:aDevice 
+    ^ self
+	asOrderedDitheredMonochromeFormOn:aDevice
+	ditherMatrix:(self class orderedDitherMatrixOfSize:4)
+	ditherWidth:4
+
+"/    ^ self
+"/        asOrderedDitheredMonochromeFormOn:aDevice
 "/        ditherMatrix:(self class orderedDitherMatrixOfSize:8)
 "/        ditherWidth:8
 
@@ -4425,11 +4425,11 @@
     "/ distinct colors present. Use 8x8 for high-number,
     "/ 4x4 for small number of colors ...
 
-    ^ self 
-        asOrderedDitheredMonochromeImageWithDitherMatrix:(self class orderedDitherMatrixOfSize:4)
-        ditherWidth:4
-
-"/    ^ self 
+    ^ self
+	asOrderedDitheredMonochromeImageWithDitherMatrix:(self class orderedDitherMatrixOfSize:4)
+	ditherWidth:4
+
+"/    ^ self
 "/        asOrderedDitheredMonochromeImageWithDitherMatrix:(self class orderedDitherMatrixOfSize:8)
 "/        ditherWidth:8
 
@@ -4483,8 +4483,8 @@
 
      i := Image fromFile:'goodies/bitmaps/gifImages/garfield.gif'.
      i
-        asOrderedDitheredMonochromeImageWithDitherMatrix:(Image orderedDitherMatrixOfSize:4)
-        ditherWidth:4
+	asOrderedDitheredMonochromeImageWithDitherMatrix:(Image orderedDitherMatrixOfSize:4)
+	ditherWidth:4
     "
 
     "order-6 dither:
@@ -4493,8 +4493,8 @@
 
      i := Image fromFile:'goodies/bitmaps/gifImages/garfield.gif'.
      i
-        asOrderedDitheredMonochromeImageWithDitherMatrix:(Image orderedDitherMatrixOfSize:8)
-        ditherWidth:8
+	asOrderedDitheredMonochromeImageWithDitherMatrix:(Image orderedDitherMatrixOfSize:8)
+	ditherWidth:8
     "
 
 
@@ -4504,8 +4504,8 @@
 
      i := Image fromFile:'goodies/bitmaps/gifImages/garfield.gif'.
      i
-        asOrderedDitheredMonochromeImageWithDitherMatrix:(ByteArray new:16 withAll:8)
-        ditherWidth:4
+	asOrderedDitheredMonochromeImageWithDitherMatrix:(ByteArray new:16 withAll:8)
+	ditherWidth:4
     "
 
     "thresholding at: 0.25 (all above 0.25 becomes white):
@@ -4514,8 +4514,8 @@
 
      i := Image fromFile:'goodies/bitmaps/gifImages/garfield.gif'.
      i
-        asOrderedDitheredMonochromeImageWithDitherMatrix:(ByteArray new:16 withAll:3)
-        ditherWidth:4
+	asOrderedDitheredMonochromeImageWithDitherMatrix:(ByteArray new:16 withAll:3)
+	ditherWidth:4
     "
 
     "thresholding at: 0.75 (all above 0.75 becomes white):
@@ -4524,8 +4524,8 @@
 
      i := Image fromFile:'goodies/bitmaps/gifImages/garfield.gif'.
      i
-        asOrderedDitheredMonochromeImageWithDitherMatrix:(ByteArray new:16 withAll:11)
-        ditherWidth:4
+	asOrderedDitheredMonochromeImageWithDitherMatrix:(ByteArray new:16 withAll:11)
+	ditherWidth:4
     "
 
     "Modified: 7.6.1996 / 17:23:47 / cg"
@@ -4535,12 +4535,12 @@
     "return a pseudo-deviceForm from the image.
      Fail if any color is not available (i.e. do not dither)."
 
-    |f d 
-     temp temp8 bits clr cMap idMap 
+    |f d
+     temp temp8 bits clr cMap idMap
      w            "{ Class: SmallInteger }"
      h            "{ Class: SmallInteger }"
      dDev         "{ Class: SmallInteger }"
-     nClr         "{ Class: SmallInteger }" 
+     nClr         "{ Class: SmallInteger }"
      bytesPerLine "{ Class: SmallInteger }"
      usedColors pix fmt bytes|
 
@@ -4618,7 +4618,7 @@
 	"/ only translate
 	temp := ByteArray uninitializedNew:(w * h).
 	bytes expandPixels:8         "xlate only"
-		    width:w 
+		    width:w
 		   height:h
 		     into:temp
 		  mapping:idMap.
@@ -4633,8 +4633,8 @@
 	d ~~ 8 ifTrue:[
 	    temp8 := ByteArray uninitializedNew:(w * h).
 
-	    bytes expandPixels:d      
-			 width:w 
+	    bytes expandPixels:d
+			 width:w
 			height:h
 			  into:temp8
 		       mapping:idMap.
@@ -4646,8 +4646,8 @@
 	dDev ~~ 8 ifTrue:[
 	    temp := ByteArray uninitializedNew:(bytesPerLine * h).
 
-	    temp8 compressPixels:dDev      
-			 width:w 
+	    temp8 compressPixels:dDev
+			 width:w
 			height:h
 			  into:temp
 		       mapping:idMap.
@@ -4659,19 +4659,19 @@
     f := Form width:w height:h depth:dDev on:aDevice.
     f isNil ifTrue:[^ nil].
 
-    f colorMap:cMap. 
+    f colorMap:cMap.
     f initGC.
 
-    aDevice 
-	drawBits:temp 
-	depth:dDev 
+    aDevice
+	drawBits:temp
+	depth:dDev
 	padding:8
-	width:w 
+	width:w
 	height:h
 	x:0 y:0
-	into:(f id) x:0 y:0 
-	width:w 
-	height:h 
+	into:(f id) x:0 y:0
+	width:w
+	height:h
 	with:(f gcId).
 
     ^ f
@@ -4679,13 +4679,13 @@
     "
      (
 	(((Depth4Image
-	     width:4 
+	     width:4
 	     height:4
-	     fromArray:#[ 
+	     fromArray:#[
 			    16r01 16r23
 			    16r45 16r67
 			    16r89 16rab
-			    16rcd 16ref 
+			    16rcd 16ref
 			]))
 	       magnifiedBy:30
 	 )
@@ -4734,14 +4734,14 @@
      |i|
 
      i := Depth4Image
-             width:4 
-             height:4
-             fromArray:#[ 
-                            16r01 16r23
-                            16r45 16r67
-                            16r89 16rab
-                            16rcd 16ref 
-                        ].
+	     width:4
+	     height:4
+	     fromArray:#[
+			    16r01 16r23
+			    16r45 16r67
+			    16r89 16rab
+			    16rcd 16ref
+			].
      i := i magnifiedBy:30.
      i inspect.
      i asStevensonArceDitheredMonochromeImage inspect.
@@ -4761,9 +4761,9 @@
 	^ self asThresholdMonochromeFormOn:aDevice
     ].
 
-    ^ self 
-	makeDeviceGrayPixmapOn:aDevice 
-	depth:depth 
+    ^ self
+	makeDeviceGrayPixmapOn:aDevice
+	depth:depth
 	fromArray:(self
 			orderedDitheredGrayBitsWithDitherMatrix:#[8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8]
 			ditherWidth:4
@@ -4832,8 +4832,8 @@
 asThresholdMonochromeFormOn:aDevice
     "return a threshold monochrome form from the image."
 
-    ^ self 
-	asOrderedDitheredMonochromeFormOn:aDevice 
+    ^ self
+	asOrderedDitheredMonochromeFormOn:aDevice
 	ditherMatrix:#[8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8]
 	ditherWidth:4
 
@@ -5043,7 +5043,7 @@
 fromImage:anImage
     "setup the receiver from another image.
      Color precision may be lost, if conversion is from a higher depth
-     image. 
+     image.
      WARNING:
      This implementation is a slow fallback (the loop over the
      source pixels is very slow). If this method is used heavily, you
@@ -5055,7 +5055,7 @@
 fromImage:anImage photometric:photometricOrNil
     "setup the receiver from another image and optionally set the photometric.
      Color precision may be lost, if conversion is from a higher depth
-     image. 
+     image.
      WARNING:
      This implementation is a slow fallback (the loop over the
      source pixels is very slow). If this method is used heavily, you
@@ -5187,14 +5187,14 @@
     and:[self bitsPerPixel = anImage bitsPerPixel
     and:[colorMap = anImage colorMap]]) ifTrue:[
 	"/ can do it by value
-	anImage 
+	anImage
 	    valuesFromX:xL y:yT toX:xR y:yB
 	    do:[:x :y :pixelValue |
 		    self pixelAtX:x-xL y:y-yT put:pixelValue.
 	       ]
     ] ifFalse:[
 	"/ must do it by colors
-	anImage 
+	anImage
 	    colorsFromX:xL y:yT toX:xR y:yB
 	    do:[:x :y :clr |
 		    self colorAtX:x-xL y:y-yT put:clr.
@@ -5207,7 +5207,7 @@
 	] ifFalse:[
 	    maskClass := anImage mask class.
 	].
-	mask := maskClass new 
+	mask := maskClass new
 		    fromSubImage:anImage mask in:aRectangle
     ].
 
@@ -5324,8 +5324,8 @@
 greyImageAsPseudoFormOn:aDevice
     "return an 8-bit pseudo Form from the grey image"
 
-    |wideBits pictureDepth f map  
-     colorMap usedColors nUsed aColor 
+    |wideBits pictureDepth f map
+     colorMap usedColors nUsed aColor
      nColors "{ Class: SmallInteger }"
      range id
      cube nR nG nB grayColors
@@ -5347,8 +5347,8 @@
 	(grayColors := aDevice fixGrayColors) notNil ifTrue:[
 	    DitherAlgorithm == #floydSteinberg ifTrue:[
 		f := self
-		       asFloydSteinbergDitheredDepth8FormOn:aDevice 
-		       colors:grayColors 
+		       asFloydSteinbergDitheredDepth8FormOn:aDevice
+		       colors:grayColors
 	    ].
 	    f notNil ifTrue:[^ f].
 	].
@@ -5360,15 +5360,15 @@
 
 	    DitherAlgorithm == #floydSteinberg ifTrue:[
 		f := self
-		       asFloydSteinbergDitheredDepth8FormOn:aDevice 
-		       colors:cube 
+		       asFloydSteinbergDitheredDepth8FormOn:aDevice
+		       colors:cube
 		       nRed:nR
 		       nGreen:nG
 		       nBlue:nB.
 	    ] ifFalse:[
 		f := self
-		       asNearestPaintDepth8FormOn:aDevice 
-		       colors:cube 
+		       asNearestPaintDepth8FormOn:aDevice
+		       colors:cube
 		       nRed:nR
 		       nGreen:nG
 		       nBlue:nB.
@@ -5423,7 +5423,7 @@
     ].
 
     "expand & translate"
-    self bits 
+    self bits
 	expandPixels:pictureDepth
 	width:width height:height
 	into:wideBits
@@ -5431,17 +5431,17 @@
 
     f := Form width:width height:height depth:8 on:aDevice.
     f isNil ifTrue:[^ nil].
-    f colorMap:colorMap. 
+    f colorMap:colorMap.
     f initGC.
-    aDevice 
-	drawBits:wideBits 
-	depth:8 
+    aDevice
+	drawBits:wideBits
+	depth:8
 	padding:8
 	width:width height:height
 	x:0 y:0
-	into:(f id) 
-	x:0 y:0 
-	width:width height:height 
+	into:(f id)
+	x:0 y:0
+	width:width height:height
 	with:(f gcId).
     ^ f
 
@@ -5452,18 +5452,18 @@
     "return a true-color device-form for the grey-image receiver.
      TODO: the pixel loops ought to be implemented as inline primitive code ..."
 
-    |depth  
+    |depth
      myDepth    "{ Class: SmallInteger }"
      nColors    "{ Class: SmallInteger }"
      colorValues
-     scaleDown 
+     scaleDown
      scaleRed   "{ Class: SmallInteger }"
      scaleGreen "{ Class: SmallInteger }"
      scaleBlue  "{ Class: SmallInteger }"
      redShift   "{ Class: SmallInteger }"
      blueShift  "{ Class: SmallInteger }"
      greenShift "{ Class: SmallInteger }"
-     form bestFormat usedDeviceDepth usedDeviceBitsPerPixel imageBits 
+     form bestFormat usedDeviceDepth usedDeviceBitsPerPixel imageBits
      greyValue  "{ Class: SmallInteger }"
      h          "{ Class: SmallInteger }"
      w          "{ Class: SmallInteger }"
@@ -5544,14 +5544,14 @@
     form isNil ifTrue:[^ nil].
     form initGC.
 
-    form 
-	copyBitsFrom:imageBits 
-	bitsPerPixel:usedDeviceBitsPerPixel 
-	depth:usedDeviceDepth 
+    form
+	copyBitsFrom:imageBits
+	bitsPerPixel:usedDeviceBitsPerPixel
+	depth:usedDeviceDepth
 	padding:8
-	width:width height:height 
-	x:0 y:0 
-	toX:0 y:0. 
+	width:width height:height
+	x:0 y:0
+	toX:0 y:0.
 
     ^ form
 
@@ -5606,15 +5606,15 @@
     |tempImage d temp8|
 
     d := self depth.
-    (#(1 2 4 8) includes:d) ifTrue:[ 
+    (#(1 2 4 8) includes:d) ifTrue:[
 	"
 	 fallback code for some depth's:
 	 create a temporary Depth8Image and use its conversion method
 	"
 	temp8 := ByteArray uninitializedNew:(width * height).
 
-	self bits 
-	    expandPixels:d      
+	self bits
+	    expandPixels:d
 	    width:width height:height
 	    into:temp8
 	    mapping:nil.
@@ -5629,13 +5629,13 @@
 paletteImageAsTrueColorFormOn:aDevice
     "return a true-color device-form for the palette-image receiver."
 
-    |depth 
+    |depth
      nColors "{ Class: SmallInteger }"
      h       "{ Class: SmallInteger }"
      pixel   "{ Class: SmallInteger }"
-     colorValues 
+     colorValues
      scaleRed scaleGreen scaleBlue redShift greenShift blueShift
-     form imageBits bestFormat usedDeviceDepth usedDeviceBitsPerPixel 
+     form imageBits bestFormat usedDeviceDepth usedDeviceBitsPerPixel
      i pixelArray newPixelArray
      clr r g b rv gv bv v "{ Class: SmallInteger }" |
 
@@ -5647,7 +5647,7 @@
     bestFormat := self bestSupportedImageFormatFor:aDevice.
     usedDeviceDepth := bestFormat at:#depth.
     usedDeviceDepth == 1 ifTrue:[
-        ^ self asMonochromeFormOn:aDevice.
+	^ self asMonochromeFormOn:aDevice.
     ].
     usedDeviceBitsPerPixel := bestFormat at:#bitsPerPixel.
 
@@ -5661,33 +5661,33 @@
 
     nColors := colorMap size.
     nColors <= 4096 ifTrue:[
-        "/ precompute scales to map from 0..100 into devices range
-        "/ (this may be different for the individual components)
-        colorValues := Array uninitializedNew:nColors.
-
-        1 to:nColors do:[:index |
-            r := colorMap redByteAt:index.
-            g := colorMap greenByteAt:index.
-            b := colorMap blueByteAt:index.
+	"/ precompute scales to map from 0..100 into devices range
+	"/ (this may be different for the individual components)
+	colorValues := Array uninitializedNew:nColors.
+
+	1 to:nColors do:[:index |
+	    r := colorMap redByteAt:index.
+	    g := colorMap greenByteAt:index.
+	    b := colorMap blueByteAt:index.
 "/        clr := colorMap at:index.
-            true "clr notNil" ifTrue:[
+	    true "clr notNil" ifTrue:[
 "/            r := clr red.
 "/            g := clr green.
 "/            b := clr blue.
-                rv := (r * scaleRed) rounded.
-                gv := (g * scaleGreen) rounded.
-                bv := (b * scaleBlue) rounded.
-
-                v := rv bitShift:redShift.
-                v := v bitOr:(gv bitShift:greenShift).
-                v := v bitOr:(bv bitShift:blueShift).
-                colorValues at:index put:v.
+		rv := (r * scaleRed) rounded.
+		gv := (g * scaleGreen) rounded.
+		bv := (b * scaleBlue) rounded.
+
+		v := rv bitShift:redShift.
+		v := v bitOr:(gv bitShift:greenShift).
+		v := v bitOr:(bv bitShift:blueShift).
+		colorValues at:index put:v.
 "/ clr print. ' ' print.
 "/ rv print. ' ' print. gv print. ' ' print. bv print. ' ' print.
 "/ ' -> ' print. v printNL.
 
-            ]
-        ].
+	    ]
+	].
     ].
 
     "/ the temporary helper image is only needed to allow
@@ -5706,51 +5706,51 @@
     newPixelArray := i pixelArraySpecies new:width.
 
     colorValues notNil ifTrue:[
-        0 to:h do:[:y |
-            self rowAt:y into:pixelArray.
-            1 to:width do:[:x |
-                pixel := pixelArray at:x.
-                newPixelArray at:x put:(colorValues at:pixel + 1).
-            ].
-            i rowAt:y putAll:newPixelArray.
-        ].
+	0 to:h do:[:y |
+	    self rowAt:y into:pixelArray.
+	    1 to:width do:[:x |
+		pixel := pixelArray at:x.
+		newPixelArray at:x put:(colorValues at:pixel + 1).
+	    ].
+	    i rowAt:y putAll:newPixelArray.
+	].
     ] ifFalse:[
-        0 to:h do:[:y |
-            self rowAt:y into:pixelArray.
-            1 to:width do:[:x |
-                
-                pixel := pixelArray at:x.
-                clr := self colorFromValue:pixel.
-                r := clr redByte.
-                g := clr greenByte.
-                b := clr blueByte.
-
-                rv := (r * scaleRed) rounded.
-                gv := (g * scaleGreen) rounded.
-                bv := (b * scaleBlue) rounded.
-
-                v := rv bitShift:redShift.
-                v := v bitOr:(gv bitShift:greenShift).
-                v := v bitOr:(bv bitShift:blueShift).
-
-                newPixelArray at:x put:v.
-            ].
-            i rowAt:y putAll:newPixelArray.
-        ].
+	0 to:h do:[:y |
+	    self rowAt:y into:pixelArray.
+	    1 to:width do:[:x |
+
+		pixel := pixelArray at:x.
+		clr := self colorFromValue:pixel.
+		r := clr redByte.
+		g := clr greenByte.
+		b := clr blueByte.
+
+		rv := (r * scaleRed) rounded.
+		gv := (g * scaleGreen) rounded.
+		bv := (b * scaleBlue) rounded.
+
+		v := rv bitShift:redShift.
+		v := v bitOr:(gv bitShift:greenShift).
+		v := v bitOr:(bv bitShift:blueShift).
+
+		newPixelArray at:x put:v.
+	    ].
+	    i rowAt:y putAll:newPixelArray.
+	].
     ].
 
     form := Form width:width height:height depth:usedDeviceDepth on:aDevice.
     form isNil ifTrue:[^ nil].
     form initGC.
 
-    form 
-        copyBitsFrom:imageBits 
-        bitsPerPixel:usedDeviceBitsPerPixel 
-        depth:usedDeviceDepth 
-        padding:8
-        width:width height:height 
-        x:0 y:0 
-        toX:0 y:0. 
+    form
+	copyBitsFrom:imageBits
+	bitsPerPixel:usedDeviceBitsPerPixel
+	depth:usedDeviceDepth
+	padding:8
+	width:width height:height
+	x:0 y:0
+	toX:0 y:0.
 
     ^ form
 
@@ -5761,7 +5761,7 @@
 
 asDitheredTrueColor8FormOn:aDevice
     "convert an rgb image to a dithered depth8-form on aDevice.
-     Return the device-form. 
+     Return the device-form.
      This method is only valid for trueColor displays."
 
     |fixColors pixel
@@ -5797,8 +5797,8 @@
     ].
 
     ^ self
-	asFloydSteinbergDitheredDepth8FormOn:aDevice 
-	colors:fixColors 
+	asFloydSteinbergDitheredDepth8FormOn:aDevice
+	colors:fixColors
 	nRed:nRed nGreen:nGreen nBlue:nBlue
 
     "Created: 14.6.1996 / 17:23:52 / cg"
@@ -5889,14 +5889,14 @@
     ].
     form initGC.
 
-    form 
-	copyBitsFrom:self bits 
-	bitsPerPixel:usedDeviceBitsPerPixel 
-	depth:usedDeviceDepth 
+    form
+	copyBitsFrom:self bits
+	bitsPerPixel:usedDeviceBitsPerPixel
+	depth:usedDeviceDepth
 	padding:8
-	width:width height:height 
-	x:0 y:0 
-	toX:0 y:0. 
+	width:width height:height
+	x:0 y:0
+	toX:0 y:0.
 
     ^ form
 
@@ -6026,7 +6026,7 @@
      w               "{Class: SmallInteger }"
      h               "{Class: SmallInteger }"
      bitCnt          "{Class: SmallInteger }"
-     byte            "{Class: SmallInteger }" 
+     byte            "{Class: SmallInteger }"
      grey|
 
     self depth > 12 ifTrue:[
@@ -6048,7 +6048,7 @@
     "/ use table-value in loop
 
     greyValues := self greyMapForRange:(255*1024).
-    
+
     0 to:(h-1) do:[:y |
 	nextDst := dstIndex + bytesPerMonoRow.
 	byte := 0.
@@ -6061,9 +6061,9 @@
 	errorArray1 atAllPut:0.
 
 	self valuesAtY:y from:0 to:(w-1) do:[:x :pixel |
-	    |eP "{Class: SmallInteger }" 
-	     eD 
-	     eI "{Class: SmallInteger }" 
+	    |eP "{Class: SmallInteger }"
+	     eD
+	     eI "{Class: SmallInteger }"
 	     xE "{Class: SmallInteger }"
 	     xN "{Class: SmallInteger }" |
 
@@ -6144,7 +6144,7 @@
 
 floydSteinbergDitheredDepth8BitsColors:colors
     "return a floyd-steinberg dithered bitmap from the receiver picture,
-     which must be a depth-8 image. 
+     which must be a depth-8 image.
      This method expects an array of colors to be used for dithering
      (which need not be a colorCubes colors)."
 
@@ -6154,11 +6154,11 @@
 
 floydSteinbergDitheredDepth8BitsColors:colors map:aMapOrNil
     "return a floyd-steinberg dithered bitmap from the receiver picture,
-     which must be a depth-24 image. 
+     which must be a depth-24 image.
      This method expects an array of colors to be used for dithering
      (which need not be a colorCubes colors)."
 
-    |pseudoBits  
+    |pseudoBits
      ditherRGBBytes ditherColors
      w       "{Class: SmallInteger }"
      h       "{Class: SmallInteger }"
@@ -6244,7 +6244,7 @@
 	i := i + ((qScramble at:((b bitShift:-4) bitAnd:16r0F) + 1) bitShift:-2).
 	lookupPos := i.
 
-	[index < lookupPos] whileTrue:[        
+	[index < lookupPos] whileTrue:[
 	    clrLookup at:(index+1) put:(clrPosition-1-1).
 	    index := index + 1
 	]
@@ -6390,7 +6390,7 @@
 		    /*
 		     * same color again - reuse last bestMatch
 		     */
-		} else 
+		} else
 #endif
 		{
 		    __wR = __wantR;
@@ -6425,14 +6425,14 @@
 			if (delta < 0) delta = -delta;
 
 			d = dp[1];
-			if (__wG > d) 
+			if (__wG > d)
 			    delta += (__wG - d) * GREEN_SCALE;
-			else 
+			else
 			    delta += (d - __wG) * GREEN_SCALE;
 			d = dp[2];
-			if (__wB > d) 
+			if (__wB > d)
 			    delta += (__wB - d) * BLUE_SCALE;
-			else 
+			else
 			    delta += (d - __wB) * BLUE_SCALE;
 
 			if (delta <= GOOD_DELTA) {
@@ -6450,14 +6450,14 @@
 			    delta = (__wR - d) * RED_SCALE;
 			    if (delta < 0) delta = -delta;
 			    d = dp[1];
-			    if (__wG > d) 
+			    if (__wG > d)
 				delta += (__wG - d) * GREEN_SCALE;
-			    else 
+			    else
 				delta += (d - __wG) * GREEN_SCALE;
 			    d = dp[2];
-			    if (__wB > d) 
+			    if (__wB > d)
 				delta += (__wB - d) * BLUE_SCALE;
-			    else 
+			    else
 				delta += (d - __wB) * BLUE_SCALE;
 
 			    if (delta < minDelta) {
@@ -6479,14 +6479,14 @@
 			    delta = (__wR - d) * RED_SCALE;
 			    if (delta < 0) delta = -delta;
 			    d = dp[1];
-			    if (__wG > d) 
+			    if (__wG > d)
 				delta += (__wG - d) * GREEN_SCALE;
-			    else 
+			    else
 				delta += (d - __wG) * GREEN_SCALE;
 			    d = dp[2];
-			    if (__wB > d) 
+			    if (__wB > d)
 				delta += (__wB - d) * BLUE_SCALE;
-			    else 
+			    else
 				delta += (d - __wB) * BLUE_SCALE;
 
 			    if (delta < minDelta) {
@@ -6523,15 +6523,15 @@
 			if (delta < 0) delta = -delta;
 			if (delta < minDelta) {
 			    d = dp[1];
-			    if (__wG > d) 
+			    if (__wG > d)
 				delta += (__wG - d) * GREEN_SCALE;
-			    else 
+			    else
 				delta += (d - __wG) * GREEN_SCALE;
 			    if (delta < minDelta) {
 				d = dp[2];
-				if (__wB > d) 
+				if (__wB > d)
 				    delta += (__wB - d) * BLUE_SCALE;
-				else 
+				else
 				    delta += (d - __wB) * BLUE_SCALE;
 
 				if (delta < minDelta) {
@@ -6554,7 +6554,7 @@
 		dB = dp[2];
 
 /*
-printf("want: %d/%d/%d (%d/%d/%d) got: %d/%d/%d\n",
+console_printf("want: %d/%d/%d (%d/%d/%d) got: %d/%d/%d\n",
 		__wantR, __wantG, __wantB,
 		__wR, __wG, __wB,
 		dR, dG, dB);
@@ -6567,7 +6567,7 @@
 		/*
 		 * the new error & distribute the error
 		 */
-		__eR = __wantR - dR; 
+		__eR = __wantR - dR;
 		if (__eR) {
 		    tR = __eR >> 4;  /* 16th of error */
 		    nR = eP[3] + (tR * 7);/* from accu: error for (x+1 / y) */
@@ -6593,7 +6593,7 @@
 		    eP[1] = eP[-2] = eP[4] = 0;
 		}
 
-		__eB = __wantB - dB; 
+		__eB = __wantB - dB;
 		if (__eB) {
 		    tB = __eB >> 4;
 		    nB = eP[5] + (tB * 7);
@@ -6619,19 +6619,19 @@
     ^ pseudoBits
 !
 
-floydSteinbergDitheredDepth8BitsColors:fixColors nRed:nRed nGreen:nGreen nBlue:nBlue 
+floydSteinbergDitheredDepth8BitsColors:fixColors nRed:nRed nGreen:nGreen nBlue:nBlue
     "return a floyd-steinberg dithered bitmap from the receiver picture,
-     which must be a depth-8 image. 
+     which must be a depth-8 image.
      This is a special-cased dither method for 8-bit palette images being displayed on
      an 8-bit pseudoColor display, AND fixColor dithering is used.
      Use the colors in the fixColors array, which must be fixR x fixG x fixB
      colors assigned to aDevice, such as the preallocated colors of the
-     Color class. 
+     Color class.
      By passing the ditherColors as extra array, this method can
      also be used to dither an 8bit image into a smaller number of colors,
      for example to create dithered Depth4Images from Depth8Images."
 
-    |pseudoBits  
+    |pseudoBits
      rgbBytes
      w       "{Class: SmallInteger }"
      h       "{Class: SmallInteger }"
@@ -6640,7 +6640,7 @@
      fixG    "{Class: SmallInteger }"
      fixB    "{Class: SmallInteger }"
      fixGfixB
-     fixIds failed map lastColor 
+     fixIds failed map lastColor
      rgbIDX  "{Class: SmallInteger }"
      idxAndErrRBytes idxAndErrGBytes idxAndErrBBytes
      error clr|
@@ -6702,7 +6702,7 @@
 	idxAndErrRBytes at:index+1 put:i - (rgbIDX * 255 // (fixR-1)) + 128.
 
 	rgbIDX := (i * (fixG-1) + 128) // 255. "green index rounded"
-	idxAndErrGBytes at:index put:(rgbIDX * fixB). 
+	idxAndErrGBytes at:index put:(rgbIDX * fixB).
 	idxAndErrGBytes at:index+1 put:i - (rgbIDX * 255 // (fixG-1)) + 128.
 
 	rgbIDX := (i * (fixB-1) + 128) // 255. "blue index rounded"
@@ -6774,24 +6774,24 @@
 		if (__want > 255) __want = 255;
 		else if (__want < 0) __want = 0;
 		__want += __want;
-		idx = __idxAndErrRBytes[__want];   
-		__eR = __idxAndErrRBytes[__want+1]; 
+		idx = __idxAndErrRBytes[__want];
+		__eR = __idxAndErrRBytes[__want+1];
 		__eR -= 128;
 
 		__want = rgbP[pix+1] + __eG;
 		if (__want > 255) __want = 255;
 		else if (__want < 0) __want = 0;
 		__want += __want;
-		idx += __idxAndErrGBytes[__want];   
-		__eG = __idxAndErrGBytes[__want+1]; 
+		idx += __idxAndErrGBytes[__want];
+		__eG = __idxAndErrGBytes[__want+1];
 		__eG -= 128;
 
 		__want = rgbP[pix+2] + __eB;
 		if (__want > 255) __want = 255;
 		else if (__want < 0) __want = 0;
 		__want += __want;
-		idx += __idxAndErrBBytes[__want];   
-		__eB = __idxAndErrBBytes[__want+1]; 
+		idx += __idxAndErrBBytes[__want];
+		__eB = __idxAndErrBBytes[__want+1];
 		__eB -= 128;
 
 		/*
@@ -6855,7 +6855,7 @@
 
 floydSteinbergDitheredGrayBitsDepth:depth
     "return the bits for dithering a gray image from the image.
-     Works for any source depths / photometric, 
+     Works for any source depths / photometric,
      but possibly slow since each pixel is processed individually.
      Redefined by some subclasses for more performance (D8Image/D24Image)"
 
@@ -6869,7 +6869,7 @@
      w               "{Class: SmallInteger }"
      h               "{Class: SmallInteger }"
      bitCnt          "{Class: SmallInteger }"
-     byte            "{Class: SmallInteger }" 
+     byte            "{Class: SmallInteger }"
      grey
      eR eRB eB eLB |
 
@@ -6928,7 +6928,7 @@
 		 pixel "{ Class: SmallInteger }"
 		 error "{ Class: SmallInteger }"
 		 e16   "{ Class: SmallInteger }"
-		 xE    "{ Class: SmallInteger }" 
+		 xE    "{ Class: SmallInteger }"
 		 xN    "{ Class: SmallInteger }" |
 
 		pixel := greyPixels at:(value + 1).
@@ -6939,10 +6939,10 @@
 
 		byte := byte bitShift:depth.
 		error > 512 "0.5" ifTrue:[
-		    pixel := pixel + 1.      
+		    pixel := pixel + 1.
 		    e := error - 1024 "1.0"
 		] ifFalse:[
-		    e := error              
+		    e := error
 		].
 		byte := byte bitOr:pixel.
 
@@ -7003,7 +7003,7 @@
 		 pixel "{ Class: SmallInteger }"
 		 error "{ Class: SmallInteger }"
 		 e16   "{ Class: SmallInteger }"
-		 xE    "{ Class: SmallInteger }" 
+		 xE    "{ Class: SmallInteger }"
 		 xN    "{ Class: SmallInteger }" |
 
 		grey := (clr brightness * greyLevels).
@@ -7016,10 +7016,10 @@
 
 		byte := byte bitShift:depth.
 		error > 512 "0.5" ifTrue:[
-		    pixel := pixel + 1.      
+		    pixel := pixel + 1.
 		    e := error - 1024 "1.0"
 		] ifFalse:[
-		    e := error              
+		    e := error
 		].
 
 		byte := byte bitOr:pixel.
@@ -7075,7 +7075,7 @@
 
 floydSteinbergDitheredMonochromeBits
     "return the bitmap for a dithered monochrome bitmap from the image.
-     Works for any source depths / photometric, 
+     Works for any source depths / photometric,
      but very very slow since each pixel is processed individually.
      Redefined by some subclasses for more performance (D8Image)"
 
@@ -7089,8 +7089,8 @@
      w               "{Class: SmallInteger }"
      h               "{Class: SmallInteger }"
      bitCnt          "{Class: SmallInteger }"
-     byte            "{Class: SmallInteger }" 
-     grey  
+     byte            "{Class: SmallInteger }"
+     grey
      eR eRB eB eLB |
 
     w := width.
@@ -7136,7 +7136,7 @@
 
 		__grey = __intVal(__ArrayInstPtr(greyValues)->a_element[__intVal(pixel)]);
 		__grey += __intVal(__errorArray[__x+1]);
-                
+
 		__byte <<= 1;
 		if (__grey > 127*1024) {
 		    __e = __grey - (255*1024);
@@ -7146,9 +7146,9 @@
 		}
 		if (__e) {
 		    __eI = __e >> 4;
-		    __eR  = __eI * 7;            
-		    __eRB = __eI * 1;            
-		    __eB  = __eI * 5;            
+		    __eR  = __eI * 7;
+		    __eRB = __eI * 1;
+		    __eB  = __eI * 5;
 		    __eLB = __e - __eR - __eRB - __eB;
 		    __errorArray[__x+2] = __MKSMALLINT(__intVal(__errorArray[__x+2]) + __eR);
 		    __nextErrorArray[__x+2] = __MKSMALLINT(__intVal(__nextErrorArray[__x+2]) + __eRB);
@@ -7169,8 +7169,8 @@
 		bitCnt = __MKSMALLINT(__bitCnt);
 %}.
 
-"/                |eI "{ Class: SmallInteger }" 
-"/                 xE "{ Class: SmallInteger }" 
+"/                |eI "{ Class: SmallInteger }"
+"/                 xE "{ Class: SmallInteger }"
 "/                 xN "{ Class: SmallInteger }" |
 "/
 "/                "/ get the colors grey value [0 .. 1]
@@ -7243,8 +7243,8 @@
 	    nextErrorArray atAllPut:0.
 
 	    self colorsAtY:y from:0 to:(w-1) do:[:x :clr |
-		|eI "{ Class: SmallInteger }" 
-		 xE "{ Class: SmallInteger }" 
+		|eI "{ Class: SmallInteger }"
+		 xE "{ Class: SmallInteger }"
 		 xN "{ Class: SmallInteger }" |
 
 		"/ get the colors grey value [0 .. 1]
@@ -7312,25 +7312,25 @@
     "Modified: 10.6.1996 / 15:12:11 / cg"
 !
 
-nearestPaintDepth8BitsColors:fixColors nRed:nRed nGreen:nGreen nBlue:nBlue 
+nearestPaintDepth8BitsColors:fixColors nRed:nRed nGreen:nGreen nBlue:nBlue
     "return a nearest paint bitmap from the receiver picture,
-     which must be a depth-8 image. 
+     which must be a depth-8 image.
      This is a special-cased dither method for 8-bit palette images being displayed on
      an 8-bit pseudoColor display, AND fixColor dithering is used.
      Use the colors in the fixColors array, which must be fixR x fixG x fixB
      colors assigned to aDevice, such as the preallocated colors of the
      Color class."
 
-    |pseudoBits  
+    |pseudoBits
      fixR    "{Class: SmallInteger }"
      fixG    "{Class: SmallInteger }"
      fixB    "{Class: SmallInteger }"
-     fixGfixB 
+     fixGfixB
      r       "{Class: SmallInteger }"
      g       "{Class: SmallInteger }"
      b       "{Class: SmallInteger }"
      idx     "{Class: SmallInteger }"
-     idMap lastColor 
+     idMap lastColor
      clr|
 
     self depth ~~ 8 ifTrue:[^ nil].
@@ -7398,12 +7398,12 @@
 
 nfloydSteinbergDitheredDepth8BitsColors:colors
     "return a floyd-steinberg dithered bitmap from the receiver picture,
-     which must be a depth-8 image. 
+     which must be a depth-8 image.
      This method expects an array of colors to be used for dithering
      (which need not be a colorCubes colors)."
 
-    |pseudoBits  
-     rgbBytes 
+    |pseudoBits
+     rgbBytes
      ditherRGBBytes ditherColors
      w       "{Class: SmallInteger }"
      h       "{Class: SmallInteger }"
@@ -7429,13 +7429,13 @@
      iR    "{Class: SmallInteger }"
      iRG   "{Class: SmallInteger }"
      iRGB  "{Class: SmallInteger }"
-     clr 
+     clr
      rI  "{Class: SmallInteger }"
      gI  "{Class: SmallInteger }"
      bI  "{Class: SmallInteger }"
      maxIDX  "{Class: SmallInteger }"
      subCubeColorCollection
-     error 
+     error
      dl "{Class: SmallInteger }"|
 
     self depth ~~ 8 ifTrue:[^ nil].
@@ -7537,13 +7537,13 @@
 "/            nCube at:i put:(indices asByteArray)
 "/        ] ifFalse:[
 "/            "/ find nearest color
-"/        
+"/
 "/            dl := 1.
 "/            [dl < maxBits] whileTrue:[
 "/                dR := dl negated.
 "/                [dR <= dl] whileTrue:[
 "/                    iR := i + (dR * shR).
-"/                    (iR > 0 and:[iR < maxIDX]) ifTrue:[    
+"/                    (iR > 0 and:[iR < maxIDX]) ifTrue:[
 "/                        dG := dl negated.
 "/                        [dG < dl] whileTrue:[
 "/                            iRG := iR + (dG * shG).
@@ -7572,7 +7572,7 @@
 "/self halt.
 
     "/ now, cube contains collections of colors which are
-    "/ positioned in a subCube; quickly accessed by a lookup 
+    "/ positioned in a subCube; quickly accessed by a lookup
 
     pseudoBits := ByteArray uninitializedNew:(width * height).
 
@@ -7650,7 +7650,7 @@
 		int __dR, __dG, __dB;
 		int minDelta, bestIdx;
 		int __iR, __iG, __iB;
-		int cR, cG, cB;   
+		int cR, cG, cB;
 		int delta;
 		OBJ subCubeColors;
 
@@ -7808,13 +7808,13 @@
 #ifdef REMEMBER_SEARCH
 		    if (__isSmallInteger(subCubeColors)) {
 			bestIdx = __intVal(subCubeColors);
-		    } else 
+		    } else
 #endif
 		    {
 			bestIdx = __ByteArrayInstPtr(subCubeColors)->ba_element[0];
 		    }
 		}
-                
+
 		/*
 		 * ok, now, we have found a collection of nearby
 		 * colors in subCubeColors.
@@ -7843,7 +7843,7 @@
 #endif
 
 /*
-printf("want: %d/%d/%d (%d/%d/%d) got: %d/%d/%d\n",
+console_printf("want: %d/%d/%d (%d/%d/%d) got: %d/%d/%d\n",
 		__wantR, __wantG, __wantB,
 		__wR, __wG, __wB,
 		__dR, __dG, __dB);
@@ -7857,7 +7857,7 @@
 		/*
 		 * the new error & distribute the error
 		 */
-		__eR = __wantR - __dR; 
+		__eR = __wantR - __dR;
 		if (__eR) {
 		    tR = __eR >> 4;  /* 16th of error */
 		    nR = eP[3] + (tR * 7);/* from accu: error for (x+1 / y) */
@@ -7883,7 +7883,7 @@
 		    eP[1] = eP[-2] = eP[4] = 0;
 		}
 
-		__eB = __wantB - __dB; 
+		__eB = __wantB - __dB;
 		if (__eB) {
 		    tB = __eB >> 4;
 		    nB = eP[5] + (tB * 7);
@@ -7943,14 +7943,14 @@
 orderedDitheredGrayBitsWithDitherMatrix:ditherMatrix ditherWidth:dW depth:depth
     "return the bitmap for a dithered depth-bitmap from the image;
      with a constant ditherMatrix, this can be used for thresholding.
-     Works for any source depths / photometric, 
+     Works for any source depths / photometric,
      but very very slow since each pixel is processed individually.
      Redefined by some subclasses for more performance (D8Image)"
 
-    |dH nDither   
+    |dH nDither
      greyLevels greyValues greyPixels greyErrors
      dstIndex        "{Class: SmallInteger }"
-     nextDst         
+     nextDst
      bytesPerOutRow  "{Class: SmallInteger }"
      pixelsPerByte   "{Class: SmallInteger }"
      outBits
@@ -8017,7 +8017,7 @@
 		__grey = __greyErrors[__value];
 
 		__dT = __ByteArrayInstPtr(ditherMatrix)
-			    ->ba_element[__intVal(x) % __dW 
+			    ->ba_element[__intVal(x) % __dW
 					 + (__intVal(y) % __intVal(dH)) * __dW];
 
 		if (__grey > __dT) {
@@ -8056,7 +8056,7 @@
 
 	    "/ this is the representaion independent (but slow)
 	    "/ inner loop - it extracts colors from the receiver
-            
+
 	    self colorsAtY:y from:0 to:(w-1) do:[:x :clr |
 		|dstClr grey dT pixel|
 
@@ -8065,10 +8065,10 @@
 
 		"/ remap into [0 .. greyLevels-1]
 		grey := grey * (greyLevels-1).
-            
+
 		"/ get threshold pixel [0 .. greyLevels-1]
 
-		pixel := grey truncated.  
+		pixel := grey truncated.
 
 		"/ compute the error [0..1]
 		grey := grey - pixel.
@@ -8085,7 +8085,7 @@
 		int __bitCnt = __intVal(bitCnt);
 
 		__dT = __ByteArrayInstPtr(ditherMatrix)
-			    ->ba_element[__intVal(x) % __dW 
+			    ->ba_element[__intVal(x) % __dW
 					 + (__intVal(y) % __intVal(dH)) * __dW];
 
 		__pixel = __intVal(pixel);
@@ -8094,7 +8094,7 @@
 		    __pixel++;
 		}
 		__byte = (__byte << __intVal(depth)) | __pixel;
-            
+
 		__bitCnt = __bitCnt - __intVal(depth);
 		if (__bitCnt == 0) {
 		    __dstIdx = __intVal(dstIndex);
@@ -8134,11 +8134,11 @@
 orderedDitheredMonochromeBitsWithDitherMatrix:ditherMatrix ditherWidth:dW
     "return the bitmap for a dithered monochrome bitmap from the image;
      with a constant ditherMatrix, this can be used for thresholding.
-     Works for any source depths / photometric, 
+     Works for any source depths / photometric,
      but very very slow since each pixel is processed individually.
      Redefined by some subclasses for more performance (D8Image)"
 
-    |dH nDither   
+    |dH nDither
      greyValues
      dstIndex        "{Class: SmallInteger }"
      nextDst         "{Class: SmallInteger }"
@@ -8183,7 +8183,7 @@
 		__grey = __greyValues[__intVal(value)];
 
 		__dT = __ByteArrayInstPtr(ditherMatrix)
-			    ->ba_element[__intVal(x) % __dW 
+			    ->ba_element[__intVal(x) % __dW
 					 + (__intVal(y) % __intVal(dH)) * __dW];
 
 		__byte = __byte << 1;
@@ -8234,7 +8234,7 @@
 		int __bitCnt = __intVal(bitCnt);
 
 		__dT = __ByteArrayInstPtr(ditherMatrix)
-			    ->ba_element[__intVal(x) % __dW 
+			    ->ba_element[__intVal(x) % __dW
 					 + (__intVal(y) % __intVal(dH)) * __dW];
 
 		__byte = __byte << 1;
@@ -8256,7 +8256,7 @@
 		0
 
 "/                dT := ditherMatrix at:(x \\ dW) + (y \\ dH * dW) + 1.
-"/     
+"/
 "/                byte := byte bitShift:1.
 "/                grey < dT ifTrue:[
 "/                    byte := byte bitOr:1.
@@ -8294,7 +8294,7 @@
      w               "{Class: SmallInteger }"
      h               "{Class: SmallInteger }"
      bitCnt          "{Class: SmallInteger }"
-     byte            "{Class: SmallInteger }" 
+     byte            "{Class: SmallInteger }"
      grey
      xE              "{Class: SmallInteger }" |
 
@@ -8319,7 +8319,7 @@
     "/ use table-value in loop
 
     greyValues := self greyMapForRange:(255 * 1024).
-    
+
     0 to:(h-1) do:[:y |
 	nextDst := dstIndex + bytesPerMonoRow.
 	byte := 0.
@@ -8429,7 +8429,7 @@
 
     |xI "{ Class: SmallInteger }"
      yI "{ Class: SmallInteger }"
-     wI "{ Class: SmallInteger }" 
+     wI "{ Class: SmallInteger }"
      hI "{ Class: SmallInteger }"|
 
     xI := aRectangle left.
@@ -8455,7 +8455,7 @@
 
     |xI "{ Class: SmallInteger }"
      yI "{ Class: SmallInteger }"
-     wI "{ Class: SmallInteger }" 
+     wI "{ Class: SmallInteger }"
      hI "{ Class: SmallInteger }"|
 
     xI := aRectangle left.
@@ -8484,7 +8484,7 @@
 
     |xI "{ Class: SmallInteger }"
      yI "{ Class: SmallInteger }"
-     wI "{ Class: SmallInteger }" 
+     wI "{ Class: SmallInteger }"
      hI "{ Class: SmallInteger }"|
 
     xI := x.
@@ -8513,81 +8513,81 @@
     w := self width.
     h := self height.
 
-    surroundingPixelsOfDo := 
-        [:pX :pY :fn |
-            |nX nY|
-
-            nX := pX + 1.
-            nY := pY + 1.
-            (nY < h) ifTrue: [fn value:pX value:nY].
-            (pY > 0) ifTrue: [fn value:pX value:(pY - 1)].
-            (nX < w) ifTrue: [fn value:nX value:pY].
-            (pX > 0) ifTrue: [fn value:(pX - 1) value:pY].
-        ].
-
-    enumerateDetectedPixelsAndDo := 
-        [:detectedPixels :action |
-            |idx|
-
-            idx := 1.
-            0 to:h-1 do:[:y |
-                0 to:w-1 do:[:x |
-                    (detectedPixels at:idx) ifTrue:[ 
-                        action value:x value:y
-                    ].
-                    idx := idx + 1.
-                ].
-            ].
-        ].
+    surroundingPixelsOfDo :=
+	[:pX :pY :fn |
+	    |nX nY|
+
+	    nX := pX + 1.
+	    nY := pY + 1.
+	    (nY < h) ifTrue: [fn value:pX value:nY].
+	    (pY > 0) ifTrue: [fn value:pX value:(pY - 1)].
+	    (nX < w) ifTrue: [fn value:nX value:pY].
+	    (pX > 0) ifTrue: [fn value:(pX - 1) value:pY].
+	].
+
+    enumerateDetectedPixelsAndDo :=
+	[:detectedPixels :action |
+	    |idx|
+
+	    idx := 1.
+	    0 to:h-1 do:[:y |
+		0 to:w-1 do:[:x |
+		    (detectedPixels at:idx) ifTrue:[
+			action value:x value:y
+		    ].
+		    idx := idx + 1.
+		].
+	    ].
+	].
 
     processPixelToFill := [:spX :spY |
-            |sp idx|
-
-            ((self pixelAtX:spX y:spY) == detectedPixel and: [mask isNil or:[(mask pixelAtX:spX y:spY) == 1]])
-            ifTrue: [
-                idx := 1 + spX + (spY * w).
-                (allDetectedPixelCoordinates at:idx) ifFalse:[
-                    allDetectedPixelCoordinates at:idx put:true.
-                    toDo add:spX @ spY.
-                ].
-            ]
-        ].
+	    |sp idx|
+
+	    ((self pixelAtX:spX y:spY) == detectedPixel and: [mask isNil or:[(mask pixelAtX:spX y:spY) == 1]])
+	    ifTrue: [
+		idx := 1 + spX + (spY * w).
+		(allDetectedPixelCoordinates at:idx) ifFalse:[
+		    allDetectedPixelCoordinates at:idx put:true.
+		    toDo add:spX @ spY.
+		].
+	    ]
+	].
 
     (mask notNil and: [(mask pixelAt:aPoint) == 0]) ifTrue:[
-        allDetectedPixelCoordinates := mask floodFillAt: aPoint withColor: Color white.
-        enumerateDetectedPixelsAndDo
-                value:allDetectedPixelCoordinates
-                value:[:x :y | self atImageAndMask:(x@y) put: aColor].
-        ^ allDetectedPixelCoordinates
+	allDetectedPixelCoordinates := mask floodFillAt: aPoint withColor: Color white.
+	enumerateDetectedPixelsAndDo
+		value:allDetectedPixelCoordinates
+		value:[:x :y | self atImageAndMask:(x@y) put: aColor].
+	^ allDetectedPixelCoordinates
     ].
 
     detectedPixel := self pixelAt: aPoint.
 
-    allDetectedPixelCoordinates := BooleanArray new:(w * h). 
+    allDetectedPixelCoordinates := BooleanArray new:(w * h).
     toDo := OrderedCollection new:1000.
     allDetectedPixelCoordinates at:(1 + aPoint x + (aPoint y * w)) put:true.
     toDo add:aPoint.
 
     [toDo notEmpty] whileTrue:[
-        |p|
-
-        p := toDo removeFirst.
-        surroundingPixelsOfDo value:p x value:p y value:processPixelToFill.
+	|p|
+
+	p := toDo removeFirst.
+	surroundingPixelsOfDo value:p x value:p y value:processPixelToFill.
     ].
 
     idx := 1.
     aColor redByte notNil ifTrue:[
-        pixel := self valueFromColor:aColor.
+	pixel := self valueFromColor:aColor.
     ].
 
     pixel isNil ifTrue:[
-        enumerateDetectedPixelsAndDo
-                value:allDetectedPixelCoordinates
-                value:[:x :y | mask pixelAtX:x y:y put:0].
+	enumerateDetectedPixelsAndDo
+		value:allDetectedPixelCoordinates
+		value:[:x :y | mask pixelAtX:x y:y put:0].
     ] ifFalse:[
-        enumerateDetectedPixelsAndDo
-                value:allDetectedPixelCoordinates
-                value:[:x :y | self pixelAtX:x y:y put:pixel].
+	enumerateDetectedPixelsAndDo
+		value:allDetectedPixelCoordinates
+		value:[:x :y | self pixelAtX:x y:y put:pixel].
     ].
     ^ allDetectedPixelCoordinates
 
@@ -8659,10 +8659,10 @@
     yS := yStart.
     yE := yEnd.
 
-    yS to:yE do:[:yRun |    
+    yS to:yE do:[:yRun |
 	yR := yRun.
 	self colorsAtY:yRun from:xStart to:xEnd do:[:xRun :color |
-	    aBlock value:xRun value:yR value:color 
+	    aBlock value:xRun value:yR value:color
 	]
     ]
 
@@ -8682,9 +8682,9 @@
 !
 
 valuesAtY:y from:x1 to:x2 do:aBlock
-    "WARNING: for now, this enumerates pixel values 
+    "WARNING: for now, this enumerates pixel values
      (backward compatibility with ST/X)
-     In the future, this will enumerate colors 
+     In the future, this will enumerate colors
      Use #pixelAtT:from:to:do: - for future compatibility.
 
      perform aBlock for each pixelValue from x1 to x2 in row y.
@@ -8721,7 +8721,7 @@
 
     xS := xStart.
     xE := xEnd.
-    yStart to:yEnd do:[:yRun |    
+    yStart to:yEnd do:[:yRun |
 	self valuesAtY:yRun from:xStart to:xEnd do:[:xRun :pixel |
 	    aBlock value:xRun value:yRun value:pixel
 	]
@@ -8745,7 +8745,7 @@
 
 !Image methodsFor:'image manipulations'!
 
-applyPixelValuesTo:pixelFunctionBlock in:aRectangle into:newImage 
+applyPixelValuesTo:pixelFunctionBlock in:aRectangle into:newImage
     "helper for withPixelFunctionAppliedToValues:
      enumerate pixelValues and evaluate the block for each.
      Could be redefined by subclasses for better performance."
@@ -8807,9 +8807,9 @@
     "helper for withPixelFunctionAppliedToValues:
      enumerate pixelValues and evaluate the block for each."
 
-    ^ self 
-	applyPixelValuesTo:pixelFunctionBlock 
-	in:(0@0 corner:width@height) 
+    ^ self
+	applyPixelValuesTo:pixelFunctionBlock
+	in:(0@0 corner:width@height)
 	into:newImage
 !
 
@@ -8819,7 +8819,7 @@
      CAVEAT: this only works with palette images (i.e. not for rgb or greyScale).
      CAVEAT: Need an argument, which specifies by how much it should be lighter."
 
-     ^ self 
+     ^ self
 	copyWithColorMapProcessing:[:clr | clr blendWith:aColor]
 
     "
@@ -8834,7 +8834,7 @@
 
 colorMapProcessing:aBlock
     "a helper for all kinds of colormap manipulations.
-     The argument, aBlock is called for every colormap entry, 
+     The argument, aBlock is called for every colormap entry,
      and the returned value will replace the original entry in the map.
      This will fail for non-palette images.
      See examples in Image>>copyWithColorMapProcessing:"
@@ -8872,7 +8872,7 @@
     |newImage|
 
     self colorMap isNil ifTrue:[
-        ^ self withPixelFunctionApplied:[:orig :clr :x :y | aBlock  value:clr]
+	^ self withPixelFunctionApplied:[:orig :clr :x :y | aBlock  value:clr]
 "/        self error:'no colormap in image'.
 "/        ^ nil
     ].
@@ -8888,40 +8888,40 @@
     "
      leave red component only:
 
-     (Image fromFile:'goodies/bitmaps/gifImages/claus.gif') 
-        copyWithColorMapProcessing:[:clr | Color red:(clr red) green:0 blue:0] 
+     (Image fromFile:'goodies/bitmaps/gifImages/claus.gif')
+	copyWithColorMapProcessing:[:clr | Color red:(clr red) green:0 blue:0]
     "
 
     "
      make it reddish:
 
-     (Image fromFile:'bitmaps/gifImages/claus.gif') 
-        copyWithColorMapProcessing:[:clr | Color red:((clr red * 2) min:100) green:clr green blue:clr blue] 
+     (Image fromFile:'bitmaps/gifImages/claus.gif')
+	copyWithColorMapProcessing:[:clr | Color red:((clr red * 2) min:100) green:clr green blue:clr blue]
     "
 
     "
      invert:
 
-     (Image fromFile:'bitmaps/gifImages/claus.gif') 
-        copyWithColorMapProcessing:[:clr | Color red:(100 - clr red) green:(100 - clr green) blue:(100 - clr green)] 
+     (Image fromFile:'bitmaps/gifImages/claus.gif')
+	copyWithColorMapProcessing:[:clr | Color red:(100 - clr red) green:(100 - clr green) blue:(100 - clr green)]
     "
 
     "
      lighter:
 
-     (Image fromFile:'bitmaps/gifImages/claus.gif') 
-        copyWithColorMapProcessing:[:clr | |r g b|
-                                                r := clr red.  g := clr green.  b := clr blue.
-                                                Color red:(r + (100-r//2)) 
-                                                      green:(g + (100-g//2)) 
-                                                      blue:(b + (100-b//2))]
+     (Image fromFile:'bitmaps/gifImages/claus.gif')
+	copyWithColorMapProcessing:[:clr | |r g b|
+						r := clr red.  g := clr green.  b := clr blue.
+						Color red:(r + (100-r//2))
+						      green:(g + (100-g//2))
+						      blue:(b + (100-b//2))]
     "
 
     "
      darker:
 
-     (Image fromFile:'bitmaps/gifImages/claus.gif') 
-        copyWithColorMapProcessing:[:clr | Color red:(clr red//2) green:(clr green // 2) blue:(clr blue // 2)] 
+     (Image fromFile:'bitmaps/gifImages/claus.gif')
+	copyWithColorMapProcessing:[:clr | Color red:(clr red//2) green:(clr green // 2) blue:(clr blue // 2)]
     "
 
     "Modified: 24.4.1997 / 18:28:05 / cg"
@@ -8943,7 +8943,7 @@
      CAVEAT: this only works with palette images (i.e. not for rgb or greyScale).
      CAVEAT: Need an argument, which specifies by how much it should be darker."
 
-     ^ self 
+     ^ self
 	copyWithColorMapProcessing:[:clr | clr darkened]
 
     "
@@ -9039,7 +9039,7 @@
 
     |h           "{Class: SmallInteger }"
      bytesPerRow "{Class: SmallInteger }"
-     buffer 
+     buffer
      indexLow    "{Class: SmallInteger }"
      indexHi     "{Class: SmallInteger }"
      bytes|
@@ -9090,14 +9090,14 @@
      This is the general magnification method, handling non-integral values.
      It is slower than the integral magnification method."
 
-    |mX        
-     mY        
+    |mX
+     mY
      newWidth  "{ Class: SmallInteger }"
      newHeight "{ Class: SmallInteger }"
      w         "{ Class: SmallInteger }"
      h         "{ Class: SmallInteger }"
      newImage newBits bitsPerPixel newBytesPerRow newMask
-     value 
+     value
      srcRow pixelArray|
 
     mX := scalePoint x.
@@ -9117,12 +9117,12 @@
     ].
 
     newImage := self species new.
-    newImage 
-	width:newWidth 
-	height:newHeight 
-	photometric:photometric 
-	samplesPerPixel:samplesPerPixel 
-	bitsPerSample:bitsPerSample 
+    newImage
+	width:newWidth
+	height:newHeight
+	photometric:photometric
+	samplesPerPixel:samplesPerPixel
+	bitsPerSample:bitsPerSample
 	colorMap:colorMap copy
 	bits:newBits
 	mask:newMask.
@@ -9158,17 +9158,17 @@
 
 hardRotated:degrees
     "return a new image from the old one, by rotating the image
-     degrees clockwise. 
+     degrees clockwise.
      Warning: the returned image will be larger than the original image."
 
     |p r a aN p1 p2 p3 p4 maxX minX maxY minY
-     newImage 
+     newImage
      newWidth  "{ Class: SmallInteger }"
      newHeight "{ Class: SmallInteger }"
      newBytesPerRow newBits
      blackPixel halfW halfH radians m t bad
      bytesPerRow myDepth maskBits
-     pX pY srcX srcY pix nX nY 
+     pX pY srcX srcY pix nX nY
      sinRot cosRot sinPY cosPY|
 
     radians := degrees degreesToRadians.
@@ -9180,8 +9180,8 @@
     r := p r.
     a := p theta.
 
-    "/ add the rotation 
-    "/ (sight - subtract, we defined things clockwise ... 
+    "/ add the rotation
+    "/ (sight - subtract, we defined things clockwise ...
     "/  ... in contrast to point which thinks counter-clockwise)
 
     aN := a - radians.
@@ -9196,36 +9196,36 @@
 
     maxX := minX := p1 x.
     (t := p2 x) > maxX ifTrue:[
-        maxX := t
+	maxX := t
     ] ifFalse:[
-        t < minX ifTrue:[minX := t].
+	t < minX ifTrue:[minX := t].
     ].
     (t := p3 x) > maxX ifTrue:[
-        maxX := t
+	maxX := t
     ] ifFalse:[
-        t < minX ifTrue:[minX := t].
+	t < minX ifTrue:[minX := t].
     ].
     (t := p4 x) > maxX ifTrue:[
-        maxX := t
+	maxX := t
     ] ifFalse:[
-        t < minX ifTrue:[minX := t].
+	t < minX ifTrue:[minX := t].
     ].
 
     maxY := minY := p1 y.
     (t := p2 y) > maxY ifTrue:[
-        maxY := t
+	maxY := t
     ] ifFalse:[
-        t < minY ifTrue:[minY := t].
+	t < minY ifTrue:[minY := t].
     ].
     (t := p3 y) > maxY ifTrue:[
-        maxY := t
+	maxY := t
     ] ifFalse:[
-        t < minY ifTrue:[minY := t].
+	t < minY ifTrue:[minY := t].
     ].
     (t := p4 y) > maxY ifTrue:[
-        maxY := t
+	maxY := t
     ] ifFalse:[
-        t < minY ifTrue:[minY := t].
+	t < minY ifTrue:[minY := t].
     ].
 
 
@@ -9244,38 +9244,38 @@
     newImage colorMap:colorMap copy.
     newImage maskedPixelsAre0:maskedPixelsAre0.
     mask notNil ifTrue:[
-        newImage mask:(mask rotated:degrees)
+	newImage mask:(mask rotated:degrees)
     ] ifFalse:[
-        self isMask ifFalse:[
-            self depth ~~ 1 ifTrue:[
-                m := ImageMask width:width height:height.
-                m bits:(maskBits := ByteArray new:(m bytesPerRow * height)).
-                maskBits atAllPut:16rFF.
-                newImage mask:(m rotated:degrees)
-            ]
-        ]
+	self isMask ifFalse:[
+	    self depth ~~ 1 ifTrue:[
+		m := ImageMask width:width height:height.
+		m bits:(maskBits := ByteArray new:(m bytesPerRow * height)).
+		maskBits atAllPut:16rFF.
+		newImage mask:(m rotated:degrees)
+	    ]
+	]
     ].
 
     maskedPixelsAre0 ifTrue:[
-        blackPixel := 0.
+	blackPixel := 0.
     ] ifFalse:[
-        blackPixel := self valueFromColor:Color black.
-        blackPixel isNil ifTrue:[
-            blackPixel := self valueFromColor:Color white.
-            blackPixel isNil ifTrue:[
-                blackPixel := 0.
-            ]
-        ]
+	blackPixel := self valueFromColor:Color black.
+	blackPixel isNil ifTrue:[
+	    blackPixel := self valueFromColor:Color white.
+	    blackPixel isNil ifTrue:[
+		blackPixel := 0.
+	    ]
+	]
     ].
     self isMask ifTrue:[
-        blackPixel := 0.
+	blackPixel := 0.
     ].
 
     myDepth := self depth.
     newBits atAllPut:0.
 
     "/ now, walk over destination pixels,
-    "/ fetching from source. 
+    "/ fetching from source.
     "/ (if we walked over the source, we could get holes
     "/  in the destination image ...)
 
@@ -9305,590 +9305,590 @@
 
     bad = true;
     if (1
-     && __isFloat(minX) 
+     && __isFloat(minX)
      && __isFloat(minY)
      && __isFloat(radians)
      && __isFloat(halfW)
      && __isFloat(halfH)
      && __isByteArray(newBits)
      && __isByteArray(__INST(bytes))) {
-        __srcBytes = __ByteArrayInstPtr(__INST(bytes))->ba_element;
-        __dstBytes = __ByteArrayInstPtr(newBits)->ba_element;
-        __nSrcBytes = __byteArraySize(__INST(bytes));
-        __nDstBytes = __byteArraySize(newBits);
-        __blackPixel = __intVal(blackPixel);
-
-        __radians = __floatVal(radians);
-        __radians = -__radians; /* sigh: clock-wise */
-        __sin = sin(__radians);
-        __cos = cos(__radians);
-        __minX = __floatVal(minX);
-        __minY = __floatVal(minY);
-        __halfW = __floatVal(halfW);
-        __halfH = __floatVal(halfH);
-
-        __dstRowPtr = __dstBytes;
-        __dstEndPtr = __dstBytes + __nDstBytes;
+	__srcBytes = __ByteArrayInstPtr(__INST(bytes))->ba_element;
+	__dstBytes = __ByteArrayInstPtr(newBits)->ba_element;
+	__nSrcBytes = __byteArraySize(__INST(bytes));
+	__nDstBytes = __byteArraySize(newBits);
+	__blackPixel = __intVal(blackPixel);
+
+	__radians = __floatVal(radians);
+	__radians = -__radians; /* sigh: clock-wise */
+	__sin = sin(__radians);
+	__cos = cos(__radians);
+	__minX = __floatVal(minX);
+	__minY = __floatVal(minY);
+	__halfW = __floatVal(halfW);
+	__halfH = __floatVal(halfH);
+
+	__dstRowPtr = __dstBytes;
+	__dstEndPtr = __dstBytes + __nDstBytes;
 
 #       define EARLY_OUT
 #       define FAST_ADVANCE 5
 #       define FAST_ADVANCE2
 
-        switch (__depth) {
-            case 8:
-                for (__dstY = 0; __dstY < __newHeight; __dstY++) {
-                    double __pY, __sinPY, __cosPY;
+	switch (__depth) {
+	    case 8:
+		for (__dstY = 0; __dstY < __newHeight; __dstY++) {
+		    double __pY, __sinPY, __cosPY;
 #ifdef EARLY_OUT
-                    int didFetchInRow = 0;
+		    int didFetchInRow = 0;
 #endif
-                    __pY = (double)(__dstY + __minY);
-
-                    __sinPY = __sin * __pY;
-                    __cosPY = __cos * __pY;
-
-                    __dstPtr = __dstRowPtr;
-                    __dstRowPtr += __dstBytesPerRow;
-
-                    for (__dstX = 0; __dstX < __newWidth; __dstX++) {
-                        double __pX, __nX;
-                        unsigned __pix;
-
-                        /* translate X in destination (center to 0/0) */
-                        __pX = (double)(__dstX + __minX);
-                        /* rotate X */
-                        __nX = (__cos * __pX) - __sinPY;
-
-                        /* translate X in source (origin to 0/0) */
-                        __nX = __nX + __halfW + 0.5;
-
-                        /* inside ? */
-                        if (__nX < 0) {
+		    __pY = (double)(__dstY + __minY);
+
+		    __sinPY = __sin * __pY;
+		    __cosPY = __cos * __pY;
+
+		    __dstPtr = __dstRowPtr;
+		    __dstRowPtr += __dstBytesPerRow;
+
+		    for (__dstX = 0; __dstX < __newWidth; __dstX++) {
+			double __pX, __nX;
+			unsigned __pix;
+
+			/* translate X in destination (center to 0/0) */
+			__pX = (double)(__dstX + __minX);
+			/* rotate X */
+			__nX = (__cos * __pX) - __sinPY;
+
+			/* translate X in source (origin to 0/0) */
+			__nX = __nX + __halfW + 0.5;
+
+			/* inside ? */
+			if (__nX < 0) {
 #ifdef EARLY_OUT
-                            if (didFetchInRow) {
-                                break;
-                            }
+			    if (didFetchInRow) {
+				break;
+			    }
 #endif
 #ifdef FAST_ADVANCE
-                            if (__blackPixel == 0) {
-                                do {
-                                    /* try advance by FAST_ADVANCE pixels ... */
-                                    __dstX += FAST_ADVANCE; __dstPtr += FAST_ADVANCE;
-                                    if (__dstX >= __newWidth) {
-                                        break;
-                                    }
-                                    __pX = (double)(__dstX + __minX);
-                                    __nX = (__cos * __pX) - __sinPY;
-                                    __nX = __nX + __halfW + 0.5;
-                                } while (__nX < 0);
-                                __dstX -= FAST_ADVANCE; __dstPtr -= FAST_ADVANCE;
-                            }
+			    if (__blackPixel == 0) {
+				do {
+				    /* try advance by FAST_ADVANCE pixels ... */
+				    __dstX += FAST_ADVANCE; __dstPtr += FAST_ADVANCE;
+				    if (__dstX >= __newWidth) {
+					break;
+				    }
+				    __pX = (double)(__dstX + __minX);
+				    __nX = (__cos * __pX) - __sinPY;
+				    __nX = __nX + __halfW + 0.5;
+				} while (__nX < 0);
+				__dstX -= FAST_ADVANCE; __dstPtr -= FAST_ADVANCE;
+			    }
 #endif
-                            __pix = __blackPixel;
-                        } else {
-                            int __srcX;
-
-                            __srcX = (int)__nX;
-                            /* inside ? */
-                            if (__srcX >= __width) {
+			    __pix = __blackPixel;
+			} else {
+			    int __srcX;
+
+			    __srcX = (int)__nX;
+			    /* inside ? */
+			    if (__srcX >= __width) {
 #ifdef EARLY_OUT
-                                if (didFetchInRow) {
-                                    break;
-                                }
+				if (didFetchInRow) {
+				    break;
+				}
 #endif
 #ifdef FAST_ADVANCE2
-                                if (__blackPixel == 0) {
-                                    do {
-                                        /* try advance by FAST_ADVANCE pixels ... */
-                                        __dstX += FAST_ADVANCE; __dstPtr += FAST_ADVANCE;
-                                        if (__dstX >= __newWidth) {
-                                            break;
-                                        }
-                                        __pX = (double)(__dstX + __minX);
-                                        __nX = (__cos * __pX) - __sinPY;
-                                        __nX = __nX + __halfW + 0.5;
-                                        __srcX = (int)__nX;
-                                    } while (__srcX >= __width);
-                                    __dstX -= FAST_ADVANCE; __dstPtr -= FAST_ADVANCE;
-                                }
+				if (__blackPixel == 0) {
+				    do {
+					/* try advance by FAST_ADVANCE pixels ... */
+					__dstX += FAST_ADVANCE; __dstPtr += FAST_ADVANCE;
+					if (__dstX >= __newWidth) {
+					    break;
+					}
+					__pX = (double)(__dstX + __minX);
+					__nX = (__cos * __pX) - __sinPY;
+					__nX = __nX + __halfW + 0.5;
+					__srcX = (int)__nX;
+				    } while (__srcX >= __width);
+				    __dstX -= FAST_ADVANCE; __dstPtr -= FAST_ADVANCE;
+				}
 #endif
-                                __pix = __blackPixel;
-                            } else {
-                                double __nY;
-
-                                /* rotate Y */
-                                __nY = (__sin * __pX) + __cosPY;
-                                /* translate Y in source (origin to 0/0) */
-                                __nY = __nY + __halfH + 0.5;
-
-                                /* inside ? */
-                                if (__nY < 0) {
+				__pix = __blackPixel;
+			    } else {
+				double __nY;
+
+				/* rotate Y */
+				__nY = (__sin * __pX) + __cosPY;
+				/* translate Y in source (origin to 0/0) */
+				__nY = __nY + __halfH + 0.5;
+
+				/* inside ? */
+				if (__nY < 0) {
 #ifdef EARLY_OUT
-                                    if (didFetchInRow) {
-                                        break;
-                                    }
+				    if (didFetchInRow) {
+					break;
+				    }
 #endif
 #ifdef FAST_ADVANCE2
-                                    if (__blackPixel == 0) {
-                                        do {
-                                            /* try advance by FAST_ADVANCE pixels ... */
-                                            __dstX += FAST_ADVANCE; __dstPtr += FAST_ADVANCE;
-                                            if (__dstX >= __newWidth) {
-                                                break;
-                                            }
-                                            __pX = (double)(__dstX + __minX);
-                                            __nY = (__sin * __pX) + __cosPY;
-                                            __nY = __nY + __halfH + 0.5;
-                                        } while (__nY < 0);
-                                        __dstX -= FAST_ADVANCE; __dstPtr -= FAST_ADVANCE;
-                                    }
+				    if (__blackPixel == 0) {
+					do {
+					    /* try advance by FAST_ADVANCE pixels ... */
+					    __dstX += FAST_ADVANCE; __dstPtr += FAST_ADVANCE;
+					    if (__dstX >= __newWidth) {
+						break;
+					    }
+					    __pX = (double)(__dstX + __minX);
+					    __nY = (__sin * __pX) + __cosPY;
+					    __nY = __nY + __halfH + 0.5;
+					} while (__nY < 0);
+					__dstX -= FAST_ADVANCE; __dstPtr -= FAST_ADVANCE;
+				    }
 #endif
-                                    __pix = __blackPixel;
-                                } else {
-                                    int __srcY;
-
-                                    __srcY = (int)__nY;
-                                    /* inside ? */
-                                    if (__srcY >= __height) {
+				    __pix = __blackPixel;
+				} else {
+				    int __srcY;
+
+				    __srcY = (int)__nY;
+				    /* inside ? */
+				    if (__srcY >= __height) {
 #ifdef EARLY_OUT
-                                        if (didFetchInRow) {
-                                            break;
-                                        }
+					if (didFetchInRow) {
+					    break;
+					}
 #endif
 #ifdef FAST_ADVANCE
-                                        if (__blackPixel == 0) {
-                                            do {
-                                                /* try advance by FAST_ADVANCE pixels ... */
-                                                __dstX += FAST_ADVANCE; __dstPtr += FAST_ADVANCE;
-                                                if (__dstX >= __newWidth) {
-                                                    break;
-                                                }
-                                                __pX = (double)(__dstX + __minX);
-                                                __nY = (__sin * __pX) + __cosPY;
-                                                __nY = __nY + __halfH + 0.5;
-                                                __srcY = (int)__nY;
-                                            } while (__srcY >= __height);
-                                            __dstX -= FAST_ADVANCE; __dstPtr -= FAST_ADVANCE;
-                                        }
+					if (__blackPixel == 0) {
+					    do {
+						/* try advance by FAST_ADVANCE pixels ... */
+						__dstX += FAST_ADVANCE; __dstPtr += FAST_ADVANCE;
+						if (__dstX >= __newWidth) {
+						    break;
+						}
+						__pX = (double)(__dstX + __minX);
+						__nY = (__sin * __pX) + __cosPY;
+						__nY = __nY + __halfH + 0.5;
+						__srcY = (int)__nY;
+					    } while (__srcY >= __height);
+					    __dstX -= FAST_ADVANCE; __dstPtr -= FAST_ADVANCE;
+					}
 #endif
-                                        __pix = __blackPixel;
-                                    } else {
-                                        /* fetch source pixel */
-
-                                        int idx;
+					__pix = __blackPixel;
+				    } else {
+					/* fetch source pixel */
+
+					int idx;
 #ifdef EARLY_OUT
-                                        didFetchInRow = 1;
+					didFetchInRow = 1;
 #endif
-                                        idx = __srcY * __srcBytesPerRow + __srcX;
-                                        if ((unsigned)idx < __nSrcBytes) {
-                                            __pix = __srcBytes[idx];
-                                        } else {
-                                            __pix = __blackPixel;
-                                        }
-                                    }
-                                }
-                            }
-                        }
-
-                        if (__pix != 0) {
-                            *__dstPtr = __pix;
-                        }
-                        __dstPtr++;
-                    }
-                }
-                break;
-
-            case 1:
-                for (__dstY = 0; __dstY < __newHeight; __dstY++) {
-                    double __pY, __sinPY, __cosPY;
+					idx = __srcY * __srcBytesPerRow + __srcX;
+					if ((unsigned)idx < __nSrcBytes) {
+					    __pix = __srcBytes[idx];
+					} else {
+					    __pix = __blackPixel;
+					}
+				    }
+				}
+			    }
+			}
+
+			if (__pix != 0) {
+			    *__dstPtr = __pix;
+			}
+			__dstPtr++;
+		    }
+		}
+		break;
+
+	    case 1:
+		for (__dstY = 0; __dstY < __newHeight; __dstY++) {
+		    double __pY, __sinPY, __cosPY;
 #ifdef EARLY_OUT
-                    int didFetchInRow = 0;
+		    int didFetchInRow = 0;
 #endif
-                    __pY = (double)(__dstY + __minY);
-
-                    __sinPY = __sin * __pY;
-                    __cosPY = __cos * __pY;
-
-                    __dstPtr = __dstRowPtr;
-                    __dstMask = 0x80;
-                    __dstRowPtr += __dstBytesPerRow;
-
-                    for (__dstX = 0; __dstX < __newWidth; __dstX++) {
-                        double __pX, __nX;
-                        int __pix;
-
-                        /* translate X in destination (center to 0/0) */
-                        __pX = (double)(__dstX + __minX);
-                        /* rotate X */
-                        __nX = (__cos * __pX) - __sinPY;
-
-                        /* translate X in source (origin to 0/0) */
-                        __nX = __nX + __halfW + 0.5;
-
-                        /* inside ? */
-                        if (__nX < 0) {
+		    __pY = (double)(__dstY + __minY);
+
+		    __sinPY = __sin * __pY;
+		    __cosPY = __cos * __pY;
+
+		    __dstPtr = __dstRowPtr;
+		    __dstMask = 0x80;
+		    __dstRowPtr += __dstBytesPerRow;
+
+		    for (__dstX = 0; __dstX < __newWidth; __dstX++) {
+			double __pX, __nX;
+			int __pix;
+
+			/* translate X in destination (center to 0/0) */
+			__pX = (double)(__dstX + __minX);
+			/* rotate X */
+			__nX = (__cos * __pX) - __sinPY;
+
+			/* translate X in source (origin to 0/0) */
+			__nX = __nX + __halfW + 0.5;
+
+			/* inside ? */
+			if (__nX < 0) {
 #ifdef EARLY_OUT
-                            if (didFetchInRow) {
-                                break;
-                            }
+			    if (didFetchInRow) {
+				break;
+			    }
 #endif
 #ifdef FAST_ADVANCE
-                            if (__blackPixel == 0) {
-                                do {
-                                    /* try advance by 8 pixels ... */
-                                    __dstX += 8; __dstPtr ++;
-                                    if (__dstX >= __newWidth) {
-                                        break;
-                                    }
-                                    __pX = (double)(__dstX + __minX);
-                                    __nX = (__cos * __pX) - __sinPY;
-                                    __nX = __nX + __halfW + 0.5;
-                                } while (__nX < 0);
-                                __dstX -= 8; __dstPtr--;
-                            }
+			    if (__blackPixel == 0) {
+				do {
+				    /* try advance by 8 pixels ... */
+				    __dstX += 8; __dstPtr ++;
+				    if (__dstX >= __newWidth) {
+					break;
+				    }
+				    __pX = (double)(__dstX + __minX);
+				    __nX = (__cos * __pX) - __sinPY;
+				    __nX = __nX + __halfW + 0.5;
+				} while (__nX < 0);
+				__dstX -= 8; __dstPtr--;
+			    }
 #endif
-                            __pix = __blackPixel;
-                        } else {
-                            int __srcX;
-
-                            __srcX = (int)__nX;
-                            /* inside ? */
-                            if (__srcX >= __width) {
+			    __pix = __blackPixel;
+			} else {
+			    int __srcX;
+
+			    __srcX = (int)__nX;
+			    /* inside ? */
+			    if (__srcX >= __width) {
 #ifdef EARLY_OUT
-                                if (didFetchInRow) {
-                                    break;
-                                }
+				if (didFetchInRow) {
+				    break;
+				}
 #endif
 #ifdef FAST_ADVANCE2
-                                if (__blackPixel == 0) {
-                                    do {
-                                        /* try advance by 8 pixels ... */
-                                        __dstX += 8; __dstPtr++;
-                                        if (__dstX >= __newWidth) {
-                                            break;
-                                        }
-                                        __pX = (double)(__dstX + __minX);
-                                        __nX = (__cos * __pX) - __sinPY;
-                                        __nX = __nX + __halfW + 0.5;
-                                        __srcX = (int)__nX;
-                                    } while (__srcX >= __width);
-                                    __dstX -= 8; __dstPtr--;
-                                }
+				if (__blackPixel == 0) {
+				    do {
+					/* try advance by 8 pixels ... */
+					__dstX += 8; __dstPtr++;
+					if (__dstX >= __newWidth) {
+					    break;
+					}
+					__pX = (double)(__dstX + __minX);
+					__nX = (__cos * __pX) - __sinPY;
+					__nX = __nX + __halfW + 0.5;
+					__srcX = (int)__nX;
+				    } while (__srcX >= __width);
+				    __dstX -= 8; __dstPtr--;
+				}
 #endif
-                                __pix = __blackPixel;
-                            } else {
-                                double __nY;
-
-                                /* rotate Y */
-                                __nY = (__sin * __pX) + __cosPY;
-                                /* translate Y in source (origin to 0/0) */
-                                __nY = __nY + __halfH + 0.5;
-
-                                /* inside ? */
-                                if (__nY < 0) {
+				__pix = __blackPixel;
+			    } else {
+				double __nY;
+
+				/* rotate Y */
+				__nY = (__sin * __pX) + __cosPY;
+				/* translate Y in source (origin to 0/0) */
+				__nY = __nY + __halfH + 0.5;
+
+				/* inside ? */
+				if (__nY < 0) {
 #ifdef EARLY_OUT
-                                    if (didFetchInRow) {
-                                        break;
-                                    }
+				    if (didFetchInRow) {
+					break;
+				    }
 #endif
 #ifdef FAST_ADVANCE2
-                                    if (__blackPixel == 0) {
-                                        do {
-                                            /* try advance by 8 pixels ... */
-                                            __dstX += 8; __dstPtr++;
-                                            if (__dstX >= __newWidth) {
-                                                break;
-                                            }
-                                            __pX = (double)(__dstX + __minX);
-                                            __nY = (__sin * __pX) + __cosPY;
-                                            __nY = __nY + __halfH + 0.5;
-                                        } while (__nY < 0);
-                                        __dstX -= 8; __dstPtr--;
-                                    }
+				    if (__blackPixel == 0) {
+					do {
+					    /* try advance by 8 pixels ... */
+					    __dstX += 8; __dstPtr++;
+					    if (__dstX >= __newWidth) {
+						break;
+					    }
+					    __pX = (double)(__dstX + __minX);
+					    __nY = (__sin * __pX) + __cosPY;
+					    __nY = __nY + __halfH + 0.5;
+					} while (__nY < 0);
+					__dstX -= 8; __dstPtr--;
+				    }
 #endif
-                                    __pix = __blackPixel;
-                                } else {
-                                    int __srcY;
-
-                                    __srcY = (int)__nY;
-                                    /* inside ? */
-                                    if (__srcY >= __height) {
+				    __pix = __blackPixel;
+				} else {
+				    int __srcY;
+
+				    __srcY = (int)__nY;
+				    /* inside ? */
+				    if (__srcY >= __height) {
 #ifdef EARLY_OUT
-                                        if (didFetchInRow) {
-                                            break;
-                                        }
+					if (didFetchInRow) {
+					    break;
+					}
 #endif
 #ifdef FAST_ADVANCE
-                                        if (__blackPixel == 0) {
-                                            do {
-                                                /* try advance by 8 pixels ... */
-                                                __dstX += 8; __dstPtr++;
-                                                if (__dstX >= __newWidth) {
-                                                    break;
-                                                }
-                                                __pX = (double)(__dstX + __minX);
-                                                __nY = (__sin * __pX) + __cosPY;
-                                                __nY = __nY + __halfH + 0.5;
-                                                __srcY = (int)__nY;
-                                            } while (__srcY >= __height);
-                                            __dstX -= 8; __dstPtr--;
-                                        }
+					if (__blackPixel == 0) {
+					    do {
+						/* try advance by 8 pixels ... */
+						__dstX += 8; __dstPtr++;
+						if (__dstX >= __newWidth) {
+						    break;
+						}
+						__pX = (double)(__dstX + __minX);
+						__nY = (__sin * __pX) + __cosPY;
+						__nY = __nY + __halfH + 0.5;
+						__srcY = (int)__nY;
+					    } while (__srcY >= __height);
+					    __dstX -= 8; __dstPtr--;
+					}
 #endif
-                                        __pix = __blackPixel;
-                                    } else {
-                                        /* fetch source pixel */
-
-                                        int idx, pV;
+					__pix = __blackPixel;
+				    } else {
+					/* fetch source pixel */
+
+					int idx, pV;
 #ifdef EARLY_OUT
-                                        didFetchInRow = 1;
+					didFetchInRow = 1;
 #endif
-                                        idx = __srcY * __srcBytesPerRow + (__srcX >> 3);
-                                        if ((unsigned)idx < __nSrcBytes) {
-                                            pV = __srcBytes[idx];
-                                            __pix = (pV & (0x80 >> (__srcX & 7))) ? 1 : 0;
-                                        } else {
-                                            __pix = __blackPixel;
-                                        }
-                                    }
-                                }
-                            }
-                        }
-
-                        /* store pixel */
-                        if (__pix != 0) {
-                            *__dstPtr |= __dstMask;
-                        }
-                        __dstMask >>= 1;
-                        if (__dstMask == 0) {
-                            __dstMask = 0x80;
-                            __dstPtr++;
-                        }
-                    }
-                }
-                break;
-
-            case 24:
-                for (__dstY = 0; __dstY < __newHeight; __dstY++) {
-                    double __pY, __sinPY, __cosPY;
+					idx = __srcY * __srcBytesPerRow + (__srcX >> 3);
+					if ((unsigned)idx < __nSrcBytes) {
+					    pV = __srcBytes[idx];
+					    __pix = (pV & (0x80 >> (__srcX & 7))) ? 1 : 0;
+					} else {
+					    __pix = __blackPixel;
+					}
+				    }
+				}
+			    }
+			}
+
+			/* store pixel */
+			if (__pix != 0) {
+			    *__dstPtr |= __dstMask;
+			}
+			__dstMask >>= 1;
+			if (__dstMask == 0) {
+			    __dstMask = 0x80;
+			    __dstPtr++;
+			}
+		    }
+		}
+		break;
+
+	    case 24:
+		for (__dstY = 0; __dstY < __newHeight; __dstY++) {
+		    double __pY, __sinPY, __cosPY;
 #ifdef EARLY_OUT
-                    int didFetchInRow = 0;
+		    int didFetchInRow = 0;
 #endif
-                    __pY = (double)(__dstY + __minY);
-
-                    __sinPY = __sin * __pY;
-                    __cosPY = __cos * __pY;
-
-                    __dstPtr = __dstRowPtr;
-                    __dstRowPtr += __dstBytesPerRow;
-
-                    for (__dstX = 0; __dstX < __newWidth; __dstX++) {
-                        double __pX, __nX;
-                        unsigned __pix;
-
-                        /* translate X in destination (center to 0/0) */
-                        __pX = (double)(__dstX + __minX);
-                        /* rotate X */
-                        __nX = (__cos * __pX) - __sinPY;
-
-                        /* translate X in source (origin to 0/0) */
-                        __nX = __nX + __halfW + 0.5;
-
-                        /* inside ? */
-                        if (__nX < 0) {
+		    __pY = (double)(__dstY + __minY);
+
+		    __sinPY = __sin * __pY;
+		    __cosPY = __cos * __pY;
+
+		    __dstPtr = __dstRowPtr;
+		    __dstRowPtr += __dstBytesPerRow;
+
+		    for (__dstX = 0; __dstX < __newWidth; __dstX++) {
+			double __pX, __nX;
+			unsigned __pix;
+
+			/* translate X in destination (center to 0/0) */
+			__pX = (double)(__dstX + __minX);
+			/* rotate X */
+			__nX = (__cos * __pX) - __sinPY;
+
+			/* translate X in source (origin to 0/0) */
+			__nX = __nX + __halfW + 0.5;
+
+			/* inside ? */
+			if (__nX < 0) {
 #ifdef EARLY_OUT
-                            if (didFetchInRow) {
-                                break;
-                            }
+			    if (didFetchInRow) {
+				break;
+			    }
 #endif
-                            __pix = __blackPixel;
-                        } else {
-                            int __srcX;
-
-                            __srcX = (int)__nX;
-                            /* inside ? */
-                            if (__srcX >= __width) {
+			    __pix = __blackPixel;
+			} else {
+			    int __srcX;
+
+			    __srcX = (int)__nX;
+			    /* inside ? */
+			    if (__srcX >= __width) {
 #ifdef EARLY_OUT
-                                if (didFetchInRow) {
-                                    break;
-                                }
+				if (didFetchInRow) {
+				    break;
+				}
 #endif
-                                __pix = __blackPixel;
-                            } else {
-                                double __nY;
-
-                                /* rotate Y */
-                                __nY = (__sin * __pX) + __cosPY;
-                                /* translate Y in source (origin to 0/0) */
-                                __nY = __nY + __halfH + 0.5;
-
-                                /* inside ? */
-                                if (__nY < 0) {
+				__pix = __blackPixel;
+			    } else {
+				double __nY;
+
+				/* rotate Y */
+				__nY = (__sin * __pX) + __cosPY;
+				/* translate Y in source (origin to 0/0) */
+				__nY = __nY + __halfH + 0.5;
+
+				/* inside ? */
+				if (__nY < 0) {
 #ifdef EARLY_OUT
-                                    if (didFetchInRow) {
-                                        break;
-                                    }
+				    if (didFetchInRow) {
+					break;
+				    }
 #endif
-                                    __pix = __blackPixel;
-                                } else {
-                                    int __srcY;
-
-                                    __srcY = (int)__nY;
-                                    /* inside ? */
-                                    if (__srcY >= __height) {
+				    __pix = __blackPixel;
+				} else {
+				    int __srcY;
+
+				    __srcY = (int)__nY;
+				    /* inside ? */
+				    if (__srcY >= __height) {
 #ifdef EARLY_OUT
-                                        if (didFetchInRow) {
-                                            break;
-                                        }
+					if (didFetchInRow) {
+					    break;
+					}
 #endif
-                                        __pix = __blackPixel;
-                                    } else {
-                                        /* fetch source pixel */
-
-                                        int idx;
+					__pix = __blackPixel;
+				    } else {
+					/* fetch source pixel */
+
+					int idx;
 #ifdef EARLY_OUT
-                                        didFetchInRow = 1;
+					didFetchInRow = 1;
 #endif
-                                        idx = __srcY * __srcBytesPerRow + __srcX + __srcX + __srcX;
-                                        if ((unsigned)idx < __nSrcBytes) {
-                                            __pix = __srcBytes[idx];
-                                            __pix = (__pix<<8) | __srcBytes[idx+1];
-                                            __pix = (__pix<<8) | __srcBytes[idx+2];
-                                        } else {
-                                            __pix = __blackPixel;
-                                        }
-                                    }
-                                }
-                            }
-                        }
-
-                        /* store pixel */
-                        if (__pix != 0) {
-                            __dstPtr[0] = (__pix >> 16 & 0xFF);
-                            __dstPtr[1] = (__pix >> 8) & 0xFF;
-                            __dstPtr[2] = __pix & 0xFF;
-                        }
-                        __dstPtr += 3;
-                    }
-                }
-                break;
-
-            default:
-                for (__dstY = 0; __dstY < __newHeight; __dstY++) {
-                    double __pY, __sinPY, __cosPY;
+					idx = __srcY * __srcBytesPerRow + __srcX + __srcX + __srcX;
+					if ((unsigned)idx < __nSrcBytes) {
+					    __pix = __srcBytes[idx];
+					    __pix = (__pix<<8) | __srcBytes[idx+1];
+					    __pix = (__pix<<8) | __srcBytes[idx+2];
+					} else {
+					    __pix = __blackPixel;
+					}
+				    }
+				}
+			    }
+			}
+
+			/* store pixel */
+			if (__pix != 0) {
+			    __dstPtr[0] = (__pix >> 16 & 0xFF);
+			    __dstPtr[1] = (__pix >> 8) & 0xFF;
+			    __dstPtr[2] = __pix & 0xFF;
+			}
+			__dstPtr += 3;
+		    }
+		}
+		break;
+
+	    default:
+		for (__dstY = 0; __dstY < __newHeight; __dstY++) {
+		    double __pY, __sinPY, __cosPY;
 #ifdef EARLY_OUT
-                    int didFetchInRow = 0;
+		    int didFetchInRow = 0;
 #endif
-                    __pY = (double)(__dstY + __minY);
-
-                    __sinPY = __sin * __pY;
-                    __cosPY = __cos * __pY;
-
-                    __dstPtr = __dstRowPtr;
-                    __dstMask = 0x80;
-                    __dstRowPtr += __dstBytesPerRow;
-
-                    for (__dstX = 0; __dstX < __newWidth; __dstX++) {
-                        double __pX, __nX;
-                        OBJ __pix;
-
-                        /* translate X in destination (center to 0/0) */
-                        __pX = (double)(__dstX + __minX);
-                        /* rotate X */
-                        __nX = (__cos * __pX) - __sinPY;
-
-                        /* translate X in source (origin to 0/0) */
-                        __nX = __nX + __halfW + 0.5;
-
-                        /* inside ? */
-                        if (__nX < 0) {
+		    __pY = (double)(__dstY + __minY);
+
+		    __sinPY = __sin * __pY;
+		    __cosPY = __cos * __pY;
+
+		    __dstPtr = __dstRowPtr;
+		    __dstMask = 0x80;
+		    __dstRowPtr += __dstBytesPerRow;
+
+		    for (__dstX = 0; __dstX < __newWidth; __dstX++) {
+			double __pX, __nX;
+			OBJ __pix;
+
+			/* translate X in destination (center to 0/0) */
+			__pX = (double)(__dstX + __minX);
+			/* rotate X */
+			__nX = (__cos * __pX) - __sinPY;
+
+			/* translate X in source (origin to 0/0) */
+			__nX = __nX + __halfW + 0.5;
+
+			/* inside ? */
+			if (__nX < 0) {
 #ifdef EARLY_OUT
-                            if (didFetchInRow) {
-                                break;
-                            }
+			    if (didFetchInRow) {
+				break;
+			    }
 #endif
-                            __pix = blackPixel;
-                        } else {
-                            int __srcX;
-
-                            __srcX = (int)__nX;
-                            /* inside ? */
-                            if (__srcX >= __width) {
+			    __pix = blackPixel;
+			} else {
+			    int __srcX;
+
+			    __srcX = (int)__nX;
+			    /* inside ? */
+			    if (__srcX >= __width) {
 #ifdef EARLY_OUT
-                                if (didFetchInRow) {
-                                    break;
-                                }
+				if (didFetchInRow) {
+				    break;
+				}
 #endif
-                                __pix = blackPixel;
-                            } else {
-                                double __nY;
-
-                                /* rotate Y */
-                                __nY = (__sin * __pX) + __cosPY;
-                                /* translate Y in source (origin to 0/0) */
-                                __nY = __nY + __halfH + 0.5;
-
-                                /* inside ? */
-                                if (__nY < 0) {
+				__pix = blackPixel;
+			    } else {
+				double __nY;
+
+				/* rotate Y */
+				__nY = (__sin * __pX) + __cosPY;
+				/* translate Y in source (origin to 0/0) */
+				__nY = __nY + __halfH + 0.5;
+
+				/* inside ? */
+				if (__nY < 0) {
 #ifdef EARLY_OUT
-                                    if (didFetchInRow) {
-                                        break;
-                                    }
+				    if (didFetchInRow) {
+					break;
+				    }
 #endif
-                                    __pix = blackPixel;
-                                } else {
-                                    int __srcY;
-
-                                    __srcY = (int)__nY;
-                                    /* inside ? */
-                                    if (__srcY >= __height) {
+				    __pix = blackPixel;
+				} else {
+				    int __srcY;
+
+				    __srcY = (int)__nY;
+				    /* inside ? */
+				    if (__srcY >= __height) {
 #ifdef EARLY_OUT
-                                        if (didFetchInRow) {
-                                            break;
-                                        }
+					if (didFetchInRow) {
+					    break;
+					}
 #endif
-                                        __pix = blackPixel;
-                                    } else {
-                                        /* fetch source pixel */
-
-                                        static struct inlineCache valAt = _ILC2;
+					__pix = blackPixel;
+				    } else {
+					/* fetch source pixel */
+
+					static struct inlineCache valAt = _ILC2;
 #ifdef EARLY_OUT
-                                        didFetchInRow = 1;
+					didFetchInRow = 1;
 #endif
-                                        __pix = (*valAt.ilc_func)(self,
-                                                              @symbol(pixelAtX:y:),
-                                                              nil, &valAt,
-                                                              __MKSMALLINT(__srcX),
-                                                              __MKSMALLINT(__srcY));
-                                    }
-                                }
-                            }
-                        }
-
-                        /* store pixel */
-                        {
-                            static struct inlineCache atPutVal = _ILC3;
-
-                            if (__pix != __MKSMALLINT(0)) {
-                                (*atPutVal.ilc_func)(newImage,
-                                                      @symbol(pixelAtX:y:put:),
-                                                      nil, &atPutVal,
-                                                      __MKSMALLINT(__dstX),
-                                                      __MKSMALLINT(__dstY),
-                                                      __pix
-                                                     );
-                            }
-                        }
-                    }
-                }
-                break;
-        }
-
-        bad = false;
+					__pix = (*valAt.ilc_func)(self,
+							      @symbol(pixelAtX:y:),
+							      nil, &valAt,
+							      __MKSMALLINT(__srcX),
+							      __MKSMALLINT(__srcY));
+				    }
+				}
+			    }
+			}
+
+			/* store pixel */
+			{
+			    static struct inlineCache atPutVal = _ILC3;
+
+			    if (__pix != __MKSMALLINT(0)) {
+				(*atPutVal.ilc_func)(newImage,
+						      @symbol(pixelAtX:y:put:),
+						      nil, &atPutVal,
+						      __MKSMALLINT(__dstX),
+						      __MKSMALLINT(__dstY),
+						      __pix
+						     );
+			    }
+			}
+		    }
+		}
+		break;
+	}
+
+	bad = false;
     }
 %}.
 
     bad ifTrue:[
-        "/ should not happen
-        self primitiveFailed
+	"/ should not happen
+	self primitiveFailed
 
 "/        sinRot := radians negated sin.
 "/        cosRot := radians negated cos.
@@ -9919,13 +9919,13 @@
 "/                    (srcY >= 0 and:[srcY < height]) ifTrue:[
 "/                        pix := self pixelAtX:srcX y:srcY
 "/                    ] ifFalse:[
-"/                        pix := blackPixel.        
+"/                        pix := blackPixel.
 "/                    ].
 "/                ] ifFalse:[
-"/                    pix := blackPixel.        
+"/                    pix := blackPixel.
 "/                ].
 "/                pix ~~ blackPixel ifTrue:[
-"/                    newImage pixelAtX:dstX y:dstY put:pix.        
+"/                    newImage pixelAtX:dstX y:dstY put:pix.
 "/                ]
 "/            ].
 "/        ].
@@ -9955,9 +9955,9 @@
 
      i := Smalltalk imageFromFileNamed:'bitmaps/gifImages/garfield.gif' inPackage:'stx:goodies'.
      Transcript showCR:(
-        Time millisecondsToRun:[
-           i rotated:45.
-        ]
+	Time millisecondsToRun:[
+	   i rotated:45.
+	]
      ).
     "
     "
@@ -9968,12 +9968,12 @@
      v openAndWait.
      rot := 0.
      [true] whileTrue:[
-        rI := i rotated:rot.
-        rI := rI onDevice:v device.
-        v clear.
-        v displayForm:rI x:v width//2-(rI width//2) y:v height//2-(rI height // 2).
-        rot := rot + 5.
-        rI close.
+	rI := i rotated:rot.
+	rI := rI onDevice:v device.
+	v clear.
+	v displayForm:rI x:v width//2-(rI width//2) y:v height//2-(rI height // 2).
+	rot := rot + 5.
+	rI close.
      ]
     "
     "
@@ -9984,12 +9984,12 @@
      v openAndWait.
      rot := 0.
      [true] whileTrue:[
-        rI := i rotated:rot.
-        rI := rI onDevice:v device.
-        v clear.
-        v displayForm:rI x:v width//2-(rI width//2) y:v height//2-(rI height // 2).
-        rot := rot + 5.
-        rI close.
+	rI := i rotated:rot.
+	rI := rI onDevice:v device.
+	v clear.
+	v displayForm:rI x:v width//2-(rI width//2) y:v height//2-(rI height // 2).
+	rot := rot + 5.
+	rI close.
      ]
     "
 
@@ -10002,8 +10002,8 @@
      CAVEAT: this only works with palette images (i.e. not for rgb or greyScale).
      CAVEAT: Need an argument, which specifies by how much it should be lighter."
 
-    ^ self 
-        copyWithColorMapProcessing:[:clr | clr lightened]
+    ^ self
+	copyWithColorMapProcessing:[:clr | clr lightened]
 
     "
      (Smalltalk bitmapFromFileNamed:'gifImages/claus.gif' inPackage:'stx:goodies') inspect
@@ -10061,12 +10061,12 @@
     ].
 
     newImage := self species new.
-    newImage 
-	width:newWidth 
-	height:newHeight 
-	photometric:photometric 
-	samplesPerPixel:samplesPerPixel 
-	bitsPerSample:bitsPerSample 
+    newImage
+	width:newWidth
+	height:newHeight
+	photometric:photometric
+	samplesPerPixel:samplesPerPixel
+	bitsPerSample:bitsPerSample
 	colorMap:colorMap copy
 	bits:newBits
 	mask:newMask.
@@ -10078,9 +10078,9 @@
 
 	1 to:h do:[:row |
 	    1 to:magY do:[:i |
-		newBits replaceFrom:dstOffset 
+		newBits replaceFrom:dstOffset
 			to:(dstOffset + oldBytesPerRow - 1)
-			with:bytes 
+			with:bytes
 			startingAt:srcOffset.
 		dstOffset := dstOffset + newBytesPerRow
 	    ].
@@ -10092,19 +10092,19 @@
 	    dstOffset := 1.
 	    srcOffset := 1.
 	    1 to:h do:[:row |
-		self magnifyRowFrom:bytes 
-		     offset:srcOffset  
-		     into:newBits 
-		     offset:dstOffset 
+		self magnifyRowFrom:bytes
+		     offset:srcOffset
+		     into:newBits
+		     offset:dstOffset
 		     factor:mX.
 
 		first := dstOffset.
 		dstOffset := dstOffset + newBytesPerRow.
 		" and copy for row expansion "
 		2 to:magY do:[:i |
-		    newBits replaceFrom:dstOffset 
+		    newBits replaceFrom:dstOffset
 			    to:(dstOffset + newBytesPerRow - 1)
-			    with:newBits 
+			    with:newBits
 			    startingAt:first.
 		    dstOffset := dstOffset + newBytesPerRow
 		].
@@ -10121,7 +10121,7 @@
     "Modified: 24.4.1997 / 18:32:04 / cg"
 !
 
-magnifiedPreservingRatioTo:anExtent 
+magnifiedPreservingRatioTo:anExtent
     "return a new image magnified to fit into anExtent,
      preserving the receivers width/height ratio.
      (i.e. not distorting the image).
@@ -10144,7 +10144,7 @@
     "Modified: 22.4.1997 / 12:33:46 / cg"
 !
 
-magnifiedTo:anExtent 
+magnifiedTo:anExtent
     "return a new image magnified to have the size specified by extent.
      This may distort the image if the arguments ratio is not the images ratio.
      See also #magnifiedPreservingRatioTo: and #magnifiedBy:"
@@ -10161,14 +10161,14 @@
 !
 
 mixed:amount with:aColor
-    "return a new image which is blended with some color; 
+    "return a new image which is blended with some color;
      amount determines how much of the blending color is applied (0..)
      where 0 means: blending color pure.
      The receiver must be a palette image (currently).
      CAVEAT: this only works with palette images (i.e. not for rgb or greyScale).
      CAVEAT: Need an argument, which specifies by how much it should be lighter."
 
-     ^ self 
+     ^ self
 	copyWithColorMapProcessing:[:clr | clr mixed:amount with:aColor]
 
     "
@@ -10205,8 +10205,8 @@
 	^ nil
     ].
 
-     ^ self 
-	copyWithColorMapProcessing:[:clr | 
+     ^ self
+	copyWithColorMapProcessing:[:clr |
 		|newColor|
 
 		newColor := Color
@@ -10299,7 +10299,7 @@
      newColors newColorArray newImage extMask extBits newPixelValue|
 
     numBits > 7 ifTrue:[
-        ^ nil
+	^ nil
     ].
     mask := (16rFF bitShift:numBits) bitAnd:16rFF.
     extMask := (1 bitShift:numBits).
@@ -10321,71 +10321,71 @@
     xMax := width - 1.
     yMax := height - 1.
 
-    newPixelValue := 
-        [:image :pixelValue |
-            |r g b nR nG nB|
-
-            r := image redBitsOf:pixelValue.
-            g := image greenBitsOf:pixelValue.
-            b := image blueBitsOf:pixelValue.
-            nR := r bitAnd:mask. (nR bitAnd:extMask)~~0 ifTrue:[nR := nR bitOr:extBits].
-            nG := g bitAnd:mask. (nG bitAnd:extMask)~~0 ifTrue:[nG := nG bitOr:extBits].
-            nB := b bitAnd:mask. (nB bitAnd:extMask)~~0 ifTrue:[nB := nB bitOr:extBits].
-            image valueFromRedBits:nR greenBits:nG blueBits:nB.
-        ].
+    newPixelValue :=
+	[:image :pixelValue |
+	    |r g b nR nG nB|
+
+	    r := image redBitsOf:pixelValue.
+	    g := image greenBitsOf:pixelValue.
+	    b := image blueBitsOf:pixelValue.
+	    nR := r bitAnd:mask. (nR bitAnd:extMask)~~0 ifTrue:[nR := nR bitOr:extBits].
+	    nG := g bitAnd:mask. (nG bitAnd:extMask)~~0 ifTrue:[nG := nG bitOr:extBits].
+	    nB := b bitAnd:mask. (nB bitAnd:extMask)~~0 ifTrue:[nB := nB bitOr:extBits].
+	    image valueFromRedBits:nR greenBits:nG blueBits:nB.
+	].
 
 
     photometric == #palette ifFalse:[
-        "/ direct manipulation of the pixels
-        0 to:yMax do:[:y |
-            0 to:xMax do:[:x |
-                pix := self pixelAtX:x y:y.
-                n_pix := newPixelValue value:self value:pix.
-                n_pix ~= pix ifTrue:[
-                    newImage pixelAtX:x y:y put:n_pix.
-                    anyChange := true.
-                ]
-            ]
-        ].
-        anyChange ifFalse:[
-            ^ nil
-        ].
+	"/ direct manipulation of the pixels
+	0 to:yMax do:[:y |
+	    0 to:xMax do:[:x |
+		pix := self pixelAtX:x y:y.
+		n_pix := newPixelValue value:self value:pix.
+		n_pix ~= pix ifTrue:[
+		    newImage pixelAtX:x y:y put:n_pix.
+		    anyChange := true.
+		]
+	    ]
+	].
+	anyChange ifFalse:[
+	    ^ nil
+	].
     ] ifTrue:[
-        "/ manipulate the colormap
-        0 to:yMax do:[:y |
-            0 to:xMax do:[:x |
-                pix := self pixelAtX:x y:y.
-                (n_pix := map at:pix+1) isNil ifTrue:[
-                    clr := self colorAtX:x y:y.
-
-                    r := clr redByte.
-                    g := clr greenByte.
-                    b := clr blueByte.
-                    nR := r bitAnd:mask. (nR bitAnd:extMask)~~0 ifTrue:[nR := nR bitOr:extBits].
-                    nG := g bitAnd:mask. (nR bitAnd:extMask)~~0 ifTrue:[nR := nR bitOr:extBits].
-                    nB := b bitAnd:mask. (nR bitAnd:extMask)~~0 ifTrue:[nR := nR bitOr:extBits].
-                    n_clr := Color redByte:nR greenByte:nG blueByte:nB.
-                    (newColors includes:n_clr) ifFalse:[
-                        newColors add:n_clr.
-                        newColorArray add:n_clr.
-                        revMap add:pix.
-                        map at:pix+1 put:(n_pix := revMap size - 1).
-                    ] ifTrue:[
-                        "/ mhmh - multiple pixels mapped to the same color
-                        n_pix := (newColorArray indexOf:n_clr) - 1.
-                        map at:pix+1 put:n_pix.
-                    ]
-                ].
-                newImage pixelAtX:x y:y put:n_pix.
-            ]
-        ].
-        revMap size == self colorMap size ifTrue:[
-            revMap = (0 to:revMap size-1) ifTrue:[
-                ^ nil
-            ]
-        ].
-
-        newImage colorMap:(MappedPalette withColors:newColorArray).
+	"/ manipulate the colormap
+	0 to:yMax do:[:y |
+	    0 to:xMax do:[:x |
+		pix := self pixelAtX:x y:y.
+		(n_pix := map at:pix+1) isNil ifTrue:[
+		    clr := self colorAtX:x y:y.
+
+		    r := clr redByte.
+		    g := clr greenByte.
+		    b := clr blueByte.
+		    nR := r bitAnd:mask. (nR bitAnd:extMask)~~0 ifTrue:[nR := nR bitOr:extBits].
+		    nG := g bitAnd:mask. (nR bitAnd:extMask)~~0 ifTrue:[nR := nR bitOr:extBits].
+		    nB := b bitAnd:mask. (nR bitAnd:extMask)~~0 ifTrue:[nR := nR bitOr:extBits].
+		    n_clr := Color redByte:nR greenByte:nG blueByte:nB.
+		    (newColors includes:n_clr) ifFalse:[
+			newColors add:n_clr.
+			newColorArray add:n_clr.
+			revMap add:pix.
+			map at:pix+1 put:(n_pix := revMap size - 1).
+		    ] ifTrue:[
+			"/ mhmh - multiple pixels mapped to the same color
+			n_pix := (newColorArray indexOf:n_clr) - 1.
+			map at:pix+1 put:n_pix.
+		    ]
+		].
+		newImage pixelAtX:x y:y put:n_pix.
+	    ]
+	].
+	revMap size == self colorMap size ifTrue:[
+	    revMap = (0 to:revMap size-1) ifTrue:[
+		^ nil
+	    ]
+	].
+
+	newImage colorMap:(MappedPalette withColors:newColorArray).
     ].
 
     ^ newImage
@@ -10398,7 +10398,7 @@
      (#withPixelFunctionAppliedToPixels:) or redefine this method in
      a concrete subclass.
      (read `Beyond photography, by Gerard J. Holzmann;
-           ISBM 0-13-074410-7)
+	   ISBM 0-13-074410-7)
      See blurred / oilPointed as examples ...)"
 
     |w  "{Class: SmallInteger }"
@@ -10421,13 +10421,13 @@
     h := height - 1.
 
     0 to:h do:[:y |
-        0 to:w do:[:x |
-            newImage colorAtX:x y:y put:(pixelFunctionBlock
-                                                value:self
-                                                value:(self colorAtX:x y:y)
-                                                value:x
-                                                value:y)
-        ]
+	0 to:w do:[:x |
+	    newImage colorAtX:x y:y put:(pixelFunctionBlock
+						value:self
+						value:(self colorAtX:x y:y)
+						value:x
+						value:y)
+	]
     ].
     ^ newImage
 
@@ -10440,13 +10440,13 @@
 
      black := Color black.
      (i withPixelFunctionApplied:[:oldImage :oldColor :x :y |
-                        ((x between:100 and:200) 
-                        and:[y between:100 and:200]) ifTrue:[
-                            oldColor
-                        ] ifFalse:[
-                            black.
-                        ]
-                     ]) inspect.
+			((x between:100 and:200)
+			and:[y between:100 and:200]) ifTrue:[
+			    oldColor
+			] ifFalse:[
+			    black.
+			]
+		     ]) inspect.
     "
     "brighten a frame:
 
@@ -10458,15 +10458,15 @@
      w := i width.
      h := i height.
      (i withPixelFunctionApplied:[:oldImage :oldColor :x :y |
-                        ((x between:0 and:10) 
-                        or:[(y between:0 and:10)
-                        or:[(x between:w-10 and:w)
-                        or:[y between:h-10 and:h]]]) ifTrue:[
-                            oldColor lightened nearestIn:i colorMap
-                        ] ifFalse:[
-                            oldColor.
-                        ]
-                     ]) inspect.
+			((x between:0 and:10)
+			or:[(y between:0 and:10)
+			or:[(x between:w-10 and:w)
+			or:[y between:h-10 and:h]]]) ifTrue:[
+			    oldColor lightened nearestIn:i colorMap
+			] ifFalse:[
+			    oldColor.
+			]
+		     ]) inspect.
     "
 
     "Modified: 24.4.1997 / 18:36:59 / cg"
@@ -10479,8 +10479,8 @@
 	   ISBM 0-13-074410-7)
      See blurred / oilPointed as examples ...)"
 
-    ^ self 
-	withPixelFunctionAppliedToPixels:pixelFunctionBlock 
+    ^ self
+	withPixelFunctionAppliedToPixels:pixelFunctionBlock
 	in:(0@0 corner:width@height)
 
     "oil painting effect:
@@ -10590,7 +10590,7 @@
     "return a new image from the old one, by applying a pixel processor
      on the pixel values.
      (read `Beyond photography, by Gerard J. Holzmann;
-           ISBM 0-13-074410-7)
+	   ISBM 0-13-074410-7)
      See blurred / oilPointed as examples ...)"
 
     |newImage "newBits newBytesPerRow"|
@@ -10619,27 +10619,27 @@
      w := i width - 1.
      h := i height - 1.
      (i withPixelFunctionAppliedToPixels:[:oldImage :oldPixel :x :y |
-                        |b p max xMin xMax yMin yMax|
-
-                        b := Bag identityNew:10.
-                        xMin := x-3 max:0.
-                        xMax := x+3 min:w.
-                        yMin := y-3 max:0.
-                        yMax := y+3 min:h.
-                        xMin to:xMax do:[:tx|
-                          yMin to:yMax do:[:ty|
-                            b add:(oldImage pixelAtX:tx y:ty)
-                          ]
-                        ].
-                        max := 0.
-                        b contents keysAndValuesDo:[:pixel :n |
-                            n > max ifTrue:[
-                                p := pixel.
-                                max := n
-                            ]
-                        ].
-                        p
-                     ]) inspect.
+			|b p max xMin xMax yMin yMax|
+
+			b := Bag identityNew:10.
+			xMin := x-3 max:0.
+			xMax := x+3 min:w.
+			yMin := y-3 max:0.
+			yMax := y+3 min:h.
+			xMin to:xMax do:[:tx|
+			  yMin to:yMax do:[:ty|
+			    b add:(oldImage pixelAtX:tx y:ty)
+			  ]
+			].
+			max := 0.
+			b contents keysAndValuesDo:[:pixel :n |
+			    n > max ifTrue:[
+				p := pixel.
+				max := n
+			    ]
+			].
+			p
+		     ]) inspect.
     "
 
     "fisheye effect:
@@ -10655,25 +10655,25 @@
      R := w2.
      white := i valueFromColor:Color white.
      (i withPixelFunctionAppliedToPixels:[:oldImage :oldPixel :x :y |
-                        |p r a nR nP nX nY|
-
-                        p := (x-w2)@(y-h2).
-                        r := p r.
-                        a := p theta.
-                        nR := r * r / R.
-                        nP := Point r:nR theta:a.
-                        nX := ((nP x+w2) rounded max:0) min:w.
-                        nY := ((nP y+h2) rounded max:0) min:h.
-                        (nX > w or:[nX < 0]) ifTrue:[
-                            white
-                        ] ifFalse:[
-                            (nY > h or:[nY < 0]) ifTrue:[
-                                white
-                            ] ifFalse:[
-                                oldImage pixelAtX:nX y:nY
-                            ]
-                        ]
-                     ]) inspect.
+			|p r a nR nP nX nY|
+
+			p := (x-w2)@(y-h2).
+			r := p r.
+			a := p theta.
+			nR := r * r / R.
+			nP := Point r:nR theta:a.
+			nX := ((nP x+w2) rounded max:0) min:w.
+			nY := ((nP y+h2) rounded max:0) min:h.
+			(nX > w or:[nX < 0]) ifTrue:[
+			    white
+			] ifFalse:[
+			    (nY > h or:[nY < 0]) ifTrue:[
+				white
+			    ] ifFalse:[
+				oldImage pixelAtX:nX y:nY
+			    ]
+			]
+		     ]) inspect.
     "
     "fisheye effect:
 
@@ -10688,25 +10688,25 @@
      R := w2.
      white := i valueFromColor:Color white.
      (i withPixelFunctionAppliedToPixels:[:oldImage :oldPixel :x :y |
-                        |p r a nR nP nX nY|
-
-                        p := (x-w2)@(y-h2).
-                        r := p r.
-                        a := p theta.
-                        nR := r * r / R.
-                        nP := Point r:nR theta:a.
-                        nX := (nP x+w2) rounded.
-                        nY := (nP y+h2) rounded.
-                        (nX > w or:[nX < 0]) ifTrue:[
-                            white
-                        ] ifFalse:[
-                            (nY > h or:[nY < 0]) ifTrue:[
-                                white
-                            ] ifFalse:[
-                                oldImage pixelAtX:nX y:nY
-                            ]
-                        ]
-                     ]) inspect.
+			|p r a nR nP nX nY|
+
+			p := (x-w2)@(y-h2).
+			r := p r.
+			a := p theta.
+			nR := r * r / R.
+			nP := Point r:nR theta:a.
+			nX := (nP x+w2) rounded.
+			nY := (nP y+h2) rounded.
+			(nX > w or:[nX < 0]) ifTrue:[
+			    white
+			] ifFalse:[
+			    (nY > h or:[nY < 0]) ifTrue:[
+				white
+			    ] ifFalse:[
+				oldImage pixelAtX:nX y:nY
+			    ]
+			]
+		     ]) inspect.
     "
 
     "Created: 24.4.1997 / 18:37:17 / cg"
@@ -10805,7 +10805,7 @@
      enumerate pixelValues and evaluate the block for each.
      To be redefined by subclasses for better performance."
 
-    ^ self applyPixelValuesTo:pixelFunctionBlock in:aRectangle into:newImage 
+    ^ self applyPixelValuesTo:pixelFunctionBlock in:aRectangle into:newImage
 !
 
 magnifyBy:scale
@@ -10826,10 +10826,10 @@
      WARNING:
        This implementation is a very slow fallback general algorithm
        (the loop over the source pixels is very slow).
-       If this method is used heavily, you may want to redefine it in 
-       concrete subclasses for the common case of of copying from an Image 
+       If this method is used heavily, you may want to redefine it in
+       concrete subclasses for the common case of of copying from an Image
        with the same depth & palette.
-       If you do heavy image processing, specialized versions are even req'd 
+       If you do heavy image processing, specialized versions are even req'd
        for other cases, rewriting the inner loops as inline C-code."
 
     |dX dY|
@@ -10840,34 +10840,34 @@
     ((photometric == anImage photometric)
      and:[self bitsPerPixel == anImage bitsPerPixel
      and:[colorMap = anImage colorMap]]) ifTrue:[
-        "/ can loop over values
-        anImage valuesFromX:srcX  y:srcY 
-                        toX:srcX+w-1 y:srcY+h-1  
-                         do:[:x :y :pixelValue |
-            self pixelAtX:x-dX y:y-dY put:pixelValue.
-        ]
+	"/ can loop over values
+	anImage valuesFromX:srcX  y:srcY
+			toX:srcX+w-1 y:srcY+h-1
+			 do:[:x :y :pixelValue |
+	    self pixelAtX:x-dX y:y-dY put:pixelValue.
+	]
     ] ifFalse:[
-        "/ must loop over colors - horribly slow
-        anImage colorsFromX:srcX  y:srcY 
-                        toX:srcX+w-1 y:srcY+h-1  
-                         do:[:x :y :clr |
-            self colorAtX:x-dX y:y-dY put:clr.
-        ]
+	"/ must loop over colors - horribly slow
+	anImage colorsFromX:srcX  y:srcY
+			toX:srcX+w-1 y:srcY+h-1
+			 do:[:x :y :clr |
+	    self colorAtX:x-dX y:y-dY put:clr.
+	]
     ].
 
     (mask isNil and:[anImage mask notNil]) ifTrue:[
-        "/ I have no mask; copied image has
-        self createMask.
+	"/ I have no mask; copied image has
+	self createMask.
     ].
 
     mask notNil ifTrue:[
-        anImage mask notNil ifTrue:[
-            "/ both have a mask
-            mask copyFrom:anImage mask x:srcX y:srcY toX:dstX y:dstY width:w height:h
-        ] ifFalse:[
-            "/ I have a mask - copied image has not
-            mask fillRectangleX:dstX y:dstY width:w height:h withValue:1
-        ]
+	anImage mask notNil ifTrue:[
+	    "/ both have a mask
+	    mask copyFrom:anImage mask x:srcX y:srcY toX:dstX y:dstY width:w height:h
+	] ifFalse:[
+	    "/ I have a mask - copied image has not
+	    mask fillRectangleX:dstX y:dstY width:w height:h withValue:1
+	]
 "/    ] ifFalse:[
 "/        anImage mask notNil ifTrue:[
 "/            "/ I have no mask; copied image has (already handled)
@@ -10923,29 +10923,29 @@
     aStream nextPutAll:'; height: '. height storeOn:aStream.
     aStream nextPutAll:'; photometric:('. photometric storeOn:aStream.
     aStream nextPutAll:'); bitsPerSample:('. bitsPerSample storeOn:aStream.
-    aStream nextPutAll:'); samplesPerPixel:('. samplesPerPixel storeOn:aStream. 
+    aStream nextPutAll:'); samplesPerPixel:('. samplesPerPixel storeOn:aStream.
     aStream nextPutAll:'); bits:(ByteArray fromPackedString:'. self bits asPackedString storeOn:aStream. aStream nextPutAll:') '.
 
     colorMap notNil ifTrue:[
-        self depth <= 8 ifTrue:[
-            "/ cut off unused colors ...
-            usedValues := self usedValues.
-            colors := colorMap copyFrom:1 to:((usedValues max+1) min:colorMap size).
-
-            colorMapArray := OrderedCollection new.
-            colors do:[:clr| colorMapArray add:(clr redByte); add:(clr greenByte); add:(clr blueByte)].
-            aStream nextPutAll:'; colorMapFromArray:'.
-            colorMapArray asByteArray storeOn:aStream.
-        ] ifFalse:[
-            aStream nextPutAll:'; colorMap:('.
-            colorMap storeOn:aStream.
-            aStream nextPutAll:')'
-        ]
-    ].  
+	self depth <= 8 ifTrue:[
+	    "/ cut off unused colors ...
+	    usedValues := self usedValues.
+	    colors := colorMap copyFrom:1 to:((usedValues max+1) min:colorMap size).
+
+	    colorMapArray := OrderedCollection new.
+	    colors do:[:clr| colorMapArray add:(clr redByte); add:(clr greenByte); add:(clr blueByte)].
+	    aStream nextPutAll:'; colorMapFromArray:'.
+	    colorMapArray asByteArray storeOn:aStream.
+	] ifFalse:[
+	    aStream nextPutAll:'; colorMap:('.
+	    colorMap storeOn:aStream.
+	    aStream nextPutAll:')'
+	]
+    ].
     mask notNil ifTrue:[
-        aStream nextPutAll:'; mask:('.
-        mask storeOn:aStream.
-        aStream nextPutAll:')'.
+	aStream nextPutAll:'; mask:('.
+	mask storeOn:aStream.
+	aStream nextPutAll:')'.
     ].
     aStream nextPutAll:'; yourself'
 
@@ -10962,8 +10962,8 @@
 
     |bestDeviceDepth
      bestDeviceBitsPerPixel "{ Class: SmallInteger }"
-     "maxDepth" 
-     bestInfo maxInfo 
+     "maxDepth"
+     bestInfo maxInfo
      myDepth                "{ Class: SmallInteger }"
      maxBitsPerPixel        "{ Class: SmallInteger }"|
 
@@ -10981,7 +10981,7 @@
 	"/ devices depth.
 	"/ (actually, many devices can handle other pixMap formats,
 	"/ but I dont know (yet) how to pass the correct color info
-        
+
 	((deviceImageDepth == 1) or:[deviceImageDepth == aDevice depth]) ifTrue:[
 
 	    deviceImageBitsPerPixel > maxBitsPerPixel ifTrue:[
@@ -11008,7 +11008,7 @@
 			bestDeviceDepth := deviceImageDepth.
 			bestDeviceBitsPerPixel := deviceImageBitsPerPixel.
 		    ]
-		]    
+		]
 	    ].
 	].
     ].
@@ -11064,7 +11064,7 @@
 	    self setColorMap:(anImage colorMap copy).
 	    "
 	     must generate/compress the colormap, if source image has higher depth
-	     than myself. 
+	     than myself.
 	    "
 	    (colorMap isNil
 	    or:[anImage bitsPerPixel > self bitsPerPixel]) ifTrue:[
@@ -11095,7 +11095,7 @@
 
 greyByteMapForRange:range
     "return a collection to map from pixelValues to greyLevels
-     in the range 0..range. 
+     in the range 0..range.
      Range must be < 256 (for elements to fit into a ByteArray).
      The values are rounded towards the nearest pixel."
 
@@ -11234,7 +11234,7 @@
     "Modified: 1.3.1997 / 15:48:49 / cg"
 !
 
-magnifyRowFrom:srcBytes offset:srcStart  
+magnifyRowFrom:srcBytes offset:srcStart
 	  into:dstBytes offset:dstStart factor:mX
 
     "magnify a single pixel row - can only magnify by integer factors,
@@ -11245,7 +11245,7 @@
 
 makeDeviceGrayPixmapOn:aDevice depth:depth fromArray:bits
     "given the bits of a grey/color bitmap, 8-bit padded and
-     pixels interpreted as greyValues, 0 is black,  
+     pixels interpreted as greyValues, 0 is black,
      create a device form for it"
 
     |f|
@@ -11260,15 +11260,15 @@
 	"/ have to invert bits
 	f function:#copyInverted
     ].
-    aDevice 
-	drawBits:bits 
+    aDevice
+	drawBits:bits
 	depth:depth
 	padding:8
 	width:width height:height
 	x:0 y:0
-	into:(f id) 
-	x:0 y:0 
-	width:width height:height 
+	into:(f id)
+	x:0 y:0
+	width:width height:height
 	with:(f gcId).
     ^ f
 
@@ -11289,7 +11289,7 @@
 
 makeDevicePixmapOn:aDevice depth:depth fromArray:bits
     "given the bits of a grey/color bitmap, 8-bit padded and
-     pixels interpreted as in the devices colormap, 
+     pixels interpreted as in the devices colormap,
      create a device form for it"
 
     |f|
@@ -11300,15 +11300,15 @@
     f bits:bits.
     f initGC.
 
-    aDevice 
-	drawBits:bits 
+    aDevice
+	drawBits:bits
 	depth:depth
 	padding:8
 	width:width height:height
 	x:0 y:0
-	into:(f id) 
-	x:0 y:0 
-	width:width height:height 
+	into:(f id)
+	x:0 y:0
+	width:width height:height
 	with:(f gcId).
     ^ f
 
@@ -11382,7 +11382,7 @@
     "return the average color of the image.
      This usually only makes sense for textures and patterns
      (i.e. to compute shadow & light colors for viewBackgrounds).
-     Notice, that for the above purpose, it is usually ok to process 
+     Notice, that for the above purpose, it is usually ok to process
      a subImage - i.e. use Image>>averageColorIn: on a smaller rectangle"
 
     ^ self averageColorIn:(0@0 corner:(width-1)@(height-1))
@@ -11392,7 +11392,7 @@
     "return the images average color in an area.
      The implementation below is slow - so you may want to
      create tuned versions for DepthXImage if you plan to do
-     heavy image processing ... 
+     heavy image processing ...
      (also, creating tuned versions of the enumeration messages helps a lot)"
 
     |x0 "{ Class:SmallInteger }"
@@ -11401,13 +11401,13 @@
      y1 "{ Class:SmallInteger }"
      sumRed sumGreen sumBlue n|
 
-    sumRed := sumGreen := sumBlue := 0.    
+    sumRed := sumGreen := sumBlue := 0.
     y0 := aRectangle top.
     y1 := aRectangle bottom.
     x0 := aRectangle left.
     x1 := aRectangle right.
 
-    n := (x1 - x0 + 1) * (y1 - y0 + 1).    
+    n := (x1 - x0 + 1) * (y1 - y0 + 1).
     mask isNil ifTrue:[
 	self colorsFromX:x0 y:y0 toX:x1 y:y1 do:[:x :y :colorAtXY |
 	    sumRed := sumRed + colorAtXY red.
@@ -11587,59 +11587,59 @@
 
     p := photometric.
     p isNil ifTrue:[
-        colorMap notNil ifTrue:[
-            p := #palette
-        ] ifFalse:[
+	colorMap notNil ifTrue:[
+	    p := #palette
+	] ifFalse:[
 "/            'Image [warning]: no photometric - assume greyscale' infoPrintCR
-            p := #blackIs0
-        ]
+	    p := #blackIs0
+	]
     ].
 
     p == #blackIs0 ifTrue:[
-        maxPixel := (1 bitShift:self bitsPerPixel) - 1.
-        ^ Color gray:(pixelValue * (100 / maxPixel)).
+	maxPixel := (1 bitShift:self bitsPerPixel) - 1.
+	^ Color gray:(pixelValue * (100 / maxPixel)).
     ].
 
     p == #whiteIs0 ifTrue:[
-        maxPixel := (1 bitShift:self bitsPerPixel) - 1.
-        ^ Color gray:100 - (pixelValue * (100 / maxPixel)).
+	maxPixel := (1 bitShift:self bitsPerPixel) - 1.
+	^ Color gray:100 - (pixelValue * (100 / maxPixel)).
     ].
 
     p == #palette ifTrue:[
-        pixelValue >= colorMap size ifTrue:[
-            ^ Color black
-        ].
-        clr := colorMap at:(pixelValue + 1).
-        clr isNil ifTrue:[
-            ^ Color black.
-        ].
-        ^ clr.
+	pixelValue >= colorMap size ifTrue:[
+	    ^ Color black
+	].
+	clr := colorMap at:(pixelValue + 1).
+	clr isNil ifTrue:[
+	    ^ Color black.
+	].
+	^ clr.
     ].
 
     p == #rgb ifTrue:[
-        r := self redBitsOf:pixelValue.
-        g := self greenBitsOf:pixelValue.
-        b := self blueBitsOf:pixelValue.
-        "/ must scale to byte value...
-        r := r bitShift:(8 - (bitsPerSample at:1)).
-        g := g bitShift:(8 - (bitsPerSample at:2)).
-        b := b bitShift:(8 - (bitsPerSample at:3)).
-        ^ Color redByte:r greenByte:g blueByte:b
+	r := self redBitsOf:pixelValue.
+	g := self greenBitsOf:pixelValue.
+	b := self blueBitsOf:pixelValue.
+	"/ must scale to byte value...
+	r := r bitShift:(8 - (bitsPerSample at:1)).
+	g := g bitShift:(8 - (bitsPerSample at:2)).
+	b := b bitShift:(8 - (bitsPerSample at:3)).
+	^ Color redByte:r greenByte:g blueByte:b
     ].
 
     p == #cmyk ifTrue:[
-        c := self cyanComponentOfCMYK:pixelValue.
-        m := self magentaComponentOfCMYK:pixelValue.
-        y := self yellowComponentOfCMYK:pixelValue.
-        k := self blackComponentOfCMYK:pixelValue.
-        ^ Color cyan:c magenta:m yellow:y black:k.
+	c := self cyanComponentOfCMYK:pixelValue.
+	m := self magentaComponentOfCMYK:pixelValue.
+	y := self yellowComponentOfCMYK:pixelValue.
+	k := self blackComponentOfCMYK:pixelValue.
+	^ Color cyan:c magenta:m yellow:y black:k.
     ].
 
     p == #cmy ifTrue:[
-        c := self cyanComponentOfCMY:pixelValue.
-        m := self magentaComponentOfCMY:pixelValue.
-        y := self yellowComponentOfCMY:pixelValue.
-        ^ Color cyan:c magenta:m yellow:y.
+	c := self cyanComponentOfCMY:pixelValue.
+	m := self magentaComponentOfCMY:pixelValue.
+	y := self yellowComponentOfCMY:pixelValue.
+	^ Color cyan:c magenta:m yellow:y.
     ].
 
     self error:'invalid (unsupported) photometric'
@@ -11748,8 +11748,8 @@
     |greenBits|
 
     samplesPerPixel >= 3 ifTrue:[
-        greenBits := bitsPerSample at:3.
-        ^ greenBits negated
+	greenBits := bitsPerSample at:3.
+	^ greenBits negated
     ].
 
     self subclassResponsibility
@@ -11846,7 +11846,7 @@
 
 realColorMap
     "return a collection usable as a real colormap of the image.
-     For palette images, this is the internal colormap; 
+     For palette images, this is the internal colormap;
      for other photometrics (which do not have a real colormap), synthesize one.
      This is different from #colorMap, which returns nil for non palette images."
 
@@ -11900,10 +11900,10 @@
 
     set := IdentitySet new.
     self valuesFromX:0 y:0 toX:(self width-1) y:(self height-1) do:[:x :y :pixel |
-        pixel ~~ last ifTrue:[
-            set add:pixel.
-            last := pixel.
-        ]
+	pixel ~~ last ifTrue:[
+	    set add:pixel.
+	    last := pixel.
+	]
     ].
     ^ set
 
@@ -11960,7 +11960,7 @@
 
 	s := (1 bitShift:redBits) - 1.
 
-	^ 100.0 / s * 
+	^ 100.0 / s *
 	  ((pixel bitShift:(greenBits + blueBits) negated)
 	   bitAnd:(1 bitShift:redBits)-1)
     ].
@@ -12012,61 +12012,61 @@
 
     p := photometric.
     p isNil ifTrue:[
-        colorMap notNil ifTrue:[
-            p := #palette
-        ] ifFalse:[
+	colorMap notNil ifTrue:[
+	    p := #palette
+	] ifFalse:[
 "/            'Image [warning]: no photometric - assume greyscale' infoPrintCR
-            p := #blackIs0
-        ]
+	    p := #blackIs0
+	]
     ].
 
     p == #blackIs0 ifTrue:[
-        maxPixel := (1 bitShift:self bitsPerPixel) - 1.
-        b := pixelValue * 255 // maxPixel.
-        ^ (((b bitShift:8) bitOr:b) bitShift:8) bitOr:b
+	maxPixel := (1 bitShift:self bitsPerPixel) - 1.
+	b := pixelValue * 255 // maxPixel.
+	^ (((b bitShift:8) bitOr:b) bitShift:8) bitOr:b
     ].
 
     p == #whiteIs0 ifTrue:[
-        maxPixel := (1 bitShift:self bitsPerPixel) - 1.
-        b := 255 - (pixelValue * 255 // maxPixel).
-        ^ (((b bitShift:8) bitOr:b) bitShift:8) bitOr:b
+	maxPixel := (1 bitShift:self bitsPerPixel) - 1.
+	b := 255 - (pixelValue * 255 // maxPixel).
+	^ (((b bitShift:8) bitOr:b) bitShift:8) bitOr:b
     ].
 
     p == #palette ifTrue:[
-        pixelValue >= colorMap size ifTrue:[
-            ^ 0 "/ black
-        ].
-        clr := colorMap at:(pixelValue + 1).
-        clr isNil ifTrue:[
-            ^ 0 "/ black
-        ].
-        ^ clr rgbValue.
+	pixelValue >= colorMap size ifTrue:[
+	    ^ 0 "/ black
+	].
+	clr := colorMap at:(pixelValue + 1).
+	clr isNil ifTrue:[
+	    ^ 0 "/ black
+	].
+	^ clr rgbValue.
     ].
 
     p == #rgb ifTrue:[
-        r := self redBitsOf:pixelValue.
-        g := self greenBitsOf:pixelValue.
-        b := self blueBitsOf:pixelValue.
-        "/ must scale to byte value...
-        r := r bitShift:(8 - (bitsPerSample at:1)).
-        g := g bitShift:(8 - (bitsPerSample at:2)).
-        b := b bitShift:(8 - (bitsPerSample at:3)).
-        ^ (((r bitShift:8) bitOr:g) bitShift:8) bitOr:b
+	r := self redBitsOf:pixelValue.
+	g := self greenBitsOf:pixelValue.
+	b := self blueBitsOf:pixelValue.
+	"/ must scale to byte value...
+	r := r bitShift:(8 - (bitsPerSample at:1)).
+	g := g bitShift:(8 - (bitsPerSample at:2)).
+	b := b bitShift:(8 - (bitsPerSample at:3)).
+	^ (((r bitShift:8) bitOr:g) bitShift:8) bitOr:b
     ].
 
     p == #cmyk ifTrue:[
-        c := self cyanComponentOfCMYK:pixelValue.
-        m := self magentaComponentOfCMYK:pixelValue.
-        y := self yellowComponentOfCMYK:pixelValue.
-        k := self blackComponentOfCMYK:pixelValue.
-        ^ (Color cyan:c magenta:m yellow:y black:k) rgbValue.
+	c := self cyanComponentOfCMYK:pixelValue.
+	m := self magentaComponentOfCMYK:pixelValue.
+	y := self yellowComponentOfCMYK:pixelValue.
+	k := self blackComponentOfCMYK:pixelValue.
+	^ (Color cyan:c magenta:m yellow:y black:k) rgbValue.
     ].
 
     p == #cmy ifTrue:[
-        c := self cyanComponentOfCMY:pixelValue.
-        m := self magentaComponentOfCMY:pixelValue.
-        y := self yellowComponentOfCMY:pixelValue.
-        ^ (Color cyan:c magenta:m yellow:y) rgbValue.
+	c := self cyanComponentOfCMY:pixelValue.
+	m := self magentaComponentOfCMY:pixelValue.
+	y := self yellowComponentOfCMY:pixelValue.
+	^ (Color cyan:c magenta:m yellow:y) rgbValue.
     ].
 
     self error:'invalid (unsupported) photometric'
@@ -12081,7 +12081,7 @@
 
     colors := self usedColorsMax:4096.
     colors isNil ifTrue:[
-        self error:'too many colors in image'.
+	self error:'too many colors in image'.
     ].
     ^ colors
 
@@ -12103,39 +12103,39 @@
     |usedValues max colors|
 
     photometric == #rgb ifTrue:[
-        usedValues := IdentitySet new.
-        self valuesFromX:0 y:0 toX:(width-1) y:(height-1)
-          do:[:x :y :pixel |
-            usedValues add:pixel.
-            usedValues size > nMax ifTrue:[
-                "/ too many to be returned here (think of the mass of
-                "/ data to be returned by a 24bit image ... ;-)
-                ^ nil
-            ]
-        ].
-        "/ code below is slightly faster ...
-        "/ colors := usedValues collect:[:pixel | self colorFromValue:pixel].
-        colors := usedValues collect:[:pixel | |r g b|
-                                        r := self redBitsOf:pixel.
-                                        g := self greenBitsOf:pixel.
-                                        b := self blueBitsOf:pixel.
-                                        "/ must scale to byte value...
-                                        r := r bitShift:(8 - (bitsPerSample at:1)).
-                                        g := g bitShift:(8 - (bitsPerSample at:2)).
-                                        b := b bitShift:(8 - (bitsPerSample at:3)).
-                                        Color redByte:r greenByte:g blueByte:b
-                                     ].
-        ^ colors.                
+	usedValues := IdentitySet new.
+	self valuesFromX:0 y:0 toX:(width-1) y:(height-1)
+	  do:[:x :y :pixel |
+	    usedValues add:pixel.
+	    usedValues size > nMax ifTrue:[
+		"/ too many to be returned here (think of the mass of
+		"/ data to be returned by a 24bit image ... ;-)
+		^ nil
+	    ]
+	].
+	"/ code below is slightly faster ...
+	"/ colors := usedValues collect:[:pixel | self colorFromValue:pixel].
+	colors := usedValues collect:[:pixel | |r g b|
+					r := self redBitsOf:pixel.
+					g := self greenBitsOf:pixel.
+					b := self blueBitsOf:pixel.
+					"/ must scale to byte value...
+					r := r bitShift:(8 - (bitsPerSample at:1)).
+					g := g bitShift:(8 - (bitsPerSample at:2)).
+					b := b bitShift:(8 - (bitsPerSample at:3)).
+					Color redByte:r greenByte:g blueByte:b
+				     ].
+	^ colors.
     ].
 
     usedValues := self usedValues asArray.
     photometric == #palette ifTrue:[
-        colors := usedValues collect:[:val | (colorMap at:val+1 ifAbsent:[Color black])].
+	colors := usedValues collect:[:val | (colorMap at:val+1 ifAbsent:[Color black])].
     ] ifFalse:[
-        "/ (photometric == #blackIs0 or:[photometric == #whiteIs0])
-
-        max := (1 bitShift:self depth) - 1.
-        colors :=  usedValues collect:[:val | (Color gray:(100 * val / max ))].
+	"/ (photometric == #blackIs0 or:[photometric == #whiteIs0])
+
+	max := (1 bitShift:self depth) - 1.
+	colors :=  usedValues collect:[:val | (Color gray:(100 * val / max ))].
     ].
     ^ colors asSet
 
@@ -12197,7 +12197,7 @@
 	    redBits := bitsPerSample at:1.
 	    greenBits := bitsPerSample at:2.
 	    blueBits := bitsPerSample at:3.
-        
+
 	    "/ map r/g/b to 0..255
 	    r := (color red / 100.0 * ((1 bitShift:redBits)-1)) rounded.
 	    g := (color green / 100.0 * ((1 bitShift:greenBits)-1)) rounded.
@@ -12224,7 +12224,7 @@
 	samplesPerPixel >= 3 ifTrue:[
 	    numGreenBits := bitsPerSample at:2.
 	    numBlueBits := bitsPerSample at:3.
-        
+
 	    pixel := (((redBits bitShift:numGreenBits) + greenBits) bitShift:numBlueBits) + blueBits.
 	    ^ pixel
 	]
@@ -12283,7 +12283,7 @@
 !Image methodsFor:'saving on file'!
 
 saveOn:aFileName
-    "save the image in aFileName. The suffix of the filename controls the format. 
+    "save the image in aFileName. The suffix of the filename controls the format.
      Currently, not all formats may be supported
      (see ImageReader subclasses implementing save:onFile:).
      May raise a signal, if the image cannot be written by the reader."
@@ -12322,7 +12322,7 @@
 !
 
 saveOn:aFileName using:readerClass
-    "save the receiver using the representation class 
+    "save the receiver using the representation class
      (which is usually a concrete subclasses of ImageReader).
      May raise a signal, if the image cannot be written by the reader."
 
@@ -12380,19 +12380,19 @@
      is returned. This is a common helper for form-to-image conversion,
      and to read hardcopy images from the screen."
 
-    | visType 
+    | visType
      x        "{ Class: SmallInteger }"
      y        "{ Class: SmallInteger }"
      w        "{ Class: SmallInteger }"
      h        "{ Class: SmallInteger }"
-     dstIndex "{ Class: SmallInteger }" 
-     srcIndex "{ Class: SmallInteger }" 
+     dstIndex "{ Class: SmallInteger }"
+     srcIndex "{ Class: SmallInteger }"
      srcRow   "{ Class: SmallInteger }"
      dstRow   "{ Class: SmallInteger }"
-     inData tmpData usedPixels mapSize 
-     map bytesPerLine 
+     inData tmpData usedPixels mapSize
+     map bytesPerLine
      bitOrder spaceBitsPerPixel
-     info bitsPerPixelIn bytesPerLineIn 
+     info bitsPerPixelIn bytesPerLineIn
      bitsR "{ Class: SmallInteger }"
      bitsG "{ Class: SmallInteger }"
      bitsB "{ Class: SmallInteger }"
@@ -12409,7 +12409,7 @@
      g "{ Class: SmallInteger }"
      b "{ Class: SmallInteger }"
      word "{ Class: SmallInteger }"
-     lword 
+     lword
      device ddepth isMSB|
 
     depth := self depth.
@@ -12418,67 +12418,67 @@
     device := aDrawable graphicsDevice.
 
     (aDrawable isForm and:[aDrawable depth == 1]) ifTrue:[
-        "/ a monochrome bitmap ?
-        visType := #StaticGray.
-        ddepth := 1.
+	"/ a monochrome bitmap ?
+	visType := #StaticGray.
+	ddepth := 1.
     ] ifFalse:[
-        (aDrawable isForm) ifFalse:[
-            "
-             get some attributes of the display device
-            "
-            visType := device visualType.
-            ddepth := device depth.
-        ] ifTrue:[
-            ddepth := aDrawable depth.
-            visType := aDrawable photometric
-        ].
+	(aDrawable isForm) ifFalse:[
+	    "
+	     get some attributes of the display device
+	    "
+	    visType := device visualType.
+	    ddepth := device depth.
+	] ifTrue:[
+	    ddepth := aDrawable depth.
+	    visType := aDrawable photometric
+	].
     ].
 
     "/ kludge for 15bit XFree server
     ddepth == 15 ifTrue:[
-        ddepth := 16
+	ddepth := 16
     ].
 
     aDrawable isForm ifTrue:[
-        photometric := aDrawable photometric.
-        samplesPerPixel := ddepth == 24 ifTrue:3 ifFalse:1.
-        bitsPerSample := ddepth == 24 ifTrue:#[8 8 8 ] ifFalse:[ByteArray with:bitsPerPixel].
+	photometric := aDrawable photometric.
+	samplesPerPixel := ddepth == 24 ifTrue:3 ifFalse:1.
+	bitsPerSample := ddepth == 24 ifTrue:#[8 8 8 ] ifFalse:[ByteArray with:bitsPerPixel].
     ] ifFalse:[
-        (visType == #StaticGray) ifTrue:[
-            (device blackpixel == 0) ifTrue:[
-                photometric := #blackIs0
-            ] ifFalse:[
-                photometric := #whiteIs0
-            ].
-            samplesPerPixel := 1.
-            bitsPerPixel := ddepth.
-            bitsPerSample := ByteArray with:bitsPerPixel.
-        ] ifFalse:[
-            ((visType == #PseudoColor) or:[(visType == #StaticColor) or:[visType == #GrayScale]]) ifTrue:[
-                photometric := #palette.
-                samplesPerPixel := 1.
-                bitsPerPixel := ddepth.
-                bitsPerSample := ByteArray with:bitsPerPixel.
-            ] ifFalse:[
-                ((visType == #TrueColor) or:[visType == #DirectColor]) ifTrue:[
-                    photometric := #rgb.
-                    samplesPerPixel := 3.
+	(visType == #StaticGray) ifTrue:[
+	    (device blackpixel == 0) ifTrue:[
+		photometric := #blackIs0
+	    ] ifFalse:[
+		photometric := #whiteIs0
+	    ].
+	    samplesPerPixel := 1.
+	    bitsPerPixel := ddepth.
+	    bitsPerSample := ByteArray with:bitsPerPixel.
+	] ifFalse:[
+	    ((visType == #PseudoColor) or:[(visType == #StaticColor) or:[visType == #GrayScale]]) ifTrue:[
+		photometric := #palette.
+		samplesPerPixel := 1.
+		bitsPerPixel := ddepth.
+		bitsPerSample := ByteArray with:bitsPerPixel.
+	    ] ifFalse:[
+		((visType == #TrueColor) or:[visType == #DirectColor]) ifTrue:[
+		    photometric := #rgb.
+		    samplesPerPixel := 3.
     "/                bitsPerPixel := depth.
     "/                bitsPerSample := ByteArray with:device bitsRed
     "/                                       with:device bitsGreen
     "/                                       with:device bitsBlue
-                    bitsPerPixel := 24.
-                    bitsPerSample := #(8 8 8).
-                ] ifFalse:[
-                    self error:'screen visual not supported'.
-                    ^ nil
-                ]
-            ]
-        ].
-    ].
-
-    "
-     dont know yet, how the display pads; assume worst case, 
+		    bitsPerPixel := 24.
+		    bitsPerSample := #(8 8 8).
+		] ifFalse:[
+		    self error:'screen visual not supported'.
+		    ^ nil
+		]
+	    ]
+	].
+    ].
+
+    "
+     dont know yet, how the display pads; assume worst case,
      offering enough space for 32 bit padding
     "
     w := width := aRectangle width.
@@ -12492,13 +12492,13 @@
     "
     spaceBitsPerPixel := bitsPerPixel.
     (bitsPerPixel > 8) ifTrue:[
-        spaceBitsPerPixel := 16.
-        (bitsPerPixel > 16) ifTrue:[
-            spaceBitsPerPixel := 32.
-            (bitsPerPixel > 32) ifTrue:[
-                spaceBitsPerPixel := bitsPerPixel.
-            ]
-        ]
+	spaceBitsPerPixel := 16.
+	(bitsPerPixel > 16) ifTrue:[
+	    spaceBitsPerPixel := 32.
+	    (bitsPerPixel > 32) ifTrue:[
+		spaceBitsPerPixel := bitsPerPixel.
+	    ]
+	]
     ].
 
     bytesPerLine := (w * spaceBitsPerPixel + 31) // 32 * 4.
@@ -12509,9 +12509,9 @@
      get the pixels
     "
     aDrawable isForm ifTrue:[
-        info := device getBitsFromPixmapId:aDrawable id x:x y:y width:w height:h into:inData. 
+	info := device getBitsFromPixmapId:aDrawable id x:x y:y width:w height:h into:inData.
     ] ifFalse:[
-        info := device getBitsFromViewId:aDrawable id x:x y:y width:w height:h into:inData. 
+	info := device getBitsFromViewId:aDrawable id x:x y:y width:w height:h into:inData.
     ].
 
     bitsPerPixelIn := info at:#bitsPerPixel.
@@ -12524,15 +12524,15 @@
     "/ mhmh - thats not needed
 
     bitsPerPixelIn < 8 ifTrue:[
-        bitOrder := info at:#bitOrder.
-        bitOrder ~~ #msbFirst ifTrue:[
-            inData 
-                expandPixels:8 
-                width:(inData size)
-                height:1 
-                into:inData
-                mapping:(ImageReader reverseBits "TODO: reverseBitsForDepth:bitsPerPixelIn").
-        ].
+	bitOrder := info at:#bitOrder.
+	bitOrder ~~ #msbFirst ifTrue:[
+	    inData
+		expandPixels:8
+		width:(inData size)
+		height:1
+		into:inData
+		mapping:(ImageReader reverseBits "TODO: reverseBitsForDepth:bitsPerPixelIn").
+	].
     ].
 
     "
@@ -12546,110 +12546,110 @@
     maskG := info at:#greenMask ifAbsent:0.
     maskB := info at:#blueMask ifAbsent:0.
 
-    ((bytesPerLine ~~ bytesPerLineIn) 
+    ((bytesPerLine ~~ bytesPerLineIn)
     or:[bitsPerPixelIn ~~ bitsPerPixel]) ifTrue:[
-        tmpData := inData.
-        inData := ByteArray uninitializedNew:(bytesPerLine * height).
-
-        srcRow := 1.
-        dstRow := 1.
-
-        bitsPerPixelIn ~~ bitsPerPixel ifTrue:[
-            "/ for now, only 32 -> 24 is supported
-                
-            maskR == 0 ifTrue:[
-                bitsR := device bitsRed.
-                bitsG := device bitsGreen.
-                bitsB := device bitsBlue.
-                maskR := (1 bitShift:bitsR) - 1.
-                maskG := (1 bitShift:bitsG) - 1.
-                maskB := (1 bitShift:bitsB) - 1.
-                shR := device shiftRed negated.
-                shG := device shiftGreen negated.
-                shB := device shiftBlue negated.
-            ] ifFalse:[
-                shR := (maskR lowBit - 1) negated.
-                bitsR := maskR highBit - maskR lowBit + 1.
-                maskR := maskR bitShift:shR.
-                shG := (maskG lowBit - 1) negated.
-                bitsG := maskG highBit - maskG lowBit + 1.
-                maskG := maskG bitShift:shG.
-                shB := (maskB lowBit - 1) negated.
-                bitsB := maskB highBit - maskB lowBit + 1.
-                maskB := maskB bitShift:shB.
-            ].
-            shR2 := (8 - bitsR).
-            shG2 := (8 - bitsG).
-            shB2 := (8 - bitsB).
-
-            ((bitsPerPixelIn == 32) and:[bitsPerPixel == 24]) ifTrue:[
-                "/ 'reformatting 32->24...' printNL.
-                1 to:h do:[:hi |
-                    srcIndex := srcRow.
-                    dstIndex := dstRow.
-
-                    1 to:w do:[:wi |
-                        lword := tmpData doubleWordAt:srcIndex MSB:isMSB.
-                        r := (lword bitShift:shR) bitAnd:maskR.
-                        g := (lword bitShift:shG) bitAnd:maskG.
-                        b := (lword bitShift:shB) bitAnd:maskB.
-
-                        inData at:dstIndex   put:r.
-                        inData at:dstIndex+1 put:g.
-                        inData at:dstIndex+2 put:b.
-                        srcIndex := srcIndex + 4.
-                        dstIndex := dstIndex + 3.
-                    ].
-                    dstRow := dstRow + bytesPerLine.
-                    srcRow := srcRow + bytesPerLineIn
-                ]
-            ] ifFalse:[
-                ((bitsPerPixelIn == 16) and:[bitsPerPixel == 24]) ifTrue:[
-                    "/ 'reformatting 16->24...' printNL.
-                    1 to:h do:[:hi |
-                        srcIndex := srcRow.
-                        dstIndex := dstRow.
-
-                        1 to:w do:[:wi |
-                            word := tmpData wordAt:srcIndex MSB:isMSB.
-                            r := (word bitShift:shR) bitAnd:maskR.
-                            g := (word bitShift:shG) bitAnd:maskG.
-                            b := (word bitShift:shB) bitAnd:maskB.
-
-                            inData at:dstIndex   put:(r bitShift:shR2).
-                            inData at:dstIndex+1 put:(g bitShift:shG2).
-                            inData at:dstIndex+2 put:(b bitShift:shB2).
-
-                            srcIndex := srcIndex + 2.
-                            dstIndex := dstIndex + 3.
-                        ].
-                        dstRow := dstRow + bytesPerLine.
-                        srcRow := srcRow + bytesPerLineIn
-                    ]
-                ] ifFalse:[
-                    ('Image [warning]: unsupported depth combination: ' , bitsPerPixelIn printString , ' -> ' ,
-                                                        bitsPerPixel printString) errorPrintCR.
-                    self shouldImplement.
-                    ^ nil
-                ]
-            ].
-        ] ifFalse:[
-            "/
-            "/ repad in the buffer
-            "/
-            1 to:h do:[:hi |
-                inData replaceFrom:dstRow to:(dstRow + bytesPerLine - 1)
-                              with:tmpData startingAt:srcRow.
-                dstRow := dstRow + bytesPerLine.
-                srcRow := srcRow + bytesPerLineIn
-            ]
-        ]
+	tmpData := inData.
+	inData := ByteArray uninitializedNew:(bytesPerLine * height).
+
+	srcRow := 1.
+	dstRow := 1.
+
+	bitsPerPixelIn ~~ bitsPerPixel ifTrue:[
+	    "/ for now, only 32 -> 24 is supported
+
+	    maskR == 0 ifTrue:[
+		bitsR := device bitsRed.
+		bitsG := device bitsGreen.
+		bitsB := device bitsBlue.
+		maskR := (1 bitShift:bitsR) - 1.
+		maskG := (1 bitShift:bitsG) - 1.
+		maskB := (1 bitShift:bitsB) - 1.
+		shR := device shiftRed negated.
+		shG := device shiftGreen negated.
+		shB := device shiftBlue negated.
+	    ] ifFalse:[
+		shR := (maskR lowBit - 1) negated.
+		bitsR := maskR highBit - maskR lowBit + 1.
+		maskR := maskR bitShift:shR.
+		shG := (maskG lowBit - 1) negated.
+		bitsG := maskG highBit - maskG lowBit + 1.
+		maskG := maskG bitShift:shG.
+		shB := (maskB lowBit - 1) negated.
+		bitsB := maskB highBit - maskB lowBit + 1.
+		maskB := maskB bitShift:shB.
+	    ].
+	    shR2 := (8 - bitsR).
+	    shG2 := (8 - bitsG).
+	    shB2 := (8 - bitsB).
+
+	    ((bitsPerPixelIn == 32) and:[bitsPerPixel == 24]) ifTrue:[
+		"/ 'reformatting 32->24...' printNL.
+		1 to:h do:[:hi |
+		    srcIndex := srcRow.
+		    dstIndex := dstRow.
+
+		    1 to:w do:[:wi |
+			lword := tmpData doubleWordAt:srcIndex MSB:isMSB.
+			r := (lword bitShift:shR) bitAnd:maskR.
+			g := (lword bitShift:shG) bitAnd:maskG.
+			b := (lword bitShift:shB) bitAnd:maskB.
+
+			inData at:dstIndex   put:r.
+			inData at:dstIndex+1 put:g.
+			inData at:dstIndex+2 put:b.
+			srcIndex := srcIndex + 4.
+			dstIndex := dstIndex + 3.
+		    ].
+		    dstRow := dstRow + bytesPerLine.
+		    srcRow := srcRow + bytesPerLineIn
+		]
+	    ] ifFalse:[
+		((bitsPerPixelIn == 16) and:[bitsPerPixel == 24]) ifTrue:[
+		    "/ 'reformatting 16->24...' printNL.
+		    1 to:h do:[:hi |
+			srcIndex := srcRow.
+			dstIndex := dstRow.
+
+			1 to:w do:[:wi |
+			    word := tmpData wordAt:srcIndex MSB:isMSB.
+			    r := (word bitShift:shR) bitAnd:maskR.
+			    g := (word bitShift:shG) bitAnd:maskG.
+			    b := (word bitShift:shB) bitAnd:maskB.
+
+			    inData at:dstIndex   put:(r bitShift:shR2).
+			    inData at:dstIndex+1 put:(g bitShift:shG2).
+			    inData at:dstIndex+2 put:(b bitShift:shB2).
+
+			    srcIndex := srcIndex + 2.
+			    dstIndex := dstIndex + 3.
+			].
+			dstRow := dstRow + bytesPerLine.
+			srcRow := srcRow + bytesPerLineIn
+		    ]
+		] ifFalse:[
+		    ('Image [warning]: unsupported depth combination: ' , bitsPerPixelIn printString , ' -> ' ,
+							bitsPerPixel printString) errorPrintCR.
+		    self shouldImplement.
+		    ^ nil
+		]
+	    ].
+	] ifFalse:[
+	    "/
+	    "/ repad in the buffer
+	    "/
+	    1 to:h do:[:hi |
+		inData replaceFrom:dstRow to:(dstRow + bytesPerLine - 1)
+			      with:tmpData startingAt:srcRow.
+		dstRow := dstRow + bytesPerLine.
+		srcRow := srcRow + bytesPerLineIn
+	    ]
+	]
     ] ifFalse:[
-        (bytesPerLine * height) ~~ inData size ifTrue:[
-            tmpData := inData.
-            inData := ByteArray uninitializedNew:(bytesPerLine * height).
-            inData replaceFrom:1 to:bytesPerLine * height with:tmpData startingAt:1
-        ]
+	(bytesPerLine * height) ~~ inData size ifTrue:[
+	    tmpData := inData.
+	    inData := ByteArray uninitializedNew:(bytesPerLine * height).
+	    inData replaceFrom:1 to:bytesPerLine * height with:tmpData startingAt:1
+	]
     ].
     self bits:inData.
 
@@ -12657,24 +12657,24 @@
     "/  if not #palette we are done, the pixel values are the rgb/grey values
     "/
     photometric == #palette ifTrue:[
-        "/
-        "/ what we have now are the color numbers - still need the r/g/b values.
-        "/ find out, which colors are in the picture
-        "/
-        usedPixels := inData usedValues.
-        mapSize := usedPixels max + 1.
-
-        "get the palette"
-        map := Array new:mapSize.
-        usedPixels do:[:colorIndex |
-            |i|
-
-            i := colorIndex + 1.
-            device getRGBFrom:colorIndex into:[:r :g :b |
-                map at:i put:(Color red:r green:g blue:b)
-            ]
-        ].
-        self setColorMap:map.
+	"/
+	"/ what we have now are the color numbers - still need the r/g/b values.
+	"/ find out, which colors are in the picture
+	"/
+	usedPixels := inData usedValues.
+	mapSize := usedPixels max + 1.
+
+	"get the palette"
+	map := Array new:mapSize.
+	usedPixels do:[:colorIndex |
+	    |i|
+
+	    i := colorIndex + 1.
+	    device getRGBFrom:colorIndex into:[:r :g :b |
+		map at:i put:(Color red:r green:g blue:b)
+	    ]
+	].
+	self setColorMap:map.
     ].
 
     "Modified: / 9.1.1998 / 21:32:36 / stefan"
@@ -12687,8 +12687,8 @@
 	      it may not work from within a buttonMotion
 	      (use #fromScreen:on:grab: with a false grabArg then)."
 
-    ^ self 
-	fromScreen:aRectangle 
+    ^ self
+	fromScreen:aRectangle
 	on:Screen current
 	grab:true
 
@@ -12697,8 +12697,8 @@
 
 fromScreen:aRectangle on:aDevice
     "read an image from aDevices display screen.
-     Since I have no other displays, only the MonoChrome, StaticGrey 
-     and PseudoColor cases have been tested ... 
+     Since I have no other displays, only the MonoChrome, StaticGrey
+     and PseudoColor cases have been tested ...
      (especially True- and DirectColor may be wrong).
      Late note: 24bit rgb now also works.
      WARNING: this temporarily grabs the display
@@ -12706,8 +12706,8 @@
 	      (use #fromScreen:on:grab: with a false grabArg then)."
 
     ^ self
-	fromScreen:aRectangle 
-	on:aDevice 
+	fromScreen:aRectangle
+	on:aDevice
 	grab:true
 
     "
@@ -12723,13 +12723,13 @@
      If the doGrab argument is true, the display
      is grabbed (i.e. blocked for others) and a camera cursor is
      shown while the readout is done.
-     Since I have no other displays, only the MonoChrome, StaticGrey 
-     and PseudoColor cases have been tested ... 
+     Since I have no other displays, only the MonoChrome, StaticGrey
+     and PseudoColor cases have been tested ...
      (especially True- and DirectColor may be wrong).
      Late note: 24bit rgb now also works.
      WARNING: with doGrab true, this temporarily grabs the display
-              and it may not work from within a buttonMotion
-              (use with a false grabArg then)."
+	      and it may not work from within a buttonMotion
+	      (use with a false grabArg then)."
 
     |curs rootView prevGrab|
 
@@ -12747,22 +12747,22 @@
     "
     rootView := aDevice rootView.
     doGrab ifTrue:[
-        prevGrab := aDevice activePointerGrab.
-        aDevice grabPointerInView:rootView withCursor:curs. 
+	prevGrab := aDevice activePointerGrab.
+	aDevice grabPointerInView:rootView withCursor:curs.
     ].
 
     "
      get the pixels
     "
     [
-        self from:rootView in:aRectangle.
+	self from:rootView in:aRectangle.
     ] ensure:[
-        doGrab ifTrue:[
-            aDevice ungrabPointer.
-            prevGrab notNil ifTrue:[
-                 aDevice grabPointerInView:prevGrab.
-            ]
-        ]
+	doGrab ifTrue:[
+	    aDevice ungrabPointer.
+	    prevGrab notNil ifTrue:[
+		 aDevice grabPointerInView:prevGrab.
+	    ]
+	]
     ]
 
     "
@@ -12786,49 +12786,49 @@
 
     "/ kludge for 15bit XFree server
     depth == 15 ifTrue:[
-        depth := 16
+	depth := 16
     ].
 
     (visType == #StaticGray) ifTrue:[
-        (aDevice blackpixel == 0) ifTrue:[
-            photometric := #blackIs0
-        ] ifFalse:[
-            photometric := #whiteIs0
-        ].
-        samplesPerPixel := 1.
-        bitsPerPixel := depth.
-        bitsPerSample := ByteArray with:bitsPerPixel.
-        "
-         were done, the pixel values are the grey values
-        "
-        ^ self
+	(aDevice blackpixel == 0) ifTrue:[
+	    photometric := #blackIs0
+	] ifFalse:[
+	    photometric := #whiteIs0
+	].
+	samplesPerPixel := 1.
+	bitsPerPixel := depth.
+	bitsPerSample := ByteArray with:bitsPerPixel.
+	"
+	 were done, the pixel values are the grey values
+	"
+	^ self
     ].
 
     ((visType == #TrueColor) or:[visType == #DirectColor]) ifTrue:[
-        photometric := #rgb.
-        samplesPerPixel := 3.
-
-        "/ for now - only support 24bit TrueColor
-        depth ~~ 24 ifTrue:[
-            'IMAGE: unsupported display depth' errorPrintCR.
-        ].
+	photometric := #rgb.
+	samplesPerPixel := 3.
+
+	"/ for now - only support 24bit TrueColor
+	depth ~~ 24 ifTrue:[
+	    'IMAGE: unsupported display depth' errorPrintCR.
+	].
 "/                bitsPerPixel := depth.
 "/                bitsPerSample := ByteArray with:aDevice bitsRed
 "/                                       with:aDevice bitsGreen
 "/                                       with:aDevice bitsBlue
-        bitsPerPixel := 24.
-        bitsPerSample := #[8 8 8].
-        "
-         were done, the pixel values are the rgb values
-        "
-        ^ self
-    ].
-
-    ((visType ~~ #PseudoColor) 
-    and:[(visType ~~ #StaticColor) 
+	bitsPerPixel := 24.
+	bitsPerSample := #[8 8 8].
+	"
+	 were done, the pixel values are the rgb values
+	"
+	^ self
+    ].
+
+    ((visType ~~ #PseudoColor)
+    and:[(visType ~~ #StaticColor)
     and:[visType ~~ #GrayScale]]) ifTrue:[
-        self error:'screen visual not supported'.
-        ^ nil
+	self error:'screen visual not supported'.
+	^ nil
     ].
 
     photometric := #palette.
@@ -12847,7 +12847,7 @@
 !Image class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/Image.st,v 1.386 2006-09-18 19:49:19 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/Image.st,v 1.387 2007-01-24 13:40:55 cg Exp $'
 ! !
 
 Image initialize!