#FEATURE by exept
authorClaus Gittinger <cg@exept.de>
Thu, 11 Jul 2019 16:47:03 +0200
changeset 8726 b90ede922f20
parent 8725 9d6b72144c9c
child 8727 8af37d3caf22
#FEATURE by exept class: Image added: #= #hash
Image.st
--- a/Image.st	Wed Jul 10 18:32:37 2019 +0200
+++ b/Image.st	Thu Jul 11 16:47:03 2019 +0200
@@ -4153,6 +4153,35 @@
 ! !
 
 
+!Image methodsFor:'comparing'!
+
+= anImage
+    anImage species = self species ifFalse:[^ false].
+    anImage depth = self depth ifFalse:[^ false].
+    anImage width == self width ifFalse:[^ false].
+    anImage height == self height ifFalse:[^ false].
+    anImage bitsPerPixel == self bitsPerPixel ifFalse:[^ false].
+    anImage colorMap = self colorMap ifFalse:[^ false].
+    anImage bitsPerSample = self bitsPerSample ifFalse:[^ false].
+    anImage photometric = self photometric ifFalse:[^ false].
+    anImage mask = self mask ifFalse:[^ false].
+    anImage pixelFunction == self pixelFunction ifFalse:[^ false].
+    anImage bits = self bits ifFalse:[^ false].
+    ^ true
+!
+
+hash
+    ^ (((depth hash
+    bitXor:width hash)
+    bitXor:height hash)
+    bitXor:photometric hash)
+    bitXor:((bytes ? #[0]) first hash)
+
+    "
+     Image fromScreen hash
+    "
+! !
+
 !Image methodsFor:'conversion helpers'!
 
 rgbColormapFor:aDevice