|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectus.zuercher.gpx2map.image.netpbm.AbstractNetpbmImage
us.zuercher.gpx2map.image.netpbm.PpmImage
public class PpmImage
PpmImage is a read-only representation of a PPM image. It supports reading both 1- and 2-byte pixel color values, but only the binary PPM format. Images are converted to "maxval 255" as part of loading.
| Field Summary | |
|---|---|
private static int |
DEPTH
PPM depth is always 3. |
static String |
NETPBM_PPM_MAGIC_NUMBER
Magic number for a Netpbm PPM image. |
private int[][] |
rasterLine
Pixelized raster line. |
private byte[] |
rasterLineData
Buffer space for a single raster-line of the image. |
| Fields inherited from class us.zuercher.gpx2map.image.netpbm.AbstractNetpbmImage |
|---|
header, height, input, width |
| Constructor Summary | |
|---|---|
PpmImage(InputStream input)
Constructs a new PpmImage from the given InputStream. |
|
| Method Summary | |
|---|---|
int |
getDepth()
PPM images are always depth 3. |
int[][] |
getNextRasterLine()
Reads the next raster from the PPM file. |
boolean |
hasAlphaChannel()
PPM images do not contain alpha-channel information. |
protected void |
readHeader()
Reads the image's header block. |
| Methods inherited from class us.zuercher.gpx2map.image.netpbm.AbstractNetpbmImage |
|---|
adjustToMaxVal255, close, getHeader, getHeight, getMaxVal, getOriginalBytesPerPixelPerColor, getRaster, getWidth, readWord, setOriginalMaxVal, skipWS |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String NETPBM_PPM_MAGIC_NUMBER
private static final int DEPTH
private byte[] rasterLineData
private int[][] rasterLine
| Constructor Detail |
|---|
PpmImage(InputStream input)
InputStream.
input - the input stream| Method Detail |
|---|
public boolean hasAlphaChannel()
public int getDepth()
public int[][] getNextRasterLine()
throws IOException
IOException - on file error
protected void readHeader()
throws IOException
readHeader in class AbstractNetpbmImageIOException - if the image head cannot be read or is invalid
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||