com.partnersoft.v3x.graphics.codec.png
Class PNGEncoder

java.lang.Object
  extended by com.partnersoft.v3x.graphics.codec.png.PNGEncoder
All Implemented Interfaces:
ImageEncoder

public class PNGEncoder
extends java.lang.Object
implements ImageEncoder


Constructor Summary
PNGEncoder(int width, int height)
          A handy default constructor.
 
Method Summary
 void encodeImage(java.awt.Image nimage, java.io.OutputStream out)
           
 void encodeImage(java.awt.Image nimage, java.lang.String filename)
           
 void grabPixels()
          Grabs a line of pixels into the pixels array
 void writeImageChunk()
          this is the strangest of them all but somehow works!!! this uses the zlib compression and several buffers to write the non filtered data to the outfile stream
 void writePNGEnd()
          this will write the "trailer" for the PNG file
 void writePNGHeader()
          this will write the identifier for png files this should always happen first
 void writePNGImageHeader()
          this will write the image header for the image including default simple settings and specifing the image characteristics
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PNGEncoder

public PNGEncoder(int width,
                  int height)
A handy default constructor.

Method Detail

encodeImage

public void encodeImage(java.awt.Image nimage,
                        java.lang.String filename)
                 throws java.io.IOException
Specified by:
encodeImage in interface ImageEncoder
Throws:
java.io.IOException

encodeImage

public void encodeImage(java.awt.Image nimage,
                        java.io.OutputStream out)
                 throws java.io.IOException
Throws:
java.io.IOException

writePNGImageHeader

public void writePNGImageHeader()
                         throws java.io.IOException
this will write the image header for the image including default simple settings and specifing the image characteristics

Throws:
java.io.IOException

writePNGHeader

public void writePNGHeader()
                    throws java.io.IOException
this will write the identifier for png files this should always happen first

Throws:
java.io.IOException

grabPixels

public void grabPixels()
                throws java.io.IOException
Grabs a line of pixels into the pixels array

Throws:
java.io.IOException

writeImageChunk

public void writeImageChunk()
                     throws java.io.IOException
this is the strangest of them all but somehow works!!! this uses the zlib compression and several buffers to write the non filtered data to the outfile stream

Throws:
java.io.IOException

writePNGEnd

public void writePNGEnd()
                 throws java.io.IOException
this will write the "trailer" for the PNG file

Throws:
java.io.IOException