fi.faidon.jis
Class PICTImageSaver

java.lang.Object
  |
  +--fi.faidon.jis.ImageSaverInterface
        |
        +--fi.faidon.jis.PICTImageSaver
All Implemented Interfaces:
java.awt.image.ImageConsumer, java.io.Serializable

public class PICTImageSaver
extends ImageSaverInterface
implements java.io.Serializable, java.awt.image.ImageConsumer

Class for saving an image in the Macintosh PICT format. It is stored using the opcode "opDirectBitsRect", which directly stores pixel RGB values packed by the packbits routines.

See Also:
Serialized Form

Field Summary
static java.lang.String FORMAT_CODE
           
static java.lang.String FORMAT_COMPLETE_NAME
           
static java.lang.String FORMAT_EXTENSION
           
 
Fields inherited from class fi.faidon.jis.ImageSaverInterface
saveImage, savePath
 
Fields inherited from interface java.awt.image.ImageConsumer
COMPLETESCANLINES, IMAGEABORTED, IMAGEERROR, RANDOMPIXELORDER, SINGLEFRAME, SINGLEFRAMEDONE, SINGLEPASS, STATICIMAGEDONE, TOPDOWNLEFTRIGHT
 
Constructor Summary
PICTImageSaver()
           
 
Method Summary
 int checkSave()
          Return ImageObserver constants for indicating the state of the image saving.
 java.lang.String getFormatCode()
          ImageSaverInterface method implementations.
 java.lang.String getFormatExtension()
           
 java.lang.String getFormatString()
           
 void imageComplete(int status)
          Get imageComplete message so that we can close the output file.
 boolean saveIt()
          Save the image.
 void setColorModel(java.awt.image.ColorModel model)
           
 void setDimensions(int w, int h)
           
 void setHints(int hintflags)
           
 void setPixels(int x, int y, int w, int h, java.awt.image.ColorModel model, byte[] pixels, int off, int scansize)
          Write the pixels into the file as RGB data.
 void setPixels(int x, int y, int w, int h, java.awt.image.ColorModel model, int[] pixels, int off, int scansize)
          Write the pixels into the file as RGB data.
 void setProperties(java.util.Hashtable props)
          ImageConsumer method implementations.
 
Methods inherited from class fi.faidon.jis.ImageSaverInterface
getSaveImage, getSavePath, setSaveImage, setSavePath
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FORMAT_CODE

public static final java.lang.String FORMAT_CODE
See Also:
Constant Field Values

FORMAT_COMPLETE_NAME

public static final java.lang.String FORMAT_COMPLETE_NAME
See Also:
Constant Field Values

FORMAT_EXTENSION

public static final java.lang.String FORMAT_EXTENSION
See Also:
Constant Field Values
Constructor Detail

PICTImageSaver

public PICTImageSaver()
Method Detail

getFormatCode

public java.lang.String getFormatCode()
ImageSaverInterface method implementations.

Specified by:
getFormatCode in class ImageSaverInterface

getFormatString

public java.lang.String getFormatString()
Specified by:
getFormatString in class ImageSaverInterface

getFormatExtension

public java.lang.String getFormatExtension()
Specified by:
getFormatExtension in class ImageSaverInterface

saveIt

public boolean saveIt()
Save the image.

Specified by:
saveIt in class ImageSaverInterface

checkSave

public int checkSave()
Return ImageObserver constants for indicating the state of the image saving.

Specified by:
checkSave in class ImageSaverInterface

setProperties

public void setProperties(java.util.Hashtable props)
ImageConsumer method implementations.

Specified by:
setProperties in interface java.awt.image.ImageConsumer

setHints

public void setHints(int hintflags)
Specified by:
setHints in interface java.awt.image.ImageConsumer

setColorModel

public void setColorModel(java.awt.image.ColorModel model)
Specified by:
setColorModel in interface java.awt.image.ImageConsumer

setDimensions

public void setDimensions(int w,
                          int h)
Specified by:
setDimensions in interface java.awt.image.ImageConsumer

setPixels

public void setPixels(int x,
                      int y,
                      int w,
                      int h,
                      java.awt.image.ColorModel model,
                      byte[] pixels,
                      int off,
                      int scansize)
Write the pixels into the file as RGB data. For this to work correctly, pixels should be delivered in topdownleftright order with complete scanlines. If we have several lines, the lines should be complete scanlines, otherwise the saving fails.

Specified by:
setPixels in interface java.awt.image.ImageConsumer
See Also:
ImageConsumer.

setPixels

public void setPixels(int x,
                      int y,
                      int w,
                      int h,
                      java.awt.image.ColorModel model,
                      int[] pixels,
                      int off,
                      int scansize)
Write the pixels into the file as RGB data.

Specified by:
setPixels in interface java.awt.image.ImageConsumer
See Also:
ImageConsumer.

imageComplete

public void imageComplete(int status)
Get imageComplete message so that we can close the output file.

Specified by:
imageComplete in interface java.awt.image.ImageConsumer
See Also:
ImageConsumer.