|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.pearsoneduc.ip.io.SIFEncoder
Writes image data to a stream or file encoded in the SIF format.
SIF files have a very simple binary format. The first four bytes constitute a signature for the file. Valid signatures are listed below:
Signature | Image type |
---|---|
BIMG | 8-bit greyscale image |
bIMG | 8-bit greyscale image, compressed |
CIMG | 24-bit colour image |
cIMG | 24-bit colour image, compressed |
Following the signature are two binary-formatted integers, representing the width and height of the image. The remainder of a SIF file consists of image data. Colour images are stored in band-interleaved format, i.e. blue, green and red values for each pixel in turn.
SIFEncoderException
,
SIFDecoder
,
BufferedImage
Constructor Summary | |
SIFEncoder()
Constructs a SIFEncoder associated with the standard output. |
|
SIFEncoder(java.io.OutputStream stream)
Constructs a SIFEncoder associated with a specified OutputStream. |
|
SIFEncoder(java.lang.String imgfile)
Constructs a SIFEncoder that writes to a named file. |
Method Summary | |
boolean |
compressionEnabled()
|
void |
disableCompression()
Turns image compression off. |
void |
enableCompression()
Turns image compression on. |
void |
encode(java.awt.image.BufferedImage img)
Writes a BufferedImage to a stream in SIF format. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public SIFEncoder()
public SIFEncoder(java.io.OutputStream stream)
stream
- the stream to which image data will be writtenpublic SIFEncoder(java.lang.String imgfile) throws java.io.FileNotFoundException
imgfile
- name of the file to which image data will be writtenMethod Detail |
public boolean compressionEnabled()
public void enableCompression()
public void disableCompression()
public void encode(java.awt.image.BufferedImage img) throws java.io.IOException, SIFEncoderException
img
- The BufferedImage to be written
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |