--- a/Depth1Image.st Tue Apr 29 21:20:22 2003 +0200
+++ b/Depth1Image.st Tue Apr 29 21:42:44 2003 +0200
@@ -643,26 +643,28 @@
^ nbytes
!
-colorFromValue:colorValue
+colorFromValue:pixelValue
"given a pixel value, return the corresponding color.
Pixel values start with 0."
photometric == #blackIs0 ifTrue:[
- (colorValue == 0) ifTrue:[
+ (pixelValue == 0) ifTrue:[
^ Color black
].
^ Color white
].
photometric == #whiteIs0 ifTrue:[
- (colorValue == 0) ifTrue:[
+ (pixelValue == 0) ifTrue:[
^ Color white
].
^ Color black
].
photometric == #palette ifTrue:[
- ^ colorMap at:(colorValue+1).
+ pixelValue < colorMap size ifTrue:[
+ ^ colorMap at:(pixelValue+1).
+ ]
].
- ^ super colorFromValue:colorValue.
+ ^ super colorFromValue:pixelValue.
!
usedColors
@@ -736,5 +738,5 @@
!Depth1Image class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libview/Depth1Image.st,v 1.51 2003-04-29 19:19:54 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libview/Depth1Image.st,v 1.52 2003-04-29 19:42:36 cg Exp $'
! !
--- a/Depth2Image.st Tue Apr 29 21:20:22 2003 +0200
+++ b/Depth2Image.st Tue Apr 29 21:42:44 2003 +0200
@@ -953,7 +953,9 @@
].
p == #palette ifTrue:[
- ^ colorMap at:(value+1).
+ value < colorMap size ifTrue:[
+ ^ colorMap at:(value+1).
+ ].
].
^ super colorFromValue:colorValue.
!
@@ -995,5 +997,5 @@
!Depth2Image class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libview/Depth2Image.st,v 1.46 2003-04-29 19:20:12 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libview/Depth2Image.st,v 1.47 2003-04-29 19:42:44 cg Exp $'
! !
--- a/Depth4Image.st Tue Apr 29 21:20:22 2003 +0200
+++ b/Depth4Image.st Tue Apr 29 21:42:44 2003 +0200
@@ -992,9 +992,11 @@
^ Color gray:(100 / 15 * pixelValue)
].
photometric == #palette ifTrue:[
- ^ colorMap at:(pixelValue + 1)
+ pixelValue < colorMap size ifTrue:[
+ ^ colorMap at:(pixelValue + 1)
+ ]
].
- ^ self colorFromValue:pixelValue
+ ^ super colorFromValue:pixelValue
!
usedValues
@@ -1027,5 +1029,5 @@
!Depth4Image class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libview/Depth4Image.st,v 1.44 2003-04-29 19:19:49 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libview/Depth4Image.st,v 1.45 2003-04-29 19:42:31 cg Exp $'
! !
--- a/Depth8Image.st Tue Apr 29 21:20:22 2003 +0200
+++ b/Depth8Image.st Tue Apr 29 21:42:44 2003 +0200
@@ -1939,9 +1939,11 @@
^ Color gray:(100 / 255 * pixelValue)
].
photometric == #palette ifTrue:[
- ^ colorMap at:(pixelValue + 1)
+ pixelValue < colorMap size ifTrue:[
+ ^ colorMap at:(pixelValue + 1)
+ ]
].
- ^ self colorFromValue:pixelValue
+ ^ super colorFromValue:pixelValue
!
realUsedValues
@@ -1959,5 +1961,5 @@
!Depth8Image class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libview/Depth8Image.st,v 1.101 2003-04-29 19:20:03 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libview/Depth8Image.st,v 1.102 2003-04-29 19:42:40 cg Exp $'
! !