|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Image
Image represents any type of image support by sub-packages of
us.zuercher.gpx2map.image
.
Method Summary | |
---|---|
void |
close()
Closes the image file. |
int |
getDepth()
Returns the image's raster depth. |
int |
getHeight()
Returns the image's height. |
int[][] |
getNextRasterLine()
Reads the next raster line from the image. |
int[][][] |
getRaster()
Returns an array of rasters for this image. |
int |
getWidth()
Returns the image's width. |
boolean |
hasAlphaChannel()
Returns true if the NetpbmImage implementation supports alpha-channel values. |
Method Detail |
---|
boolean hasAlphaChannel()
int getWidth()
int getHeight()
int getDepth()
hasAlphaChannel()
is
false, this value is 1 (grayscale) or 3 (RGB color). If the image
has an alpha channel, this value is 2 (grayscale + alpha) or 4
(RGB color + alpha).
int[][][] getRaster() throws IOException
getDepth()
. The alpha channel, if
present
uses the last channel (e.g.
getDepth() - 1
).
The following pseudo-code shows the dimensions of the array:
int h = image.getHeight(); int w = image.getWidth(); int c = image.getDepth(); int[][][] rasterData = new int[h][w][c];
Note: Either this method or getNextRasterLine()
may be
used to retrieve raster data. They cannot be combined.
IOException
- if there's an error reading raster data for the
imageint[][] getNextRasterLine() throws IOException
The dimension of the second rank of the array is always at least
the image's depth
. Although it may be larger,
extra elements should be ignored. If hasAlphaChannel()
returns true
, the last channel (based on
getDepth()
) is the alpha channel.
Once all raster lines have been read, you should release resources
by calling close()
.
Note: Either this method or getRaster()
may be used
to retrieve raster data. They cannot be combined.
IOException
- on file errorvoid close() throws IOException
IOException
- if there's an error closing the file
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |