|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.pearsoneduc.ip.io.PPMDecoder
Reads image data in the PBM, PGM or PPM format from a stream or a file.
Documentation for the PPMEncoder
class contains further
information on these formats. Note that only the ASCII variants can
be decoded.
Example of use:
PPMDecoder ppm = new PPMDecoder(inputFile); BufferedImage image = ppm.decodeAsBufferedImage();
PPMDecoderException
,
PPMEncoder
,
BufferedImage
Constructor Summary | |
PPMDecoder()
Constructs a PPMDecoder associated with standard input. |
|
PPMDecoder(java.io.InputStream in)
Constructs a PPMDecoder that reads from an existing InputStream. |
|
PPMDecoder(java.lang.String imgfile)
Constructs a PPMDecoder that reads from a named file. |
Method Summary | |
boolean |
bitmapInversionEnabled()
Indicates whether a binary image will be inverted on input, such that 1 becomes black and 0 becomes white. |
java.awt.image.BufferedImage |
decodeAsBufferedImage()
Decodes the input data and creates an image. |
void |
disableBitmapInversion()
Disables bitmap inversion when reading data in the PBM format. |
void |
enableBitmapInversion()
Enables bitmap inversion when reading data in the PBM format. |
int |
getHeight()
|
int |
getMaxValue()
|
int |
getNumPixels()
|
int |
getType()
Indicates what type of image is available for decoding. |
int |
getWidth()
|
boolean |
isBinary()
Indicates whether binary image data are available for decoding. |
boolean |
isGrey()
Indicates whether greyscale image data are available for decoding. |
boolean |
isRGB()
Indicates whether RGB image data are available for decoding. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public PPMDecoder() throws java.io.IOException, PPMDecoderException
public PPMDecoder(java.io.InputStream in) throws java.io.IOException, PPMDecoderException
in
- InputStream representing the source of image datapublic PPMDecoder(java.lang.String imgfile) throws java.io.IOException, PPMDecoderException
imgfile
- name of the file containing the image dataMethod Detail |
public int getType()
PPMConstants
public boolean isBinary()
public boolean isGrey()
public boolean isRGB()
public int getWidth()
public int getHeight()
public int getNumPixels()
public int getMaxValue()
public boolean bitmapInversionEnabled()
public void disableBitmapInversion()
public void enableBitmapInversion()
public java.awt.image.BufferedImage decodeAsBufferedImage() throws java.io.IOException, PPMDecoderException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |