com.klg.jclass.util.swing.encode
Class PNGEncoder
java.lang.Object
|
+--com.klg.jclass.util.swing.encode.AbstractImageEncoder
|
+--com.klg.jclass.util.swing.encode.PNGEncoder
- All Implemented Interfaces:
- Encoder
- public class PNGEncoder
- extends AbstractImageEncoder
This class encodes a Png file from an Image to an OutputStream. Color
depths 8, 16, 24 and 32 are supported. No additional Png blocks except
those absolutely necessary for Png encoding are included.
Methods inherited from class com.klg.jclass.util.swing.encode.AbstractImageEncoder |
byteFromChar, byteFromInt, bytesFromInt, bytesFromLong, compressColor, compressColor, createByte, encode, encode, error, snapshot, snapshotJava3d |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PNGEncoder
public PNGEncoder()
saveImage
public void saveImage(Image img,
OutputStream ofile)
throws IOException,
EncoderException
- Specified by:
saveImage
in class AbstractImageEncoder
IOException
EncoderException
compress
public int compress(byte[] outarray,
int[] pixelarray,
ColorModel cmodel,
int width,
int height)
throws EncoderException
EncoderException
compress
public int compress(byte[] outarray,
byte[] pixelarray,
int width,
int height)
throws EncoderException
EncoderException