WindowsIconReader.st
changeset 3604 5d4d8906ade6
parent 3602 1b88866d2807
child 3640 8a96d595df32
--- a/WindowsIconReader.st	Tue Mar 15 22:45:38 2016 +0100
+++ b/WindowsIconReader.st	Wed Mar 23 14:26:40 2016 +0100
@@ -552,9 +552,9 @@
                     1 to:height do:[:y |
                         idx := rowIdx.
                         1 to:width do:[:x |
-                            oldValue := data doubleWordAt:idx MSB:false.
+                            oldValue := data unsignedInt32At:idx MSB:false.
                             newValue := pixelAction value:oldValue.
-                            data doubleWordAt:idx put:newValue MSB:false.
+                            data unsignedInt32At:idx put:newValue MSB:false.
                             idx := idx + 4.
                         ].    
                         rowIdx := rowIdx + bpr.
@@ -1224,7 +1224,7 @@
     bitmapHeader := ByteArray new:iSize+16. "/ reserve to allow masks to be read with iSize=40 
     aStream nextBytes:(iSize-4) into:bitmapHeader startingAt:(1+4).
 
-    dataStart := fileHeader doubleWordAt:(10 + 1) MSB:false.
+    dataStart := fileHeader unsignedInt32At:(10 + 1) MSB:false.
 
     alphaMask := 0.
 
@@ -1236,16 +1236,16 @@
         "/
         "/ 'WinIconReader [info]: Win3.x/Win4.x/Win5.x format' infoPrintCR.
 
-        width := bitmapHeader doubleWordAt:(4 + 1) MSB:false.
-        height := bitmapHeader signedDoubleWordAt:(8 + 1) MSB:false.
+        width := bitmapHeader unsignedInt32At:(4 + 1) MSB:false.
+        height := bitmapHeader signedInt32At:(8 + 1) MSB:false.
         inPlanes := bitmapHeader unsignedInt16At:(12 + 1) MSB:false.
         inDepth := bitmapHeader unsignedInt16At:(14 + 1) MSB:false.
-        compression := bitmapHeader doubleWordAt:(16 + 1) MSB:false.
-        imgSize := bitmapHeader doubleWordAt:(20 + 1) MSB:false.
-        resH := bitmapHeader doubleWordAt:(24 + 1) MSB:false.
-        resV := bitmapHeader doubleWordAt:(28 + 1) MSB:false.
-        numColor := bitmapHeader doubleWordAt:(32 + 1) MSB:false.
-        numImportantColor := bitmapHeader doubleWordAt:(36 + 1) MSB:false.
+        compression := bitmapHeader unsignedInt32At:(16 + 1) MSB:false.
+        imgSize := bitmapHeader unsignedInt32At:(20 + 1) MSB:false.
+        resH := bitmapHeader unsignedInt32At:(24 + 1) MSB:false.
+        resV := bitmapHeader unsignedInt32At:(28 + 1) MSB:false.
+        numColor := bitmapHeader unsignedInt32At:(32 + 1) MSB:false.
+        numImportantColor := bitmapHeader unsignedInt32At:(36 + 1) MSB:false.
         
         (compression > 3) ifTrue:[
             compression == 4 ifTrue:[
@@ -1271,24 +1271,24 @@
             "/ masks are not counted in header (sigh)
             compression == 6 ifTrue:[
                 aStream next:4*4 into:bitmapHeader startingAt:iSize+1.
-                alphaMask := bitmapHeader doubleWordAt:(52 + 1) MSB:false.
+                alphaMask := bitmapHeader unsignedInt32At:(52 + 1) MSB:false.
                 compression := 3.
             ] ifFalse:[        
                 aStream next:4*3 into:bitmapHeader startingAt:iSize+1.
             ].    
-            redMask := bitmapHeader doubleWordAt:(40 + 1) MSB:false.
-            greenMask := bitmapHeader doubleWordAt:(44 + 1) MSB:false.
-            blueMask := bitmapHeader doubleWordAt:(48 + 1) MSB:false.
+            redMask := bitmapHeader unsignedInt32At:(40 + 1) MSB:false.
+            greenMask := bitmapHeader unsignedInt32At:(44 + 1) MSB:false.
+            blueMask := bitmapHeader unsignedInt32At:(48 + 1) MSB:false.
         ] ifFalse:[        
             iSize > 40 ifTrue:[
                 "/ masks are counted in header (sigh)
                 ((compression == 3) or:[iSize == 108]) ifTrue:[
                     iSize >= 52 ifTrue:[
-                        redMask := bitmapHeader doubleWordAt:(40 + 1) MSB:false.
-                        greenMask := bitmapHeader doubleWordAt:(44 + 1) MSB:false.
-                        blueMask := bitmapHeader doubleWordAt:(48 + 1) MSB:false.
+                        redMask := bitmapHeader unsignedInt32At:(40 + 1) MSB:false.
+                        greenMask := bitmapHeader unsignedInt32At:(44 + 1) MSB:false.
+                        blueMask := bitmapHeader unsignedInt32At:(48 + 1) MSB:false.
                         iSize >= 56 ifTrue:[
-                            alphaMask := bitmapHeader doubleWordAt:(52 + 1) MSB:false.
+                            alphaMask := bitmapHeader unsignedInt32At:(52 + 1) MSB:false.
                         ].
                     ].
                 ].
@@ -1316,13 +1316,13 @@
                 "/
                 "/ its an OS/2 (vsn2) BMP file
                 "/
-                width := bitmapHeader doubleWordAt:(4 + 1) MSB:false.
-                height := bitmapHeader signedDoubleWordAt:(8 + 1) MSB:false.
+                width := bitmapHeader unsignedInt32At:(4 + 1) MSB:false.
+                height := bitmapHeader signedInt32At:(8 + 1) MSB:false.
                 inPlanes := bitmapHeader unsignedInt16At:(12 + 1) MSB:false.
                 inDepth := bitmapHeader unsignedInt16At:(14 + 1) MSB:false.
-                compression := bitmapHeader doubleWordAt:(16 + 1) MSB:false.
-                numColor := bitmapHeader doubleWordAt:(32 + 1) MSB:false.
-                numImportantColor := bitmapHeader doubleWordAt:(36 + 1) MSB:false.
+                compression := bitmapHeader unsignedInt32At:(16 + 1) MSB:false.
+                numColor := bitmapHeader unsignedInt32At:(32 + 1) MSB:false.
+                numImportantColor := bitmapHeader unsignedInt32At:(36 + 1) MSB:false.
                 (compression > 2) ifTrue:[
                     "/ 3 = HUFFMAN; 4 = RLE24
                     ^ self fileFormatError:'unhandled OS2 compression'.
@@ -1338,8 +1338,8 @@
             ] ifFalse:[    
                 iSize == 16 ifTrue:[
                     "/ an OS2 bitmap with large dimensions
-                    width := bitmapHeader doubleWordAt:(4 + 1) MSB:false.
-                    height := bitmapHeader signedDoubleWordAt:(8 + 1) MSB:false.
+                    width := bitmapHeader unsignedInt32At:(4 + 1) MSB:false.
+                    height := bitmapHeader signedInt32At:(8 + 1) MSB:false.
                     inPlanes := bitmapHeader unsignedInt16At:(12 + 1) MSB:false.
                     inDepth := bitmapHeader unsignedInt16At:(14 + 1) MSB:false.
                     numBytesPerColorInColormap := 4.
@@ -1347,7 +1347,7 @@
                     "/ size == 12:
                     "/ a Win2.x bitmap
                     width := bitmapHeader unsignedInt16At:(4 + 1) MSB:false.
-                    height := bitmapHeader signedWordAt:(6 + 1) MSB:false.
+                    height := bitmapHeader signedInt16At:(6 + 1) MSB:false.
                     inPlanes := bitmapHeader unsignedInt16At:(8 + 1) MSB:false.
                     inDepth := bitmapHeader unsignedInt16At:(10 + 1) MSB:false.
                 ].