|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectImageReader
GDALImageReader
public abstract class GDALImageReader
Main abstract class defining the main framework which needs to be used to extend Image I/O architecture using GDAL (Geospatial Data Abstraction Layer) by means of SWIG (Simplified Wrapper and Interface Generator) bindings in order to perform read operations.
| Field Summary |
|---|
| Fields inherited from class ImageReader |
|---|
availableLocales, ignoreMetadata, input, locale, minIndex, originatingProvider, progressListeners, seekForwardOnly, updateListeners, warningListeners, warningLocales |
| Constructor Summary | |
|---|---|
GDALImageReader(GDALImageReaderSpi originatingProvider)
Constructs a GDALImageReader using a
GDALImageReaderSpi. |
|
GDALImageReader(GDALImageReaderSpi originatingProvider,
int numSubdatasets)
Constructs a GDALImageReader using a
GDALImageReaderSpi. |
|
| Method Summary | |
|---|---|
protected void |
checkImageIndex(int imageIndex)
Checks if the specified ImageIndex is valid. |
protected GDALCommonIIOImageMetadata |
createDatasetMetadata(Dataset mainDataset,
String mainDatasetFileName)
Build a proper GDALCommonIIOImageMetadata given an input dataset
as well as the file name containing such a dataset. |
protected GDALCommonIIOImageMetadata |
createDatasetMetadata(String datasetName)
Build a proper GDALCommonIIOImageMetadata given the name of a
dataset. |
void |
dispose()
Allows resources to be released |
GDALCommonIIOImageMetadata |
getDatasetMetadata(int imageIndex)
Retrieves a GDALCommonIIOImageMetadata by index. |
protected File |
getDatasetSource(Object myInput)
Tries to retrieve the Dataset Source for the ImageReader's input. |
int |
getGCPCount(int imageIndex)
Returns the number of Ground Control Points of the Dataset
at index imageIndex. |
String |
getGCPProjection(int imageIndex)
Returns the Ground Control Points projection definition string of the Dataset at index imageIndex. |
List<? extends GCP> |
getGCPs(int imageIndex)
Returns Ground Control Points of the Dataset at index
imageIndex. |
double[] |
getGeoTransform(int imageIndex)
Retrieves the GeoTransformation coefficients for the Dataset
at index imageIndex. |
int |
getHeight(int imageIndex)
Returns the height of the raster of the Dataset at index
imageIndex. |
IIOMetadata |
getImageMetadata(int imageIndex)
Returns an IIOMetadata object containing metadata
associated with the given image, specified by the imageIndex
parameter |
Iterator<ImageTypeSpecifier> |
getImageTypes(int imageIndex)
Returns an Iterator containing possible image types to
which the given image may be decoded, in the form of
ImageTypeSpecifierss. |
double |
getMaximum(int imageIndex,
int band)
Returns the optional Maximum Value of the specified band of the Dataset at index imageIndex. |
double |
getMinimum(int imageIndex,
int band)
Returns the optional Minimum Value of the specified band of the Dataset at index imageIndex. |
double |
getNoDataValue(int imageIndex,
int band)
Returns the NoDataValue of the specified Band of the specified image |
int |
getNumImages(boolean allowSearch)
Returns the number of images (subdatasets) contained within the data source. |
double |
getOffset(int imageIndex,
int band)
Returns the optional Offset Value of the specified band of the Dataset at index imageIndex. |
String |
getProjection(int imageIndex)
Retrieves the WKT projection String for the
Dataset at index imageIndex. |
double |
getScale(int imageIndex,
int band)
Returns the optional Scale Value of the specified band of the Dataset at index imageIndex. |
IIOMetadata |
getStreamMetadata()
Returns an IIOMetadata object representing the metadata
associated with the input source as a whole. |
int |
getTileHeight(int imageIndex)
Returns the tile height of the raster of the Dataset at
index imageIndex. |
int |
getTileWidth(int imageIndex)
Returns the tile width of the raster of the Dataset at
index imageIndex. |
int |
getWidth(int imageIndex)
Returns the width of the raster of the Dataset at index
imageIndex. |
BufferedImage |
read(int imageIndex)
Performs a full read operation. |
BufferedImage |
read(int imageIndex,
ImageReadParam param)
Read the raster and returns a BufferedImage |
Raster |
readRaster(int imageIndex,
ImageReadParam param)
Implements the ImageRead.readRaster method which returns a
new Raster object containing the raw pixel data from the
image stream, without any color conversion applied. |
void |
reset()
Reset main values |
void |
setInput(Object input,
boolean seekForwardOnly,
boolean ignoreMetadata)
Sets the input for the specialized reader. |
| Methods inherited from class ImageReader |
|---|
abort, abortRequested, addIIOReadProgressListener, addIIOReadUpdateListener, addIIOReadWarningListener, canReadRaster, checkReadParamBandSettings, clearAbortRequest, computeRegions, getAspectRatio, getAvailableLocales, getDefaultReadParam, getDestination, getFormatName, getImageMetadata, getInput, getLocale, getMinIndex, getNumThumbnails, getOriginatingProvider, getRawImageType, getSourceRegion, getStreamMetadata, getThumbnailHeight, getThumbnailWidth, getTileGridXOffset, getTileGridYOffset, hasThumbnails, isIgnoringMetadata, isImageTiled, isRandomAccessEasy, isSeekForwardOnly, processImageComplete, processImageProgress, processImageStarted, processImageUpdate, processPassComplete, processPassStarted, processReadAborted, processSequenceComplete, processSequenceStarted, processThumbnailComplete, processThumbnailPassComplete, processThumbnailPassStarted, processThumbnailProgress, processThumbnailStarted, processThumbnailUpdate, processWarningOccurred, processWarningOccurred, readAll, readAll, readAsRenderedImage, readerSupportsThumbnails, readThumbnail, readTile, readTileRaster, removeAllIIOReadProgressListeners, removeAllIIOReadUpdateListeners, removeAllIIOReadWarningListeners, removeIIOReadProgressListener, removeIIOReadUpdateListener, removeIIOReadWarningListener, setInput, setInput, setLocale |
| Methods inherited from class Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public GDALImageReader(GDALImageReaderSpi originatingProvider)
GDALImageReader using a
GDALImageReaderSpi.
originatingProvider - The GDALImageReaderSpi to use for building this
GDALImageReader.
public GDALImageReader(GDALImageReaderSpi originatingProvider,
int numSubdatasets)
GDALImageReader using a
GDALImageReaderSpi.
originatingProvider - The GDALImageReaderSpi to use for building this
GDALImageReader.| Method Detail |
|---|
public GDALCommonIIOImageMetadata getDatasetMetadata(int imageIndex)
GDALCommonIIOImageMetadata by index.
imageIndex - is the index of the required
GDALCommonIIOImageMetadata.
GDALCommonIIOImageMetadataprotected void checkImageIndex(int imageIndex)
imageIndex - the specified imageIndexprotected GDALCommonIIOImageMetadata createDatasetMetadata(String datasetName)
GDALCommonIIOImageMetadata given the name of a
dataset. The default implementation return a
GDALCommonIIOImageMetadata instance.This method should be
overridden by the specialized GDALImageReader in case you need to
obtain a specific GDALCommonIIOImageMetadata's subclass
datasetName - the name of the dataset
protected GDALCommonIIOImageMetadata createDatasetMetadata(Dataset mainDataset,
String mainDatasetFileName)
GDALCommonIIOImageMetadata given an input dataset
as well as the file name containing such a dataset.
protected File getDatasetSource(Object myInput)
public void setInput(Object input,
boolean seekForwardOnly,
boolean ignoreMetadata)
setInput in class ImageReaderIllegalArgumentException - if the provided input is nullpublic void dispose()
dispose in class ImageReaderpublic void reset()
reset in class ImageReader
public Iterator<ImageTypeSpecifier> getImageTypes(int imageIndex)
throws IOException
Iterator containing possible image types to
which the given image may be decoded, in the form of
ImageTypeSpecifierss. At least one legal image type will
be returned. This implementation simply returns an
ImageTypeSpecifier set in compliance with the property of
the dataset contained within the underlying data source.
getImageTypes in class ImageReaderimageIndex - the index of the image to be retrieved.
Iterator containing possible image types to
which the given image may be decoded, in the form of
ImageTypeSpecifierss
IOException
public BufferedImage read(int imageIndex,
ImageReadParam param)
throws IOException
BufferedImage
read in class ImageReaderimageIndex - the index of the image to be retrieved.param - an ImageReadParam used to control the
reading process, or null. Actually,
setting a destinationType allows to specify the number of
bands in the destination image.
BufferedImage
IllegalArgumentException - if param contains an invalid specification
of a source and/or destination band subset or of a
destination image.
IOException - if an error occurs when acquiring access to the
underlying datasource
public Raster readRaster(int imageIndex,
ImageReadParam param)
throws IOException
ImageRead.readRaster method which returns a
new Raster object containing the raw pixel data from the
image stream, without any color conversion applied.
readRaster in class ImageReaderimageIndex - the index of the image to be retrieved.param - an ImageReadParam used to control the
reading process, or null.
Raster.
IOException
public BufferedImage read(int imageIndex)
throws IOException
read in class ImageReaderimageIndex - the index of the image to be retrieved.
IOException
public int getNumImages(boolean allowSearch)
throws IOException
getNumImages in class ImageReaderIOException
public int getWidth(int imageIndex)
throws IOException
Dataset at index
imageIndex.
getWidth in class ImageReaderimageIndex - the index of the specified raster
IOException
public int getHeight(int imageIndex)
throws IOException
Dataset at index
imageIndex.
getHeight in class ImageReaderimageIndex - the index of the specified raster
IOException
public int getTileHeight(int imageIndex)
throws IOException
Dataset at
index imageIndex.
getTileHeight in class ImageReaderimageIndex - the index of the specified raster
IOException
public int getTileWidth(int imageIndex)
throws IOException
Dataset at
index imageIndex.
getTileWidth in class ImageReaderimageIndex - the index of the specified raster
IOExceptionpublic String getProjection(int imageIndex)
String for the
Dataset at index imageIndex.
imageIndex - the index of the dataset we want to get the projections
for.
String for the
Dataset at index imageIndex.public double[] getGeoTransform(int imageIndex)
Dataset
at index imageIndex.
imageIndex - the index of the dataset we want to get the coefficients
for.
public List<? extends GCP> getGCPs(int imageIndex)
Dataset at index
imageIndex.
imageIndex - the index of the specified Dataset
List containing the Ground Control Points.public String getGCPProjection(int imageIndex)
Dataset at index imageIndex.
imageIndex - the index of the specified Dataset
public int getGCPCount(int imageIndex)
Dataset
at index imageIndex.
imageIndex - the index of the specified Dataset
Dataset.
public double getNoDataValue(int imageIndex,
int band)
imageIndex - the specified imageband - the specified band
IllegalArgumentException - in case the specified band number is out of range or
noData value has not been found
public double getOffset(int imageIndex,
int band)
Dataset at index imageIndex.
imageIndex - the index of the specified Datasetband - the specified band
IllegalArgumentException - in case the specified band number is out of range or
Offset value has not been found
public double getScale(int imageIndex,
int band)
Dataset at index imageIndex.
imageIndex - the index of the specified Datasetband - the specified band
IllegalArgumentException - in case the specified band number is out of range or
scale value has not been found
public double getMinimum(int imageIndex,
int band)
Dataset at index imageIndex.
imageIndex - the index of the specified Datasetband - the specified band
IllegalArgumentException - in case the specified band number is out of range or
minimum value has not been found
public double getMaximum(int imageIndex,
int band)
Dataset at index imageIndex.
imageIndex - the index of the specified Datasetband - the specified band
IllegalArgumentException - in case the specified band number is out of range or
maximum value has not been found
public IIOMetadata getStreamMetadata()
throws IOException
IIOMetadata object representing the metadata
associated with the input source as a whole.
getStreamMetadata in class ImageReaderIIOMetadata object.
IOException
public IIOMetadata getImageMetadata(int imageIndex)
throws IOException
IIOMetadata object containing metadata
associated with the given image, specified by the imageIndex
parameter
getImageMetadata in class ImageReaderimageIndex - the index of the required image
IIOMetadata object
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||