com.vwp.awt.image
Class ImagePNGData

java.lang.Object
  extended by com.vwp.awt.image.ImagePNGData

public class ImagePNGData
extends Object

This class is a saver for Images and BufferedImages. It stores these data in the well-known and patent-free PNG fileformat


Field Summary
static boolean ENCODE_ALPHA
          constant specifying that alpha channel should be encoded.
static int FILTER_MAX
           
static int FILTER_NONE
           
static int FILTER_SUB
           
static int FILTER_UP
           
static boolean NO_ALPHA
          constant specifying that alpha channel should not be encoded.
 
Constructor Summary
ImagePNGData()
          Default constructor
ImagePNGData(BufferedImage image)
          Deprecated. Please use class ImageWriter with MIME-type image/png instead!
ImagePNGData(BufferedImage image, boolean encodeAlpha)
          Deprecated. Please use class ImageWriter with MIME-type image/png instead!
ImagePNGData(BufferedImage image, boolean encodeAlpha, int filterType)
          Deprecated. Please use class ImageWriter with MIME-type image/png instead!
ImagePNGData(BufferedImage image, boolean encodeAlpha, int filterType, int compressionStrength)
          Deprecated. Please use class ImageWriter with MIME-type image/png instead!
ImagePNGData(Image image)
          Deprecated. Please use class ImageWriter with MIME-type image/png instead!
ImagePNGData(Image image, boolean encodeAlpha)
          Deprecated. Please use class ImageWriter with MIME-type image/png instead!
ImagePNGData(Image image, boolean encodeAlpha, int filterType)
          Deprecated. Please use class ImageWriter with MIME-type image/png instead!
ImagePNGData(Image image, boolean encodeAlpha, int filterType, int compressionStrength)
          Deprecated. Please use class ImageWriter with MIME-type image/png instead!
 
Method Summary
 int getCompressionLevel()
          Deprecated. Please use class ImageWriter with MIME-type image/png instead!
 boolean getEncodeAlpha()
          Deprecated. Please use class ImageWriter with MIME-type image/png instead!
 int getFilter()
          Deprecated. Please use class ImageWriter with MIME-type image/png instead!
 byte[] pngEncode()
          Deprecated. Please use class ImageWriter with MIME-type image/png instead!
 byte[] pngEncode(boolean encodeAlpha)
          Deprecated. Please use class ImageWriter with MIME-type image/png instead!
 void setCompressionLevel(int level)
          Deprecated. Please use class ImageWriter with MIME-type image/png instead!
 void setFilter(int filterType)
          Deprecated. Please use class ImageWriter with MIME-type image/png instead!
 void setImage(BufferedImage image)
          Deprecated. Please use class ImageWriter with MIME-type image/png instead!
 void setImage(Image image)
          Deprecated. Please use class ImageWriter with MIME-type image/png instead!
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ENCODE_ALPHA

public static final boolean ENCODE_ALPHA
constant specifying that alpha channel should be encoded.

See Also:
Constant Field Values

NO_ALPHA

public static final boolean NO_ALPHA
constant specifying that alpha channel should not be encoded.

See Also:
Constant Field Values

FILTER_NONE

public static final int FILTER_NONE
See Also:
Constant Field Values

FILTER_SUB

public static final int FILTER_SUB
See Also:
Constant Field Values

FILTER_UP

public static final int FILTER_UP
See Also:
Constant Field Values

FILTER_MAX

public static final int FILTER_MAX
See Also:
Constant Field Values
Constructor Detail

ImagePNGData

public ImagePNGData()
Default constructor


ImagePNGData

public ImagePNGData(Image image)
Deprecated. Please use class ImageWriter with MIME-type image/png instead!

Class constructor specifying Image to encode, with no alpha channel encoding.

Parameters:
image - - A Java Image object which uses the DirectColorModel

ImagePNGData

public ImagePNGData(BufferedImage image)
Deprecated. Please use class ImageWriter with MIME-type image/png instead!

Class constructor specifying Image to encode, with no alpha channel encoding.

Parameters:
image - - A Java BufferedImage object which uses the DirectColorModel

ImagePNGData

public ImagePNGData(Image image,
                    boolean encodeAlpha)
Deprecated. Please use class ImageWriter with MIME-type image/png instead!

Class constructor specifying Image to encode, and whether to encode alpha.

