#REFACTORING
authorClaus Gittinger <cg@exept.de>
Sun, 14 Feb 2016 00:14:45 +0100
changeset 3552 ef88cdf452d1
parent 3551 4eabd317a8f8
child 3553 2e3f003c3848
#REFACTORING class: TIFFReader changed:10 methods removed remaining references to obsolete inhomogenous writers and readers.
TIFFReader.st
--- a/TIFFReader.st	Sat Feb 13 21:22:53 2016 +0100
+++ b/TIFFReader.st	Sun Feb 14 00:14:45 2016 +0100
@@ -11,6 +11,8 @@
 "
 "{ Package: 'stx:libview2' }"
 
+"{ NameSpace: Smalltalk }"
+
 ImageReader subclass:#TIFFReader
 	instanceVariableNames:'planarConfiguration subFileType stripOffsets rowsPerStrip
 		fillOrder compression group3options predictor stripByteCounts
@@ -118,7 +120,7 @@
     ].
 
     inStream binary.
-    version := inStream nextShortMSB:(char1 == $M).
+    version := inStream nextInt16MSB:(char1 == $M).
     inStream close.
 
     (version ~~ 42) ifTrue:[^ false].
@@ -173,7 +175,7 @@
         "TIFF6: 64 bit IEEE double"
         value := self readDoubles:length
     ] ifFalse:[
-        offset := (inStream nextLongMSB:(byteOrder ~~ #lsb))
+        offset := (inStream nextInt32MSB:(byteOrder ~~ #lsb))
     ]]]]]]]]]]].
 
     (tagType < 300) ifTrue:[
@@ -1520,7 +1522,7 @@
             inStream skip:(4 - n).
         ]
     ] ifFalse:[
-        offset := inStream nextLongMSB:(byteOrder ~~ #lsb).
+        offset := inStream nextInt32MSB:(byteOrder ~~ #lsb).
         oldPos := inStream position.
         inStream position:offset.
         isSigned ifTrue:[
@@ -1547,7 +1549,7 @@
             inStream skip:(4 - n).
         ]
     ] ifFalse:[
-        offset := inStream nextLongMSB:(byteOrder ~~ #lsb).
+        offset := inStream nextInt32MSB:(byteOrder ~~ #lsb).
         oldPos := inStream position.
         inStream position:offset.
         inStream nextBytes:(n - 1) into:string.
@@ -1572,7 +1574,7 @@
         val := Float readBinaryIEEEDoubleFrom:inStream MSB:msb.
         values at:1 put:val.
     ] ifFalse:[
-        offset := inStream nextLongMSB:msb.
+        offset := inStream nextInt32MSB:msb.
         oldPos := inStream position.
         inStream position:offset.
         1 to:n do:[:index |
@@ -1598,7 +1600,7 @@
         val := ShortFloat readBinaryIEEESingleFrom:inStream MSB:msb.
         values at:1 put:val.
     ] ifFalse:[
-        offset := inStream nextLongMSB:msb.
+        offset := inStream nextInt32MSB:msb.
         oldPos := inStream position.
         inStream position:offset.
         1 to:n do:[:index |
@@ -1620,12 +1622,12 @@
 
     msb := byteOrder ~~ #lsb.
     values := Array basicNew:n.
-    offset := inStream nextLongMSB:msb.
+    offset := inStream nextInt32MSB:msb.
     oldPos := inStream position.
     inStream position:offset.
     1 to:n do:[:index |
-        numerator := isSigned ifTrue:[inStream nextLongMSB:msb] ifFalse:[inStream nextUnsignedLongMSB:msb].
-        denominator := isSigned ifTrue:[inStream nextLongMSB:msb] ifFalse:[inStream nextUnsignedLongMSB:msb].
+        numerator := isSigned ifTrue:[inStream nextInt32MSB:msb] ifFalse:[inStream nextUnsignedInt32MSB:msb].
+        denominator := isSigned ifTrue:[inStream nextInt32MSB:msb] ifFalse:[inStream nextUnsignedInt32MSB:msb].
         values at:index put:(Fraction numerator:numerator denominator:denominator)
     ].
     inStream position:oldPos.
@@ -1643,14 +1645,14 @@
     msb := byteOrder ~~ #lsb.
     values := Array basicNew:n.
     (n == 1) ifTrue:[
-        val := isSigned ifTrue:[inStream nextLongMSB:msb] ifFalse:[inStream nextUnsignedLongMSB:msb].
+        val := isSigned ifTrue:[inStream nextInt32MSB:msb] ifFalse:[inStream nextUnsignedInt32MSB:msb].
         values at:1 put:val.
     ] ifFalse:[
-        offset := inStream nextLongMSB:msb.
+        offset := inStream nextInt32MSB:msb.
         oldPos := inStream position.
         inStream position:offset.
         1 to:n do:[:index |
-            val := isSigned ifTrue:[inStream nextLongMSB:msb] ifFalse:[inStream nextUnsignedLongMSB:msb].
+            val := isSigned ifTrue:[inStream nextInt32MSB:msb] ifFalse:[inStream nextUnsignedInt32MSB:msb].
             values at:index put:val
         ].
         inStream position:oldPos
@@ -1670,25 +1672,25 @@
     values := Array basicNew:n.
     (n <= 2) ifTrue:[
         isSigned ifTrue:[
-            val1 := inStream nextShortMSB:msb.
-            val2 := inStream nextShortMSB:msb.
+            val1 := inStream nextInt16MSB:msb.
+            val2 := inStream nextInt16MSB:msb.
         ] ifFalse:[
-            val1 := inStream nextUnsignedShortMSB:msb.
-            val2 := inStream nextUnsignedShortMSB:msb.
+            val1 := inStream nextUnsignedInt16MSB:msb.
+            val2 := inStream nextUnsignedInt16MSB:msb.
         ].
         values at:1 put:val1.
         (n == 2) ifTrue:[
             values at:2 put:val2
         ]
     ] ifFalse:[
-        offset := inStream nextLongMSB:msb.
+        offset := inStream nextInt32MSB:msb.
         oldPos := inStream position.
         inStream position:offset.
         1 to:n do:[:index |
             isSigned ifTrue:[
-                val1 := inStream nextShortMSB:msb.
+                val1 := inStream nextInt16MSB:msb.
             ] ifFalse:[
-                val1 := inStream nextUnsignedShortMSB:msb.
+                val1 := inStream nextUnsignedInt16MSB:msb.
             ].
             values at:index put:val1
         ].
@@ -2130,18 +2132,18 @@
     predictor := 1.
     orientation := nil.
 
-    offset := aStream nextLongMSB:msb.
+    offset := aStream nextInt32MSB:msb.
     aStream position:offset.
 
     numberOfTags := self readShort.
     1 to:numberOfTags do:[:index |
         tagType := self readShort.
         numberType := self readShort.
-        length := aStream nextLongMSB:msb.
+        length := aStream nextInt32MSB:msb.
         self decodeTiffTag:tagType numberType:numberType length:length
     ].
 
-    offset := aStream nextLongMSB:msb.
+    offset := aStream nextInt32MSB:msb.
     (offset ~~ 0) ifTrue:[
         'TIFFReader [info]: more tags ignored' infoPrintCR
     ].
@@ -2309,7 +2311,7 @@
 !TIFFReader class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview2/TIFFReader.st,v 1.86 2014-11-10 22:25:12 cg Exp $'
+    ^ '$Header$'
 ! !