|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.imageio.ImageReader org.geotools.image.io.SimpleImageReader org.geotools.image.io.TextImageReader org.geotools.image.io.TextRecordImageReader
Image decoder for text files storing pixel values as records. Such text files use one line (record) by pixel. Each line contains at least 3 columns (in arbitrary order):
From this decoder point of view, the two first columns (longitude and latitude) are pixel's logical coordinate (x,y), while the three last columns are three image's bands. The whole file contains only one image (unless45.1250 -29.8750 -7.28 10.3483 -0.3164 45.1250 -29.6250 -4.97 11.8847 3.6192 45.1250 -29.3750 -2.91 3.7900 3.0858 45.1250 -29.1250 -3.48 -5.1833 -5.0759 45.1250 -28.8750 -4.36 -1.8129 -16.3689 45.1250 -28.6250 -3.91 7.5577 -24.6801(...etc...)
SimpleImageReader.getNumImages(boolean)
has been overridden). All (x,y)
coordinates belong to pixel's center. This decoder will automatically translate
(x,y) coordinates from logical space to pixel space. The
getTransform(int)
method provides a convenient AffineTransform
for
performing coordinate transformations between pixel and logical spaces.
Charset
and Locale
, and that there is no pad value. The easiest way to change
the default setting is to create a TextRecordImageReader.Spi
subclass. There is no need to subclass
, unless you want more control on the decoding process.
Nested Class Summary | |
static class |
TextRecordImageReader.Spi
Service provider interface (SPI) for TextRecordImageReader s.
|
Field Summary |
Fields inherited from class javax.imageio.ImageReader |
availableLocales, ignoreMetadata, input, locale, minIndex, originatingProvider, progressListeners, seekForwardOnly, updateListeners, warningListeners, warningLocales |
Constructor Summary | |
TextRecordImageReader(javax.imageio.spi.ImageReaderSpi provider)
Construit un d?codeur d'images de type DataBuffer.TYPE_FLOAT . |
|
TextRecordImageReader(javax.imageio.spi.ImageReaderSpi provider,
int rawImageType)
Construit un d?codeur d'images. |
Method Summary | |
int |
getColumnX(int imageIndex)
Retourne le num?ro de colonne des x, compt? ? partir de 0. |
int |
getColumnY(int imageIndex)
Retourne le num?ro de colonne des y, compt? ? partir de 0. |
javax.media.jai.util.Range |
getExpectedRange(int imageIndex,
int band)
Retourne la valeur minimale et maximale m?moris?e dans une bande de l'image. |
int |
getHeight(int imageIndex)
Returns the height in pixels of the given image within the input source. |
java.awt.geom.Rectangle2D |
getLogicalBounds(int imageIndex)
Returns the smallest bounding box containing the full image in user coordinates. |
int |
getNumBands(int imageIndex)
Returns the number of bands available for the specified image. |
java.awt.geom.AffineTransform |
getTransform(int imageIndex)
Returns an AffineTransform for transforming pixel coordinates
to logical coordinates. |
int |
getWidth(int imageIndex)
Returns the width in pixels of the given image within the input source. |
protected double[] |
parseLine(java.lang.String line,
double[] values)
Convertit une ligne en valeurs num?riques. |
java.awt.image.BufferedImage |
read(int imageIndex,
javax.imageio.ImageReadParam param)
Reads the image indexed by and returns it as a complete buffered image. |
void |
reset()
Replace le d?codeur dans son ?tat initial. |
void |
setInput(java.lang.Object input,
boolean seekForwardOnly,
boolean ignoreMetadata)
Sp?cifie le flot ? utiliser en entr?. |
Methods inherited from class org.geotools.image.io.TextImageReader |
getCharset, getLineFormat, getPadValue, getPositionString, getRawDataType, getReader |
Methods inherited from class org.geotools.image.io.SimpleImageReader |
getImageMetadata, getImageTypes, getNumImages, getRawImageType, getStreamMetadata |
Methods inherited from class javax.imageio.ImageReader |
abort, abortRequested, addIIOReadProgressListener, addIIOReadUpdateListener, addIIOReadWarningListener, canReadRaster, checkReadParamBandSettings, clearAbortRequest, computeRegions, dispose, getAspectRatio, getAvailableLocales, getDefaultReadParam, getDestination, getFormatName, getImageMetadata, getInput, getLocale, getMinIndex, getNumThumbnails, getOriginatingProvider, getSourceRegion, getStreamMetadata, getThumbnailHeight, getThumbnailWidth, getTileGridXOffset, getTileGridYOffset, getTileHeight, getTileWidth, hasThumbnails, isIgnoringMetadata, isImageTiled, isRandomAccessEasy, isSeekForwardOnly, processImageComplete, processImageProgress, processImageStarted, processImageUpdate, processPassComplete, processPassStarted, processReadAborted, processSequenceComplete, processSequenceStarted, processThumbnailComplete, processThumbnailPassComplete, processThumbnailPassStarted, processThumbnailProgress, processThumbnailStarted, processThumbnailUpdate, processWarningOccurred, processWarningOccurred, read, readAll, readAll, readAsRenderedImage, readerSupportsThumbnails, readRaster, readThumbnail, readTile, readTileRaster, removeAllIIOReadProgressListeners, removeAllIIOReadUpdateListeners, removeAllIIOReadWarningListeners, removeIIOReadProgressListener, removeIIOReadUpdateListener, removeIIOReadWarningListener, setInput, setInput, setLocale |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public TextRecordImageReader(javax.imageio.spi.ImageReaderSpi provider)
DataBuffer.TYPE_FLOAT
.
provider
- Le fournisseur
qui a construit ce d?codeur.public TextRecordImageReader(javax.imageio.spi.ImageReaderSpi provider, int rawImageType)
provider
- Le fournisseur qui a construit ce d?codeur.rawImageType
- Type par d?faut des images. Ce type devrait ?tre une des
constantes de DataBuffer
, notamment DataBuffer.TYPE_INT
ou DataBuffer.TYPE_FLOAT
. Le type DataBuffer.TYPE_DOUBLE
est accept? mais d?conseill?, ?tant donn? que l'impl?mentation actuelle
ne lira les donn?es qu'avec la pr?cision des types .Method Detail |
public int getColumnX(int imageIndex) throws java.io.IOException
TextRecordImageReader.Spi
qui a cr?? ce d?codeur. Les classes
d?riv?es peuvent red?finir cette m?thode pour d?terminer cette valeur
d'une fa?on plus ?labor?e.
imageIndex
- Index de l'image ? lire.
java.io.IOException
- si l'op?ration n?cessitait une lecture du fichier (par exemple
des informations inscrites dans un en-t?te) et que cette lecture a ?chou?e.public int getColumnY(int imageIndex) throws java.io.IOException
TextRecordImageReader.Spi
qui a cr?? ce d?codeur. Les classes
d?riv?es peuvent red?finir cette m?thode pour d?terminer cette valeur
d'une fa?on plus ?labor?e.
imageIndex
- Index de l'image ? lire.
java.io.IOException
- si l'op?ration n?cessitait une lecture du fichier (par exemple
des informations inscrites dans un en-t?te) et que cette lecture a ?chou?e.public void setInput(java.lang.Object input, boolean seekForwardOnly, boolean ignoreMetadata)
File
,
URL
ou BufferedReader
.
Les flots de type Reader
, InputStream
et
ImageInputStream
sont aussi accept?s, mais
moins conseill?s.
setInput
in class TextImageReader
public int getNumBands(int imageIndex) throws java.io.IOException
getNumBands
in class SimpleImageReader
imageIndex
- The image index.
java.io.IOException
- if an error occurs reading the information from the
input source.public int getWidth(int imageIndex) throws java.io.IOException
imageIndex
- the index of the image to be queried.
java.io.IOException
- If an error occurs reading the width information from
the input source.public int getHeight(int imageIndex) throws java.io.IOException
imageIndex
- the index of the image to be queried.
java.io.IOException
- If an error occurs reading the height information
from the input source.public java.awt.geom.Rectangle2D getLogicalBounds(int imageIndex) throws java.io.IOException
(xmin-dx/2, ymin-dy/2)
) and
(xmax+dx/2, ymax+dy/2)
) points, where dx and
dy are grid cell width and height (i.e. the smallest interval between
x and y values).
imageIndex
- the index of the image to be queried.
java.io.IOException
- If an error occurs reading the width information from
the input source.public java.awt.geom.AffineTransform getTransform(int imageIndex) throws java.io.IOException
AffineTransform
for transforming pixel coordinates
to logical coordinates. Pixel coordinates are usually integer values
with (0,0) at the image's upper-left corner, while logical coordinates
are floating point values at the pixel's upper-left corner. The later
is consistent with Java
Advanced Imaging convention. In order to get logical values at the pixel
center, a translation must be apply once as below:
The default implementation compute the affine transform fromAffineTransform tr = getTransform(imageIndex); tr.translate(0.5, 0.5);
getLogicalBounds(int)
.
imageIndex
- The 0-based image index.
java.io.IOException
- if an I/O operation failed.public javax.media.jai.util.Range getExpectedRange(int imageIndex, int band) throws java.io.IOException
getExpectedRange
in class SimpleImageReader
imageIndex
- Index de l'image dont on veut conna?tre la plage de valeurs.band
- Bande pour laquelle on veut la valeur minimale. Les num?ros de
bandes commencent ? 0 et sont ind?pendents des valeurs qui peuvent
avoir ?t? sp?cifi?es ? IIOParam.setSourceBands(int[])
.
java.io.IOException
- si l'op?ration a ?chou?e ? cause d'une erreur d'entr?s/sorties.protected double[] parseLine(java.lang.String line, double[] values) throws java.text.ParseException
Double.NaN
dans toutes les colonnes sauf celles
des coordonn?es x et y.
line
- Ligne ? d?coder.values
- Derni?res valeurs ? avoir ?t? lues, ou si cette ligne
est la premi?re ? ?tre d?cod?e. Ce buffer peut ?tre r?utilis? en ?crasant
les anciennes valeurs par les nouvelles valeurs de la ligne .
java.text.ParseException
- si une erreur est survenue lors du d?codage de la ligne.public java.awt.image.BufferedImage read(int imageIndex, javax.imageio.ImageReadParam param) throws java.io.IOException
imageIndex
- the index of the image to be retrieved.param
- Parameters used to control the reading process, or .
java.io.IOException
- if an error occurs during reading.public void reset()
reset
in class TextImageReader
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |