class: Depth1Image
authorStefan Vogel <sv@exept.de>
Wed, 09 Apr 2014 10:23:34 +0200
changeset 6380 816c489b5e41
parent 6379 a8d53c1947f2
child 6381 d4b8689fbe90
class: Depth1Image changed: #anyImageAsFormOn:
Depth1Image.st
--- a/Depth1Image.st	Wed Apr 09 00:27:32 2014 +0200
+++ b/Depth1Image.st	Wed Apr 09 10:23:34 2014 +0200
@@ -587,7 +587,7 @@
 !Depth1Image methodsFor:'private'!
 
 anyImageAsFormOn:aDevice
-    "convert a monochrome image to a device form"
+    "convert a 1-bit (possibly monochrome) image to a device form"
 
     |f color0 color1|
 
@@ -595,25 +595,23 @@
 
     color0 := (self colorFromValue:0) exactOn:aDevice.
     color1 := (self colorFromValue:1) exactOn:aDevice.
-    (color0 notNil and:[(color0 isOnDevice:aDevice)
-     and:[color1 notNil and:[color1 isOnDevice:aDevice]]]) ifFalse:[
-	"could not allocate colors, do it the hard way ..."
-	^ self paletteImageAsFormOn:aDevice.
+    (color0 isNil or:[color1 isNil]) ifTrue:[
+        "could not allocate colors, do it the hard way ..."
+        ^ self paletteImageAsFormOn:aDevice.
     ].
 
     "all colors are available, this is easy now"
 
     f := Form width:width height:height fromArray:self bits onDevice:aDevice.
     f notNil ifTrue:[
-	f colorMap:(Array with:color0 with:color1).
-
-	"/ remember deviceForm
+        f colorMap:(Array with:color0 with:color1).
 
-	(device isNil or:[deviceForm isNil]) ifTrue:[
-	    device := aDevice.
-	    deviceForm := f.
-	    maskedPixelsAre0 := nil.
-	]
+        "/ remember deviceForm
+        (device isNil or:[deviceForm isNil]) ifTrue:[
+            device := aDevice.
+            deviceForm := f.
+            maskedPixelsAre0 := nil.
+        ]
     ].
     ^ f
 
@@ -774,10 +772,10 @@
 !Depth1Image class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/Depth1Image.st,v 1.59 2014-03-02 13:59:54 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/Depth1Image.st,v 1.60 2014-04-09 08:23:34 stefan Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libview/Depth1Image.st,v 1.59 2014-03-02 13:59:54 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/Depth1Image.st,v 1.60 2014-04-09 08:23:34 stefan Exp $'
 ! !