|
JIGL v1.6 |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--java.awt.Component
|
+--jigl.image.io.ImageInputStream
ImageInputStream will read a image file(PBM, PGM, PPM, PRGM, PRCM, GIF, JPG or JPEG) and store the
content in a InputSream object.
.pgm and .pbm -> GrayImage
.prgm -> RealGrayImage
.ppm -> ColorImage
.prcm -> RealColorImage
.gif, .jpg and .jpeg -> ColorImage
| Nested Class Summary |
| Nested classes inherited from class java.awt.Component |
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
private int |
bits
Current bytes value. |
private int |
bitshift
Current bit position in the current byte. |
protected BufferedInputStream |
data
InputStream for the Data |
protected Image |
img
Image that will be loaded (Protected) |
private static int |
JIGL_COLOR
Flag of one file type |
private static int |
JIGL_GRAY
Flag of one file type |
protected int |
maxval
Maximum value (integer) of the Image (Protected) |
protected float |
maxvalf
Maximum value (float) of the Image (Protected) |
protected int |
ndims
Number of dimensions the image has (Protected) |
private static int |
PBM_ASCII
Flag of one file type |
private static int |
PBM_RAW
Flag of one file type |
private static int |
PGM_ASCII
Flag of one file type |
private static int |
PGM_RAW
Flag of one file type |
private static int |
PPM_ASCII
Flag of one file type |
private static int |
PPM_RAW
Flag of one file type |
private static int |
PRCM_RAW
Flag of one file type |
private static int |
PRGM_RAW
Flag of one file type |
private static int |
TIFF
Flag of one file type |
private int |
type
Type of the file: |
private static int |
UNKNOWN
Flag of one file type |
protected int |
X
Width of the image (Protected) |
protected int |
Y
Height of the image (Protected) |
| Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
ImageInputStream(ImageInputStream stream)
Constructs a ImageInputStream object from another ImageInputStream object (shallow copy). |
|
ImageInputStream(String fn)
Constructs a ImageInputStream object from a image file. |
|
ImageInputStream(String url,
int i)
Constructs a ImageInputStream object from an online file. |
|
| Method Summary | |
void |
close()
Closes the InputStream |
private float |
fixDepth(float p)
|
private int |
fixDepth(int p)
Utility routine to rescale a pixel value from a non-eight-bit maxval. |
int |
ndims()
Returns the number of Dimensions that the image has |
Image |
read()
Reads in the Image |
private boolean |
readBit(InputStream in)
Utility routine to read a bit, packed eight to a byte, big-endian. |
private int |
readByte(InputStream data)
Utility routine to read a byte. |
private float |
readBytef(InputStream data)
|
private char |
readChar(InputStream data)
Utility routine to read a character, ignoring comments. |
private float |
readFloat(InputStream data)
Utility function |
void |
readHeader()
Reads the file header: determines type, size and range of values |
private int |
readInt(InputStream data)
Utility routine to read an ASCII integer, ignoring comments. |
int |
readMagic()
Gets the magic number and returns the type |
private char |
readNonwhiteChar(InputStream data)
Utility routine to read the first non-whitespace character. |
int |
type()
Returns the type of image UNKNOWN = 0 PGM_ASCII = 1 PGM_ASCII = 2 PPM_ASCII = 3 PBM_RAW = 4 PGM_RAW = 5 PPM_RAW = 6 GIF = 7 -- not yet implemented JPEG = 8 -- not yet implemented TIFF = 9 -- not yet implemented JIGL_GRAY = 10 JIGL_COLOR = 11 |
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, wait, wait, wait |
| Field Detail |
protected BufferedInputStream data
protected int ndims
protected int X
protected int Y
protected Image img
private int type
private static final int UNKNOWN
private static final int PBM_ASCII
private static final int PGM_ASCII
private static final int PPM_ASCII
private static final int PBM_RAW
private static final int PGM_RAW
private static final int PPM_RAW
private static final int PRGM_RAW
private static final int PRCM_RAW
private static final int TIFF
private static final int JIGL_GRAY
private static final int JIGL_COLOR
protected int maxval
protected float maxvalf
private int bitshift
private int bits
| Constructor Detail |
public ImageInputStream(String fn)
throws InterruptedException,
FileNotFoundException,
ImageNotSupportedException,
IOException
fn - the filename to open
public ImageInputStream(String url,
int i)
throws InterruptedException,
IOException,
ImageNotSupportedException,
MalformedURLException
url - the complete URLpublic ImageInputStream(ImageInputStream stream)
| Method Detail |
public int ndims()
public int X()
public int Y()
public int type()
public void close()
throws IOException
IOException
public int readMagic()
throws ImageNotSupportedException,
IOException
ImageNotSupportedException
IOException
public void readHeader()
throws ImageNotSupportedException,
IOException
ImageNotSupportedException
IOException
public Image read()
throws ImageNotSupportedException,
IllegalPBMFormatException,
IOException
ImageNotSupportedException
IllegalPBMFormatException
IOException
private int readByte(InputStream data)
throws IOException
IOException
private float readBytef(InputStream data)
throws IOException
IOException
private int readInt(InputStream data)
throws IOException
IOException
private float readFloat(InputStream data)
throws IOException
IOException
private char readChar(InputStream data)
throws IOException
IOException
private char readNonwhiteChar(InputStream data)
throws IOException
IOExceptionprivate int fixDepth(int p)
private float fixDepth(float p)
private boolean readBit(InputStream in)
throws IOException
IOException
|
JIGL v1.6 |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||