ImageReader.st
changeset 618 5d5277119897
parent 611 e0442439a3c6
child 665 843bf13683f5
equal deleted inserted replaced
617:74941f143cf1 618:5d5277119897
   987 "
   987 "
   988     Abstract class to provide common functions for image-readers 
   988     Abstract class to provide common functions for image-readers 
   989     (i.e. TIFFReader, GIFReader etc.)
   989     (i.e. TIFFReader, GIFReader etc.)
   990 
   990 
   991     ImageReaders are created temporary to read an image from a stream.
   991     ImageReaders are created temporary to read an image from a stream.
   992     They read the stream and collect all relevant information internally.
   992     Normally, they are not directly used - instead, the image class is
       
   993     asked to read some file, and return an instance for it:
       
   994         Image fromFile:<someFileName>
       
   995     The Image class will guess the images format and forward the task to
       
   996     some concrete ImageReaderClass.
       
   997     If that class finds, that the files format is incorrect, other readers
       
   998     are tried until some finds the files format acceptable.
       
   999 
       
  1000     Image readers read the stream and collect all relevant information internally.
   993     Once done with reading, the actual image object is created and
  1001     Once done with reading, the actual image object is created and
   994     data filled in from the imageReaders collected info.
  1002     data filled in from the imageReaders collected info.
   995 
  1003 
   996     See implementation of fromStream: in concrete subclasses.
  1004     See the implementation of #fromStream: in concrete subclasses.
   997     The public interfaces are:
  1005     The public interfaces are:
   998          <ConcreteReaderClass> fromFile:aFilename
  1006          <ConcreteReaderClass> fromFile:aFilename
   999     or:
  1007     or:
  1000          <ConcreteReaderClass> fromStream:aStream
  1008          <ConcreteReaderClass> fromStream:aStream
  1001 
  1009 
  1002     However, usually this is done indirectly through
       
  1003         Image fromFile:aFileName
       
  1004     which tries to find an appropriate readerClass by the fileNames
       
  1005     extension (i.e. .tiff, .gif etc.) and/or by asking the readers
       
  1006     if they know about the format of the file (see #isValidImageFile:).
       
  1007 
       
  1008     If you add a new reader, dont forget to add the method #isValidImageFile:
  1010     If you add a new reader, dont forget to add the method #isValidImageFile:
  1009     if this reader supports reading image files.
  1011     which should return true, if this reader supports reading a given file.
  1010     And/or if it supports writing files, dont forget to add #canRepresent:.
  1012     If your new reader class supports writing files, dont forget to add 
       
  1013     #canRepresent:anImage and return true from this method.
  1011 
  1014 
  1012     [See also:]
  1015     [See also:]
  1013         Image Icon Form
  1016         Image Icon Form
  1014 
  1017 
  1015     [author:]
  1018     [author:]
  1480 ! !
  1483 ! !
  1481 
  1484 
  1482 !ImageReader class methodsFor:'documentation'!
  1485 !ImageReader class methodsFor:'documentation'!
  1483 
  1486 
  1484 version
  1487 version
  1485     ^ '$Header: /cvs/stx/stx/libview/ImageReader.st,v 1.28 1996-04-25 16:23:21 cg Exp $'
  1488     ^ '$Header: /cvs/stx/stx/libview/ImageReader.st,v 1.29 1996-04-26 14:57:23 cg Exp $'
  1486 ! !
  1489 ! !