Squeak Class Documentation category index | class index  
 
ImageReadWriter
  category: Graphics-Files
  superclass: Object
  subclasses: PCXReadWriter XBMReadWriter PNGReadWriter JPEGReadWriter GIFReadWriter JPEGReadWriter2

Copyright (c) Kazuki Yasumatsu, 1995. All rights reserved.

I am an abstract class to provide for encoding and/or decoding an image on a stream.

Instance Variables:
stream <ReadStream | WriteStream> stream for image storages

Class Variables:
ImageNotStoredSignal <Signal> image not stored error signal
MagicNumberErrorSignal <Signal> magic number error signal

Subclasses must implement the following messages:
accessing
nextImage
nextPutImage:
testing
canUnderstand (added tao 10/26/97)

instance methods
  accessing
  nextImage
nextPutImage:

  private
  changePadOfBits:width:height:depth:from:to:
hasMagicNumber:
on:
unpackBits:depthTo8From:with:height:pad:

  stream access
  atEnd
close
contents
cr
lf
next
next:
nextLong
nextLongPut:
nextPut:
nextPutAll:
nextWord
nextWordPut:
peekFor:
position
position:
size
skip:
space
tab

  testing
  understandsImageFormat

class methods
  image reading/writing
  formFromFileNamed:
formFromServerFile:
formFromStream:
putForm:onFileNamed:
putForm:onStream:

  instance creation
  on:

instance methods
  accessing top  
 

nextImage

Dencoding an image on stream and answer the image.


 

nextPutImage:

Encoding anImage on stream.


  private top  
 

changePadOfBits:width:height:depth:from:to:

Change padding size of bits.


 

hasMagicNumber:


 

on:


 

unpackBits:depthTo8From:with:height:pad:

Unpack bits of depth 1, 2, or 4 image to it of depth 8 image.


  stream access top  
 

atEnd


 

close

close if you can


 

contents


 

cr


 

lf

PPM and PBM are used LF as CR.


 

next


 

next:


 

nextLong

Read a 32-bit quantity from the input stream.


 

nextLongPut:

Write out a 32-bit integer as 32 bits.


 

nextPut:


 

nextPutAll:


 

nextWord

Read a 16-bit quantity from the input stream.


 

nextWordPut:

Write out a 16-bit integer as 16 bits.


 

peekFor:


 

position


 

position:


 

size

Primitive. Answer the number of indexable variables in the receiver.
This value is the same as the largest legal subscript. Essential. See Object
documentation whatIsAPrimitive.


 

skip:


 

space


 

tab


  testing top  
 

understandsImageFormat

Test to see if the image stream format is understood by this decoder.
This should be implemented in each subclass of ImageReadWriter so that
a proper decoder can be selected without ImageReadWriter having to know
about all possible image file types.


class methods
  image reading/writing top  
 

formFromFileNamed:

Answer a ColorForm stored on the file with the given name.


 

formFromServerFile:

Answer a ColorForm stored on the file with the given name. Meant to be called from during the getting of updates from the server. That assures that (Utilities serverUrls) returns the right group of servers.


 

formFromStream:

Answer a ColorForm stored on the given stream. closes the stream


 

putForm:onFileNamed:

Store the given form on a file of the given name.


 

putForm:onStream:

Store the given form on a file of the given name.


  instance creation top  
 

on:

Answer an instance of the receiver for encoding and/or decoding images on the given.