Depth1Image.st
changeset 427 746424fba14f
parent 337 15deeed5ac81
child 579 e381761190c4
--- a/Depth1Image.st	Mon Feb 19 23:59:33 1996 +0100
+++ b/Depth1Image.st	Tue Feb 20 16:28:01 1996 +0100
@@ -11,10 +11,10 @@
 "
 
 Image subclass:#Depth1Image
-	 instanceVariableNames:''
-	 classVariableNames:''
-	 poolDictionaries:''
-	 category:'Graphics-Images'
+	instanceVariableNames:''
+	classVariableNames:''
+	poolDictionaries:''
+	category:'Graphics-Images'
 !
 
 !Depth1Image class methodsFor:'documentation'!
@@ -250,6 +250,24 @@
 
 !Depth1Image methodsFor:'converting palette images'!
 
+paletteImageAsMonoFormOn:aDevice
+    "convert a palette image to a device form"
+
+    |f|
+
+    f := Form width:width height:height fromArray:bytes on:aDevice.
+    f notNil ifTrue:[
+        (colorMap at:1) brightness < (colorMap at:2) brightness ifTrue:[
+            f function:#xor.
+            f paint:(Color colorId:1).
+            f fillRectangleX:0 y:0 width:width height:height
+        ]
+    ].
+    ^ f
+
+    "Created: 20.2.1996 / 16:26:15 / cg"
+!
+
 paletteImageAsPseudoFormOn:aDevice
     "return a pseudo-deviceForm from the palette image."
 
@@ -564,5 +582,5 @@
 !Depth1Image class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/Depth1Image.st,v 1.17 1995-12-27 16:19:59 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/Depth1Image.st,v 1.18 1996-02-20 15:28:01 cg Exp $'
 ! !