PNGReader.st
changeset 1848 864ca2cd4e71
parent 1846 d29322944b05
child 2509 866b56cabe7e
--- a/PNGReader.st	Wed Nov 19 16:33:55 2003 +0100
+++ b/PNGReader.st	Wed Nov 19 16:38:53 2003 +0100
@@ -319,6 +319,64 @@
     "Created: 21.6.1996 / 21:15:58 / cg"
 ! !
 
+!PNGReader methodsFor:'private-reading'!
+
+setColorType:colorType
+    colorType == 0 ifTrue:[
+        photometric := #blackIs0.
+        samplesPerPixel := 1.
+        bitsPerSample := Array with:depth.
+        ^ true.
+    ].
+
+    colorType == 2 ifTrue:[
+        depth < 8 ifTrue:[
+            'PNGReader: invalid colorType/depth combination' infoPrintCR.
+            ^ false.
+        ].
+        photometric := #rgb.
+        samplesPerPixel := 3.
+        bitsPerSample := Array with:depth with:depth with:depth.
+        ^ true.
+    ].
+
+    colorType == 3 ifTrue:[
+        depth == 16 ifTrue:[
+            'PNGReader: invalid colorType/depth combination' infoPrintCR.
+            ^ false.
+        ].
+        photometric := #palette.
+        samplesPerPixel := 1.
+        bitsPerSample := Array with:depth.
+        ^ true.
+    ].
+
+    colorType == 4 ifTrue:[
+        depth < 8 ifTrue:[
+            'PNGReader: invalid colorType/depth combination' infoPrintCR.
+            ^ false.
+        ].
+        photometric := #blackIs0.
+        samplesPerPixel := 2.
+        bitsPerSample := Array with:depth with:depth.
+        ^ true.
+    ].
+
+    colorType == 6 ifTrue:[
+        depth < 8 ifTrue:[
+            'PNGReader: invalid colorType/depth combination' infoPrintCR.
+            ^ false.
+        ].
+        photometric := #rgb.
+        samplesPerPixel := 4.
+        bitsPerSample := Array with:depth with:depth with:depth with:depth.
+        ^ true.
+    ].
+
+    ('PNGReader: invalid colorType: ' , colorType printString , '.') infoPrintCR.
+    ^ false
+! !
+
 !PNGReader methodsFor:'reading'!
 
 fromStream:aStream
@@ -383,68 +441,10 @@
     "Modified: 21.6.1996 / 21:44:34 / cg"
 ! !
 
-!PNGReader methodsFor:'reading-private'!
-
-setColorType:colorType
-    colorType == 0 ifTrue:[
-        photometric := #blackIs0.
-        samplesPerPixel := 1.
-        bitsPerSample := Array with:depth.
-        ^ true.
-    ].
-
-    colorType == 2 ifTrue:[
-        depth < 8 ifTrue:[
-            'PNGReader: invalid colorType/depth combination' infoPrintCR.
-            ^ false.
-        ].
-        photometric := #rgb.
-        samplesPerPixel := 3.
-        bitsPerSample := Array with:depth with:depth with:depth.
-        ^ true.
-    ].
-
-    colorType == 3 ifTrue:[
-        depth == 16 ifTrue:[
-            'PNGReader: invalid colorType/depth combination' infoPrintCR.
-            ^ false.
-        ].
-        photometric := #palette.
-        samplesPerPixel := 1.
-        bitsPerSample := Array with:depth.
-        ^ true.
-    ].
-
-    colorType == 4 ifTrue:[
-        depth < 8 ifTrue:[
-            'PNGReader: invalid colorType/depth combination' infoPrintCR.
-            ^ false.
-        ].
-        photometric := #blackIs0.
-        samplesPerPixel := 2.
-        bitsPerSample := Array with:depth with:depth.
-        ^ true.
-    ].
-
-    colorType == 6 ifTrue:[
-        depth < 8 ifTrue:[
-            'PNGReader: invalid colorType/depth combination' infoPrintCR.
-            ^ false.
-        ].
-        photometric := #rgb.
-        samplesPerPixel := 4.
-        bitsPerSample := Array with:depth with:depth with:depth with:depth.
-        ^ true.
-    ].
-
-    ('PNGReader: invalid colorType: ' , colorType printString , '.') infoPrintCR.
-    ^ false
-! !
-
 !PNGReader class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview2/PNGReader.st,v 1.9 2003-11-19 15:26:24 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview2/PNGReader.st,v 1.10 2003-11-19 15:38:33 cg Exp $'
 ! !
 
 PNGReader initialize!