--- a/ST80FormReader.st Tue Apr 23 12:50:41 1996 +0200
+++ b/ST80FormReader.st Tue Apr 23 12:57:34 1996 +0200
@@ -10,13 +10,11 @@
hereby transferred.
"
-'From Smalltalk/X, Version:2.10.4 on 18-feb-1995 at 2:18:48 am'!
-
ImageReader subclass:#ST80FormReader
- instanceVariableNames:''
- classVariableNames:''
- poolDictionaries:''
- category:'Graphics-Images support'
+ instanceVariableNames:''
+ classVariableNames:''
+ poolDictionaries:''
+ category:'Graphics-Images support'
!
!ST80FormReader class methodsFor:'documentation'!
@@ -35,22 +33,36 @@
"
!
-version
- ^ '$Header: /cvs/stx/stx/libview2/ST80FormReader.st,v 1.10 1995-11-11 16:04:58 cg Exp $'
-!
-
documentation
"
this class provides methods for loading and saving st80-bitmap-file images.
+
I am not sure, if this format is still supported/used by newer ST-80
- versions; it used to be in 2.x versions (from what can be deduced by some
- bitmaps found in the manchester goodies).
+ versions; it used to be in 2.x versions
+ (from what can be deduced by some bitmaps found in the manchester goodies).
+
No writing is supported by this class.
+
+ [See also:]
+ BlitImageReader FaceReader JPEGReader GIFReader PBMReader PCXReader
+ SunRasterReader TIFFReader WindowsIconReader
+ XBMreader XPMReader XWDReader
"
! !
!ST80FormReader class methodsFor:'testing'!
+canRepresent:anImage
+ "return true, if anImage can be represented in my file format.
+ Only B&Wimages are supported."
+
+ |photometric|
+
+ anImage depth ~~ 1 ifTrue:[^ false].
+ (((photometric := anImage photometric) ~~ #blackIs0) and:[photometric ~~ #whiteIs0]) ifTrue:[^ false.].
+ ^ true
+!
+
isValidImageFile:aFileName
"return true, if aFileName contains an st80-bitmap-file image"
@@ -64,33 +76,54 @@
ok := (code == 1).
inStream close.
^ ok
-!
+! !
+
+!ST80FormReader methodsFor:'reading from file'!
-canRepresent:anImage
- "return true, if anImage can be represented in my file format.
- Only B&Wimages are supported."
+fromStream:aStream
+ "read an image in my format from aStream"
+
+ |nBytes code offsetX offsetY|
+
+ inStream := aStream.
+ inStream binary.
- |photometric|
+ code := inStream nextWord.
+ code isNil ifTrue:[
+ ^ nil
+ ].
+
+ width := aStream nextWord.
+ height := aStream nextWord.
+ offsetX := aStream nextWord.
+ offsetY := aStream nextWord.
- anImage depth ~~ 1 ifTrue:[^ false].
- (((photometric := anImage photometric) ~~ #blackIs0) and:[photometric ~~ #whiteIs0]) ifTrue:[^ false.].
- ^ true
+ nBytes := width + 15 // 16 * 2 * height.
+ data := ByteArray new:nBytes.
+ aStream nextBytes:nBytes into:data.
+
+ photometric := #whiteIs0.
+ samplesPerPixel := 1.
+ bitsPerSample := #(1)
+
+ "ST80FormReader fromFile:''"
! !
!ST80FormReader methodsFor:'writing to file'!
save:image onFile:aFileName
- "save image as XBM file on aFileName"
+ "save image as XBM file on aFileName.
+ This is obsolete - use the XBMReader directly."
(self class canRepresent:image) ifFalse:[
- self error:'can only save Depth1Images'.
- ^ nil.
+ self error:'can only save Depth1Images'.
+ ^ nil.
].
outStream := FileStream newFileNamed:aFileName.
outStream isNil ifTrue:[
- 'create error' printNewline.
- ^ nil
+ 'create error' printNewline.
+ ^ nil
].
width := image width.
@@ -113,32 +146,8 @@
"ST80FormReader save:(Image fromFile:'bitmaps/SBrowser.xbm') onFile:'test.form'"
! !
-!ST80FormReader methodsFor:'reading from file'!
-
-fromStream:aStream
- |nBytes code offsetX offsetY|
-
- inStream := aStream.
- inStream binary.
-
- code := inStream nextWord.
- code isNil ifTrue:[
- ^ nil
- ].
+!ST80FormReader class methodsFor:'documentation'!
- width := aStream nextWord.
- height := aStream nextWord.
- offsetX := aStream nextWord.
- offsetY := aStream nextWord.
-
- nBytes := width + 15 // 16 * 2 * height.
- data := ByteArray new:nBytes.
- aStream nextBytes:nBytes into:data.
-
- photometric := #whiteIs0.
- samplesPerPixel := 1.
- bitsPerSample := #(1)
-
- "ST80FormReader fromFile:''"
+version
+ ^ '$Header: /cvs/stx/stx/libview2/ST80FormReader.st,v 1.11 1996-04-23 10:57:34 cg Exp $'
! !
-
--- a/STFormRdr.st Tue Apr 23 12:50:41 1996 +0200
+++ b/STFormRdr.st Tue Apr 23 12:57:34 1996 +0200
@@ -10,13 +10,11 @@
hereby transferred.
"
-'From Smalltalk/X, Version:2.10.4 on 18-feb-1995 at 2:18:48 am'!
-
ImageReader subclass:#ST80FormReader
- instanceVariableNames:''
- classVariableNames:''
- poolDictionaries:''
- category:'Graphics-Images support'
+ instanceVariableNames:''
+ classVariableNames:''
+ poolDictionaries:''
+ category:'Graphics-Images support'
!
!ST80FormReader class methodsFor:'documentation'!
@@ -35,22 +33,36 @@
"
!
-version
- ^ '$Header: /cvs/stx/stx/libview2/Attic/STFormRdr.st,v 1.10 1995-11-11 16:04:58 cg Exp $'
-!
-
documentation
"
this class provides methods for loading and saving st80-bitmap-file images.
+
I am not sure, if this format is still supported/used by newer ST-80
- versions; it used to be in 2.x versions (from what can be deduced by some
- bitmaps found in the manchester goodies).
+ versions; it used to be in 2.x versions
+ (from what can be deduced by some bitmaps found in the manchester goodies).
+
No writing is supported by this class.
+
+ [See also:]
+ BlitImageReader FaceReader JPEGReader GIFReader PBMReader PCXReader
+ SunRasterReader TIFFReader WindowsIconReader
+ XBMreader XPMReader XWDReader
"
! !
!ST80FormReader class methodsFor:'testing'!
+canRepresent:anImage
+ "return true, if anImage can be represented in my file format.
+ Only B&Wimages are supported."
+
+ |photometric|
+
+ anImage depth ~~ 1 ifTrue:[^ false].
+ (((photometric := anImage photometric) ~~ #blackIs0) and:[photometric ~~ #whiteIs0]) ifTrue:[^ false.].
+ ^ true
+!
+
isValidImageFile:aFileName
"return true, if aFileName contains an st80-bitmap-file image"
@@ -64,33 +76,54 @@
ok := (code == 1).
inStream close.
^ ok
-!
+! !
+
+!ST80FormReader methodsFor:'reading from file'!
-canRepresent:anImage
- "return true, if anImage can be represented in my file format.
- Only B&Wimages are supported."
+fromStream:aStream
+ "read an image in my format from aStream"
+
+ |nBytes code offsetX offsetY|
+
+ inStream := aStream.
+ inStream binary.
- |photometric|
+ code := inStream nextWord.
+ code isNil ifTrue:[
+ ^ nil
+ ].
+
+ width := aStream nextWord.
+ height := aStream nextWord.
+ offsetX := aStream nextWord.
+ offsetY := aStream nextWord.
- anImage depth ~~ 1 ifTrue:[^ false].
- (((photometric := anImage photometric) ~~ #blackIs0) and:[photometric ~~ #whiteIs0]) ifTrue:[^ false.].
- ^ true
+ nBytes := width + 15 // 16 * 2 * height.
+ data := ByteArray new:nBytes.
+ aStream nextBytes:nBytes into:data.
+
+ photometric := #whiteIs0.
+ samplesPerPixel := 1.
+ bitsPerSample := #(1)
+
+ "ST80FormReader fromFile:''"
! !
!ST80FormReader methodsFor:'writing to file'!
save:image onFile:aFileName
- "save image as XBM file on aFileName"
+ "save image as XBM file on aFileName.
+ This is obsolete - use the XBMReader directly."
(self class canRepresent:image) ifFalse:[
- self error:'can only save Depth1Images'.
- ^ nil.
+ self error:'can only save Depth1Images'.
+ ^ nil.
].
outStream := FileStream newFileNamed:aFileName.
outStream isNil ifTrue:[
- 'create error' printNewline.
- ^ nil
+ 'create error' printNewline.
+ ^ nil
].
width := image width.
@@ -113,32 +146,8 @@
"ST80FormReader save:(Image fromFile:'bitmaps/SBrowser.xbm') onFile:'test.form'"
! !
-!ST80FormReader methodsFor:'reading from file'!
-
-fromStream:aStream
- |nBytes code offsetX offsetY|
-
- inStream := aStream.
- inStream binary.
-
- code := inStream nextWord.
- code isNil ifTrue:[
- ^ nil
- ].
+!ST80FormReader class methodsFor:'documentation'!
- width := aStream nextWord.
- height := aStream nextWord.
- offsetX := aStream nextWord.
- offsetY := aStream nextWord.
-
- nBytes := width + 15 // 16 * 2 * height.
- data := ByteArray new:nBytes.
- aStream nextBytes:nBytes into:data.
-
- photometric := #whiteIs0.
- samplesPerPixel := 1.
- bitsPerSample := #(1)
-
- "ST80FormReader fromFile:''"
+version
+ ^ '$Header: /cvs/stx/stx/libview2/Attic/STFormRdr.st,v 1.11 1996-04-23 10:57:34 cg Exp $'
! !
-