Parameters:
image - - A Java Image object which uses the DirectColorModel
encodeAlpha - - encode the alpha channel, false=no; true=yes

ImagePNGData

public ImagePNGData(BufferedImage image,
                    boolean encodeAlpha)
Deprecated. Please use class ImageWriter with MIME-type image/png instead!

Class constructor specifying Image to encode, and whether to encode alpha.

Parameters:
image - - A Java BufferedImage object which uses the DirectColorModel
encodeAlpha - - encode the alpha channel, false=no; true=yes

ImagePNGData

public ImagePNGData(Image image,
                    boolean encodeAlpha,
                    int filterType)
Deprecated. Please use class ImageWriter with MIME-type image/png instead!

Class constructor specifying Image to encode, whether to encode alpha, and filter to use.

Parameters:
image - - A Java Image object which uses the DirectColorModel
encodeAlpha - - encode the alpha channel, false=no; true=yes
filterType - - see filter constants above

ImagePNGData

public ImagePNGData(BufferedImage image,
                    boolean encodeAlpha,
                    int filterType)
Deprecated. Please use class ImageWriter with MIME-type image/png instead!

Class constructor specifying Image to encode, whether to encode alpha, and filter to use.

Parameters:
image - - A Java BufferedImage object which uses the DirectColorModel
encodeAlpha - - encode the alpha channel, false=no; true=yes
filterType - - see filter constants above

ImagePNGData

public ImagePNGData(BufferedImage image,
                    boolean encodeAlpha,
                    int filterType,
                    int compressionStrength)
Deprecated. Please use class ImageWriter with MIME-type image/png instead!

Class constructor specifying Image to encode, whether to encode alpha, and filter to use.

Parameters:
image - - A Java Image object which uses the DirectColorModel
encodeAlpha - - encode the alpha channel, false=no; true=yes
filterType - - see filter constants above
compressionStrength - - level of compression in range 0..9

ImagePNGData

public ImagePNGData(Image image,
                    boolean encodeAlpha,
                    int filterType,
                    int compressionStrength)
Deprecated. Please use class ImageWriter with MIME-type image/png instead!

Class constructor specifying Image to encode, whether to encode alpha, and filter to use.

Parameters:
image - - A Java BufferedImage object which uses the DirectColorModel
encodeAlpha - - encode the alpha channel, false=no; true=yes
filterType - - see filter constants above
compressionStrength - - level of compression in range 0..9
Method Detail

setImage

public void setImage(Image image)
Deprecated. Please use class ImageWriter with MIME-type image/png instead!

Sets the image to be encoded

Parameters:
image - - A Java Image object which uses the DirectColorModel

setImage

public void setImage(BufferedImage image)
Deprecated. Please use class ImageWriter with MIME-type image/png instead!

Sets the image to be encoded

Parameters:
image - - A Java BufferedImage object which uses the DirectColorModel

pngEncode

public byte[] pngEncode()
Deprecated. Please use class ImageWriter with MIME-type image/png instead!

Creates an array of bytes that is the PNG equivalent of the current image. Alpha encoding is not performed.

Returns:
an array of bytes, or null if there was a problem

pngEncode

public byte[] pngEncode(boolean encodeAlpha)
Deprecated. Please use class ImageWriter with MIME-type image/png instead!

Creates an array of bytes that is the PNG equivalent of the current image. Alpha encoding is determined by its setting in the constructor.

Parameters:
encodeAlpha - - specifies if the alpha channel has to be encoded into the PNG data too
Returns:
an array of bytes, or null if there was a problem

getEncodeAlpha

public boolean getEncodeAlpha()
Deprecated. Please use class ImageWriter with MIME-type image/png instead!

Returns the alpha encoding status.


setFilter

public void setFilter(int filterType)
Deprecated. Please use class ImageWriter with MIME-type image/png instead!

Sets the filter to use

Parameters:
filterType - - type of filter to use

getFilter

public int getFilter()
Deprecated. Please use class ImageWriter with MIME-type image/png instead!

Returns the actual filter

Returns:
type of filter which is used

setCompressionLevel

public void setCompressionLevel(int level)
Deprecated. Please use class ImageWriter with MIME-type image/png instead!

Set the compression level

Parameters:
level - - desired compression level

getCompressionLevel

public int getCompressionLevel()
Deprecated. Please use class ImageWriter with MIME-type image/png instead!

Returns the compression level

Returns:
actual compression level