--- a/ImageReader.st Thu Mar 09 04:20:08 1995 +0100
+++ b/ImageReader.st Sat Mar 18 06:13:39 1995 +0100
@@ -24,7 +24,7 @@
COPYRIGHT (c) 1991 by Claus Gittinger
All Rights Reserved
-$Header: /cvs/stx/stx/libview/ImageReader.st,v 1.15 1995-02-18 15:57:27 claus Exp $
+$Header: /cvs/stx/stx/libview/ImageReader.st,v 1.16 1995-03-18 05:11:27 claus Exp $
'!
!ImageReader primitiveFunctions!
@@ -775,7 +775,7 @@
version
"
-$Header: /cvs/stx/stx/libview/ImageReader.st,v 1.15 1995-02-18 15:57:27 claus Exp $
+$Header: /cvs/stx/stx/libview/ImageReader.st,v 1.16 1995-03-18 05:11:27 claus Exp $
"
!
@@ -786,7 +786,8 @@
ImageReaders are created temporary to read an image from a stream.
They read the stream and collect all relevant information internally.
- Once done with reading, the image is asked for.
+ Once done with reading, the actual image object is created and
+ data filled in from the imageReaders collected info.
See implementation of fromStream: in concrete subclasses.
The public interfaces are:
@@ -796,6 +797,9 @@
However, usually this is done indirectly through
Image fromFile:aFileName
+ which tries to find an appropriate readerClass by the fileNames
+ extension (i.e. .tiff, .gif etc.) and/or by asking the readers
+ if they know about the format of the file (see #isValidImageFile:).
"
! !
@@ -824,7 +828,7 @@
^ inStream
! !
-!ImageReader class methodsFor:'fileIn / fileOut'!
+!ImageReader class methodsFor:'image reading'!
fromStream:aStream
"read an image (in my format) from aStream"
@@ -857,7 +861,9 @@
XPMReader fromFile:'bitmaps/ljet.xpm'
XBMReader fromFile:'bitmaps/SBrowser.xbm'
"
-!
+! !
+
+!ImageReader class methodsFor:'image writing'!
save:anImage onFile:aFileName
"save the image in my format on aFileName"
@@ -869,7 +875,7 @@
isValidImageFile:aFileName
"return true, if aFileName contains an image this
- reader understands - should be redefined in subclasses"
+ reader understands - must be redefined in concrete subclasses."
^ false
! !
@@ -1048,13 +1054,15 @@
^ (bitsPerSample inject:0 into:[:sum :i | sum + i])
! !
-!ImageReader methodsFor:'fileIn / fileOut'!
+!ImageReader methodsFor:'image writing'!
save:image onFile:aFileName
"save image in my format on aFile"
^ self subclassResponsibility
-!
+! !
+
+!ImageReader methodsFor:'image reading'!
fromStream:aStream
"read imagedata in my format from aStream"