Depth4Image.st
changeset 6897 7af3b0859ba5
parent 6827 68d52c024d4d
child 7189 4cfe895d6532
--- a/Depth4Image.st	Sat Jul 25 17:06:31 2015 +0200
+++ b/Depth4Image.st	Sat Jul 25 17:06:51 2015 +0200
@@ -1,5 +1,3 @@
-"{ Encoding: utf8 }"
-
 "
  COPYRIGHT (c) 1993 by Claus Gittinger
 	      All Rights Reserved
@@ -1026,20 +1024,25 @@
 usedValues
     "return a collection of color values used in the receiver."
 
-    |useFlags usedValues|
+    |useFlags usedValues 
+     h "{ Class: SmallInteger }"
+     w "{ Class: SmallInteger }" |
 
     useFlags := Array new:16 withAll:false.
-    width even ifFalse:[
-	0 to:self height - 1 do:[:y |
-	    self valuesAtY:y from:0 to:self width - 1 do:[:x :pixel |
-		useFlags at:(pixel + 1) put:true
-	    ]
-	].
+    w := width.
+    h := height.
+
+    w even ifFalse:[
+        0 to:h-1 do:[:y |
+            self valuesAtY:y from:0 to:w-1 do:[:x :pixel |
+                useFlags at:(pixel + 1) put:true
+            ]
+        ].
     ] ifTrue:[
-	self bits usedValues do:[:byte |
-	    useFlags at:(byte bitShift:-4)+1 put:true.
-	    useFlags at:(byte bitAnd:2r1111)+1 put:true.
-	].
+        self bits usedValues do:[:byte |
+            useFlags at:(byte bitShift:-4)+1 put:true.
+            useFlags at:(byte bitAnd:2r1111)+1 put:true.
+        ].
     ].
     ^ (0 to:15) select:[:i | useFlags at:(i+1)].
 
@@ -1053,10 +1056,10 @@
 !Depth4Image class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/Depth4Image.st,v 1.54 2015-03-18 18:12:22 cg Exp $'
+    ^ '$Header$'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libview/Depth4Image.st,v 1.54 2015-03-18 18:12:22 cg Exp $'
+    ^ '$Header$'
 ! !