--- a/Image.st Thu Oct 23 16:44:28 1997 +0200
+++ b/Image.st Thu Oct 23 16:45:46 1997 +0200
@@ -10,7 +10,7 @@
hereby transferred.
"
-'From Smalltalk/X, Version:3.2.1 on 19-oct-1997 at 5:20:30 pm' !
+'From Smalltalk/X, Version:3.2.1 on 23-oct-1997 at 12:53:18 am' !
Object subclass:#Image
instanceVariableNames:'bytes width height bitsPerPixel depth colorMap maxPixelValue
@@ -3398,26 +3398,29 @@
|form|
((aDevice == device) and:[monoDeviceForm notNil]) ifTrue:[^ monoDeviceForm].
+ depth == 1 ifTrue:[
+ ((aDevice == device) and:[deviceForm notNil]) ifTrue:[^ deviceForm].
+ ].
form := self asMonochromeFormOn:aDevice dither:DitherAlgorithm.
(device isNil or:[aDevice == device]) ifTrue:[
- "remember this form in the receiver ..."
-
- form notNil ifTrue:[
- monoDeviceForm := form.
- device isNil ifTrue:[
- device := aDevice.
- Lobby register:self
- ] ifFalse:[
- Lobby registerChange:self
- ].
- "
- can save space, by not keeping the images data-bits
- twice (here and in the device form)
- "
- form forgetBits
- ]
+ "remember this form in the receiver ..."
+
+ form notNil ifTrue:[
+ monoDeviceForm := form.
+ device isNil ifTrue:[
+ device := aDevice.
+ Lobby register:self
+ ] ifFalse:[
+ Lobby registerChange:self
+ ].
+ "
+ can save space, by not keeping the images data-bits
+ twice (here and in the device form)
+ "
+ form forgetBits
+ ]
].
^ form
@@ -3429,7 +3432,7 @@
(i asMonochromeFormOn:Display) inspect.
"
- "Modified: 10.6.1996 / 17:39:30 / cg"
+ "Modified: 23.10.1997 / 00:44:59 / cg"
!
asMonochromeFormOn:aDevice dither:aDitherAlgorithm
@@ -10112,6 +10115,14 @@
^ bytesPerRow
!
+center
+ "for compatibility with GC protocol - return the centerPoint"
+
+ ^ (width // 2) @ (height // 2)
+
+ "Created: 22.10.1997 / 23:52:40 / cg"
+!
+
colorFromValue:pixelValue
"given a pixel value, return the corresponding color.
Pixel values start with 0."
@@ -10992,6 +11003,6 @@
!Image class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libview/Image.st,v 1.223 1997-10-21 18:21:17 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libview/Image.st,v 1.224 1997-10-23 14:45:46 cg Exp $'
! !
Image initialize!