All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class picture.PpmEncoder

java.lang.Object
   |
   +----picture.ImageEncoder
           |
           +----picture.PpmEncoder

public class PpmEncoder
extends ImageEncoder
Write out an image as a PPM.

Writes an image onto a specified OutputStream in the PPM file format.

Fetch the software.
Fetch the entire Acme package.

See Also:
ToPpm

Constructor Index

 o PpmEncoder(Image, OutputStream)
Constructor.
 o PpmEncoder(ImageProducer, OutputStream)
Constructor.

Method Index

 o encodeDone()
Subclasses implement this to finish an encoding.
 o encodePixels(int, int, int, int, int[], int, int)
Subclasses implement this to actually write out some bits.
 o encodeStart(int, int)
Subclasses implement this to initialize an encoding.
 o writeString(OutputStream, String)

Constructors

 o PpmEncoder
 public PpmEncoder(Image img,
                   OutputStream out) throws IOException
Constructor.

Parameters:
img - The image to encode.
out - The stream to write the PPM to.
 o PpmEncoder
 public PpmEncoder(ImageProducer prod,
                   OutputStream out) throws IOException
Constructor.

Parameters:
prod - The ImageProducer to encode.
out - The stream to write the PPM to.

Methods

 o encodeStart
 void encodeStart(int width,
                  int height) throws IOException
Subclasses implement this to initialize an encoding.

Overrides:
encodeStart in class ImageEncoder
 o writeString
 static void writeString(OutputStream out,
                         String str) throws IOException
 o encodePixels
 void encodePixels(int x,
                   int y,
                   int w,
                   int h,
                   int rgbPixels[],
                   int off,
                   int scansize) throws IOException
Subclasses implement this to actually write out some bits.

Overrides:
encodePixels in class ImageEncoder
 o encodeDone
 void encodeDone() throws IOException
Subclasses implement this to finish an encoding.

Overrides:
encodeDone in class ImageEncoder

All Packages  Class Hierarchy  This Package  Previous  Next  Index