JIGL
v1.6

jigl.image.io
Class ImageInputStreamJAI

java.lang.Object
  |
  +--jigl.image.io.ImageInputStreamJAI

public class ImageInputStreamJAI
extends Object

ImageInputStreamJAI reads in the following file types: PGM,PPM,PNG,JPEG,TIFF,GIF using the Java Advanced Imaging API and com.sun.media.jai.codec package.


Field Summary
private  BufferedInputStream data
          Stores the image content.
protected  boolean grayImg
          Flag of whether the loaded image is gray image.
protected  PlanarImage img
          Image that will be loaded
private  String name
          File name of loaded image file
protected  int type
          Image type
protected  int X
          Width of the image
protected  int Y
          Height of the image
 
Constructor Summary
ImageInputStreamJAI()
           
ImageInputStreamJAI(String fn)
          Opens a ImageInputSteamJAI from a filename.
 
Method Summary
 Image read()
          Reads data from a InputStream object and returns a JIGL image..
private  int readByte(InputStream data)
          Utility routine to read a byte from a InputStream object.
protected  PlanarImage readImage(String filename)
          Utility routine to read directly from an image file and returns a PlanarImage.
 int readMagic()
          Gets the magic number and returns the type
 int X()
          Returns the width of the image
 int Y()
          Returns the height of the image
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

X

protected int X
Width of the image


Y

protected int Y
Height of the image


img

protected PlanarImage img
Image that will be loaded


grayImg

protected boolean grayImg
Flag of whether the loaded image is gray image.


type

protected int type
Image type


data

private BufferedInputStream data
Stores the image content.


name

private String name
File name of loaded image file

Constructor Detail

ImageInputStreamJAI

public ImageInputStreamJAI()

ImageInputStreamJAI

public ImageInputStreamJAI(String fn)
                    throws IOException
Opens a ImageInputSteamJAI from a filename.

Parameters:
fn - the filename to open
Method Detail

readByte

private int readByte(InputStream data)
              throws IOException
Utility routine to read a byte from a InputStream object.

IOException

readMagic

public int readMagic()
              throws IOException
Gets the magic number and returns the type

IOException

read

public Image read()
           throws InterruptedException,
                  ImageNotSupportedException,
                  IllegalPBMFormatException,
                  IOException
Reads data from a InputStream object and returns a JIGL image..

InterruptedException
ImageNotSupportedException
IllegalPBMFormatException
IOException

X

public int X()
Returns the width of the image


Y

public int Y()
Returns the height of the image


readImage

protected PlanarImage readImage(String filename)
                         throws IOException
Utility routine to read directly from an image file and returns a PlanarImage.

IOException

JIGL
v1.6

Submit a bug or feature
Revised in May 2002 by Weiming Liu