Depth8Image.st
changeset 6039 6883ca47d798
parent 6036 d1969789036e
child 6066 62426e8110ae
--- a/Depth8Image.st	Tue Apr 02 14:02:59 2013 +0200
+++ b/Depth8Image.st	Tue Apr 02 14:03:44 2013 +0200
@@ -298,7 +298,7 @@
 
     "sort by usage"
     usageCounts := bytes usageCounts.
-    usageCounts := usedColors collect:[:clr | usageCounts at:(clr + 1)] as:Array.
+    usageCounts := (usedColors collect:[:clr | usageCounts at:(clr + 1)]) asArray.
     usageCounts sort:[:a :b | a > b] with:usedColors.
 
     "allocate the colors (in order of usage count)"
@@ -373,11 +373,9 @@
         DitherAlgorithm == #floydSteinberg ifTrue:[
             dColors := imgMap collect:[:clr | clr isNil ifTrue:[clr]
                                                         ifFalse:[clr nearestOn:aDevice]].
-            dColors := dColors select:[:clr | clr notNil].
-            dColors := dColors collect:[:clr | clr exactOn:aDevice].
-            dColors := dColors select:[:clr | clr notNil] as:Set.
-            dColors addAll:((aDevice colorMap collect:[:c|c onDevice:aDevice])
-                            select:[:c | c colorId notNil]).
+            dColors := dColors select:[:clr | clr notNil] thenCollect:[:clr | clr exactOn:aDevice].
+            dColors := dColors asSet.
+            dColors addAll:(aDevice colorMap collect:[:c|c onDevice:aDevice] thenSelect:[:c | c colorId notNil]).
             ditherColors := aDevice availableDitherColors.
             ditherColors notNil ifTrue:[
                 dColors addAll:ditherColors.
@@ -2454,10 +2452,10 @@
 !Depth8Image class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/Depth8Image.st,v 1.118 2013-04-02 09:34:09 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/Depth8Image.st,v 1.119 2013-04-02 12:03:44 stefan Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libview/Depth8Image.st,v 1.118 2013-04-02 09:34:09 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/Depth8Image.st,v 1.119 2013-04-02 12:03:44 stefan Exp $'
 ! !