--- a/Depth24Image.st Wed Sep 07 17:17:27 2016 +0200
+++ b/Depth24Image.st Wed Sep 07 17:21:52 2016 +0200
@@ -79,15 +79,11 @@
Pixels start at x=0 , y=0 for upper left pixel,
end at x = width-1, y=height-1 for lower right pixel"
- |index "{ Class: SmallInteger }"
- rVal gVal bVal|
-
- index := 1 + (((width * y) + x) * 3).
+ |rgbVal|
+
photometric == #rgb ifTrue:[
- rVal := bytes at:(index).
- gVal := bytes at:(index + 1).
- bVal := bytes at:(index + 2).
- ^ Color redByte:rVal greenByte:gVal blueByte:bVal
+ rgbVal := self pixelAtX:x y:y.
+ ^ Color rgbValue:rgbVal.
].
"/ the inherited method should handle all cases.
^ super colorAtX:x y:y.
@@ -98,14 +94,8 @@
Pixels start at x=0 , y=0 for upper left pixel, end at
x = width-1, y=height-1 for lower right pixel."
- |index "{ Class: SmallInteger }"|
-
photometric ~~ #rgb ifTrue:[^ super colorAtX:x y:y put:aColor].
-
- index := 1 + (((width * y) + x) * 3).
- bytes at:(index) put:(aColor redByte).
- bytes at:(index + 1) put:(aColor greenByte).
- bytes at:(index + 2) put:(aColor blueByte).
+ self pixelAtX:x y:y put:aColor rgbValue.
"Created: 24.4.1997 / 17:32:59 / cg"
!