--- a/Depth4Image.st Thu Apr 24 17:53:42 1997 +0200
+++ b/Depth4Image.st Thu Apr 24 17:55:58 1997 +0200
@@ -60,9 +60,9 @@
"Modified: 20.4.1996 / 23:40:18 / cg"
! !
-!Depth4Image methodsFor:'accessing'!
+!Depth4Image methodsFor:'accessing - pixels'!
-atX:x y:y
+colorAtX:x y:y
"retrieve a pixel at x/y; return a color.
Pixels start at x=0 , y=0 for upper left pixel, end at
x = width-1, y=height-1 for lower right pixel"
@@ -92,9 +92,30 @@
^ colorMap at:(value + 1)
"Modified: 8.6.1996 / 10:52:43 / cg"
+ "Created: 24.4.1997 / 17:33:51 / cg"
!
-atX:x y:y putValue:aPixelValue
+pixelAtX:x y:y
+ "retrieve a pixel at x/y; return a pixelValue.
+ Pixels start at x=0 , y=0 for upper left pixel, end at
+ x = width-1, y=height-1 for lower right pixel"
+
+ |lineIndex "{ Class: SmallInteger }"
+ byte "{ Class: SmallInteger }" |
+
+ lineIndex := (self bytesPerRow * y) + 1.
+
+ "left pixel in high bits"
+ byte := bytes at:(lineIndex + (x // 2)).
+ x even ifTrue:[
+ ^ (byte bitShift:-4) bitAnd:16rF.
+ ].
+ ^ byte bitAnd:16rF.
+
+ "Created: 24.4.1997 / 16:06:43 / cg"
+!
+
+pixelAtX:x y:y put:aPixelValue
"set the pixel at x/y to aPixelValue.
Pixels start at x=0 , y=0 for upper left pixel, end at
x = width-1, y=height-1 for lower right pixel"
@@ -109,29 +130,13 @@
index := lineIndex + (x // 2).
byte := bytes at:index.
x even ifTrue:[
- byte := (byte bitAnd:16rF) bitOr:(aPixelValue bitShift:4)
+ byte := (byte bitAnd:16rF) bitOr:(aPixelValue bitShift:4)
] ifFalse:[
- byte := (byte bitAnd:16rF0) bitOr:aPixelValue
+ byte := (byte bitAnd:16rF0) bitOr:aPixelValue
].
bytes at:index put:byte
-!
-valueAtX:x y:y
- "retrieve a pixel at x/y; return a pixelValue.
- Pixels start at x=0 , y=0 for upper left pixel, end at
- x = width-1, y=height-1 for lower right pixel"
-
- |lineIndex "{ Class: SmallInteger }"
- byte "{ Class: SmallInteger }" |
-
- lineIndex := (self bytesPerRow * y) + 1.
-
- "left pixel in high bits"
- byte := bytes at:(lineIndex + (x // 2)).
- x even ifTrue:[
- ^ (byte bitShift:-4) bitAnd:16rF.
- ].
- ^ byte bitAnd:16rF.
+ "Created: 24.4.1997 / 17:06:39 / cg"
! !
!Depth4Image methodsFor:'dither helpers'!
@@ -632,5 +637,5 @@
!Depth4Image class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libview/Depth4Image.st,v 1.22 1996-06-10 13:22:56 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libview/Depth4Image.st,v 1.23 1997-04-24 15:55:58 cg Exp $'
! !