Depth2Image.st
changeset 8118 44f2377b84af
parent 7818 290d8c548544
child 8140 cf317c6af373
--- a/Depth2Image.st	Tue Aug 29 15:39:45 2017 +0200
+++ b/Depth2Image.st	Tue Aug 29 15:39:46 2017 +0200
@@ -696,7 +696,15 @@
 !
 
 valuesAtY:y from:xLow to:xHigh do:aBlock
-    "perform aBlock for each pixelValue from x1 to x2 in row y.
+    "WARNING: this enumerates pixel values which need photometric interpretation
+     Do not confuse with #rgbValuesAtY:from:to:do:
+
+     Perform aBlock for each pixelValue from x1 to x2 in row y.
+
+     Notice the difference between rgbValue and pixelValue: rgbValues are always
+     the rgb bytes; pixelvalues depend on the photometric interpretation, and may be
+     indices into a colormap or be non-byte-sized rgb values.
+
      The block is passed the x coordinate and the pixelValue at each pixel.
      This method allows slighly faster processing of an
      image than using valueAtX:y:, since some processing can be
@@ -724,23 +732,24 @@
 
     byte := bytes at:srcIndex.
     x1 to:x2 do:[:x |
-	value := (byte bitShift:shift) bitAnd:3.
+        value := (byte bitShift:shift) bitAnd:3.
 
-	aBlock value:x value:value.
+        aBlock value:x value:value.
 
-	shift == 0 ifTrue:[
-	    shift := -6.
-	    srcIndex := srcIndex + 1.
-	    x < x2 ifTrue:[
-		byte := bytes at:srcIndex.
-	    ]
-	] ifFalse:[
-	    shift := shift + 2.
-	]
+        shift == 0 ifTrue:[
+            shift := -6.
+            srcIndex := srcIndex + 1.
+            x < x2 ifTrue:[
+                byte := bytes at:srcIndex.
+            ]
+        ] ifFalse:[
+            shift := shift + 2.
+        ]
     ].
 
-    "Created: 7.6.1996 / 19:09:42 / cg"
-    "Modified: 8.6.1996 / 13:36:28 / cg"
+    "Created: / 07-06-1996 / 19:09:42 / cg"
+    "Modified: / 08-06-1996 / 13:36:28 / cg"
+    "Modified (comment): / 29-08-2017 / 14:53:09 / cg"
 ! !
 
 !Depth2Image methodsFor:'magnification'!