All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class fi.faidon.jis.PNGImageSaver

java.lang.Object
   |
   +----fi.faidon.jis.ImageSaverInterface
           |
           +----fi.faidon.jis.PNGImageSaver

public class PNGImageSaver
extends ImageSaverInterface
implements Serializable, ImageConsumer.
Class for saving an image in the PNG format. We always use 24-bit RGB true-color coding for the moment.


Variable Index

 o FORMAT_CODE
 o FORMAT_COMPLETE_NAME
 o FORMAT_EXTENSION

Constructor Index

 o PNGImageSaver()

Method Index

 o checkSave()
Return ImageObserver constants for indicating the state of the image saving.
 o getFormatCode()
ImageSaverInterface method implementations.
 o getFormatExtension()
 o getFormatString()
 o getUseAlphaChannel()
Returns if an alpha channel is to be used or not.
 o imageComplete(int)
Get imageComplete message so that we can close the output file.
 o saveIt()
Save the image.
 o setColorModel(ColorModel)
If the default color model is an indexed color model and if it has a transparency pixel, then we put in an alpha channel.
 o setDimensions(int, int)
 o setHints(int)
 o setPixels(int, int, int, int, ColorModel, byte[], int, int)
Write the pixels into the file as RGB data.
 o setPixels(int, int, int, int, ColorModel, int[], int, int)
 o setProperties(Hashtable)
ImageConsumer method implementations.
 o setUseAlphaChannel(boolean)
Indicate if an alpha channel should be used or not.

Variables

 o FORMAT_CODE
 public static final String FORMAT_CODE
 o FORMAT_COMPLETE_NAME
 public static final String FORMAT_COMPLETE_NAME
 o FORMAT_EXTENSION
 public static final String FORMAT_EXTENSION

Constructors

 o PNGImageSaver
 public PNGImageSaver()

Methods

 o getFormatCode
 public String getFormatCode()
ImageSaverInterface method implementations.

Overrides:
getFormatCode in class ImageSaverInterface
 o getFormatString
 public String getFormatString()
Overrides:
getFormatString in class ImageSaverInterface
 o getFormatExtension
 public String getFormatExtension()
Overrides:
getFormatExtension in class ImageSaverInterface
 o saveIt
 public boolean saveIt()
Save the image.

Overrides:
saveIt in class ImageSaverInterface
 o checkSave
 public int checkSave()
Return ImageObserver constants for indicating the state of the image saving.

Overrides:
checkSave in class ImageSaverInterface
 o getUseAlphaChannel
 public boolean getUseAlphaChannel()
Returns if an alpha channel is to be used or not.

 o setUseAlphaChannel
 public void setUseAlphaChannel(boolean use)
Indicate if an alpha channel should be used or not.

 o setProperties
 public void setProperties(Hashtable props)
ImageConsumer method implementations.

 o setHints
 public void setHints(int hintflags)
 o setColorModel
 public void setColorModel(ColorModel model)
If the default color model is an indexed color model and if it has a transparency pixel, then we put in an alpha channel.

 o setDimensions
 public void setDimensions(int w,
                           int h)
 o setPixels
 public void setPixels(int x,
                       int y,
                       int w,
                       int h,
                       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.

See Also:
 o setPixels
 public void setPixels(int x,
                       int y,
                       int w,
                       int h,
                       ColorModel model,
                       int pixels[],
                       int off,
                       int scansize)
See Also:
 o imageComplete
 public void imageComplete(int status)
Get imageComplete message so that we can close the output file.

See Also:

All Packages  Class Hierarchy  This Package  Previous  Next  Index