com.sun.jimi.core.encoder.png
Class PNGEncoder

java.lang.Object
  |
  +--com.sun.jimi.core.util.ProgressMonitorSupport
        |
        +--com.sun.jimi.core.compat.JimiEncoderBase
              |
              +--com.sun.jimi.core.encoder.png.PNGEncoder

public class PNGEncoder
extends JimiEncoderBase
implements PNGConstants

This class encodes an image into the PNG image file format to an outputstream.
There is currently no support for outputting 16 bit depth images in any way shape or form. JimiImage has no support for this and this Encoder while easilly extended has no implementation for 16 bit channel images.
Currently the following color type PNG image can not be output PNG_COLOR_TYPE_GRAY_ALPHA.

 The following Properties are supported by this
 PNG image file Encoder and control the specified options.
  means not available. When the property is not set or the
 value of the property is not a recognised one.
 Property		Value		Controls
 ---------------------------------
 alpha		true		an alpha channel is written with the file
							if one logically be derived or built for the given
							image format.
				false		alpha channel discarded if one is available to write
 						Alpha channel is written if an alpha channel seems
							to be non-trivial for the image

 compression
				None		these control the deflater compresion code options
				Fast		[currently implemented but no affect]
				Default
				Max

 interlace [not implemented yet]
				None		these control the png interlace writing options
				Adam7

 filter [not implemented yet]
				None		these control the png filtering options
				Sub
				Up
				Avg
				Paeth
				All
						Filtering is special because more than one of these
						properties set allows total control of filters used.

 
The following specification "PNG (Portable Network Graphics) Specification Version 1.0" was referenced for the development of this encoder.
Some of the naming conventions and clarification of some aspects of PNG file format were obtained from the following:
libpng 1.0 beta 6 - version 0.96
Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
Copyright (c) 1996, 1997 Andreas Dilger
May 12, 1997


Fields inherited from class com.sun.jimi.core.compat.JimiEncoderBase
currentImage, DONE, ERROR, factory, MAX_COLORS_RGB, MULTIIMAGE, NEXTIMAGE
 
Fields inherited from class com.sun.jimi.core.util.ProgressMonitorSupport
currentProgressLevel, progressListener
 
Constructor Summary
PNGEncoder()
           
 
Method Summary
 boolean driveEncoder()
           
 void freeEncoder()
           
 OptionsObject getOptionsObject()
           
 int getState()
           
protected  void initSpecificEncoder(java.io.OutputStream out, AdaptiveRasterImage ji)
          intialise the required pieces for output of a PNG file
 void setAlpha(java.lang.Boolean val)
           
 
Methods inherited from class com.sun.jimi.core.compat.JimiEncoderBase
createAdaptiveRasterImage, createAdaptiveRasterImage, encodeImage, encodeImage, encodeImages, encodeImages, getCapabilties, getJimiImage, getMaxColors, setJimiImage, setNumberOfImages, setProgress
 
Methods inherited from class com.sun.jimi.core.util.ProgressMonitorSupport
setProgressListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PNGEncoder

public PNGEncoder()
Method Detail

initSpecificEncoder

protected void initSpecificEncoder(java.io.OutputStream out,
                                   AdaptiveRasterImage ji)
                            throws JimiException
intialise the required pieces for output of a PNG file
Overrides:
initSpecificEncoder in class JimiEncoderBase

driveEncoder

public boolean driveEncoder()
                     throws JimiException
Overrides:
driveEncoder in class JimiEncoderBase

freeEncoder

public void freeEncoder()
                 throws JimiException
Overrides:
freeEncoder in class JimiEncoderBase

getState

public int getState()
Overrides:
getState in class JimiEncoderBase

getOptionsObject

public OptionsObject getOptionsObject()

setAlpha

public void setAlpha(java.lang.Boolean val)