Class MaskOverviewProvider
- Object
-
- MaskOverviewProvider
-
public class MaskOverviewProvider extends Object
Helper class used for handling Internal/External overviews and masks for a File- Author:
- Nicola Lagomarsini GeoSolutions
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MaskOverviewProvider.MaskInfo
Helper class used for storing information to use for read the mask data.static class
MaskOverviewProvider.SpiHelper
Helper class containing previous code used to get streamSPI and readerSPI for an input file.
-
Field Summary
Fields Modifier and Type Field Description static String
OVR_EXTENSION
-
Constructor Summary
Constructors Constructor Description MaskOverviewProvider(DatasetLayout layout, File inputFile)
MaskOverviewProvider(DatasetLayout dtLayout, File inputFile, boolean skipOverviews)
MaskOverviewProvider(DatasetLayout layout, File inputFile, ImageReaderSpi suggestedSPI)
MaskOverviewProvider(DatasetLayout layout, File inputFile, MaskOverviewProvider.SpiHelper spiHelper)
MaskOverviewProvider(DatasetLayout layout, URL inputUrl)
MaskOverviewProvider(DatasetLayout layout, URL inputUrl, ImageReaderSpi suggestedSPI)
MaskOverviewProvider(DatasetLayout layout, URL inputUrl, MaskOverviewProvider.SpiHelper spiHelper)
MaskOverviewProvider(DatasetLayout layout, URL inputFile, MaskOverviewProvider.SpiHelper spiHelper, boolean skipExternalLookup)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ImageInputStreamSpi
getExternalOverviewInputStreamSpi()
ImageReaderSpi
getExternalOverviewReaderSpi()
URL
getFileURL()
ImageReaderSpi
getImageReaderSpi()
ImageInputStreamSpi
getInputStreamSpi()
static ImageInputStreamSpi
getInputStreamSPIFromURL(URL fileURL)
Returns anImageInputStreamSpi
instance for the inputURL
DatasetLayout
getLayout()
MaskOverviewProvider.MaskInfo
getMaskInfo(int imageIndex, Rectangle imageBounds, ImageReadParam originalParams)
Returns a newMaskOverviewProvider.MaskInfo
instance containing all the parameters to set for accessing the desired image indexImageReaderSpi
getMaskOvrReaderSpi()
ImageInputStreamSpi
getMaskOvrStreamSpi()
URL
getMaskOvrURL()
ImageReaderSpi
getMaskReaderSpi()
ImageInputStreamSpi
getMaskStreamSpi()
URL
getMaskURL()
int
getNumExternalMasks()
int
getNumExternalMasksOverviews()
int
getNumExternalOverviews()
int
getNumInternalMasks()
int
getNumInternalOverviews()
int
getNumOverviews()
int
getNumOverviews(SourceSPIProvider sourceSpiProvider)
int
getNumOverviews(URL inputFile, ImageInputStreamSpi streamSpi, ImageReaderSpi readerSpi)
int
getOverviewIndex(int imageIndex)
Returns the external/internal overview image index based on the initial imageindex valuedouble[][]
getOverviewResolutions(double span0, double span1)
Returns a double[][] containing the resolutions for all the overviewsURL
getOvrURL()
static ImageReaderSpi
getReaderSpiFromStream(ImageReaderSpi suggestedSPI, ImageInputStream inStream)
Returns anImageReaderSpi
instance for the inputImageInputStream
and the optional suggested spi.SourceSPIProvider
getSourceSpiProvider()
boolean
hasExternalMasks()
boolean
hasExternalMasksOverviews()
boolean
hasMaskIndexForOverview(int imageIndex)
Returns true if there is a mask at the same resolution of the requested oneboolean
isExternalMask(int imageIndex)
Returns true if the defined index is related to an external image mask indexboolean
isExternalMaskOverviews(int imageIndex)
Returns true if the defined index is related to an external image mask overview indexboolean
isExternalOverview(int imageIndex)
Returns true if the defined index is related to an external image overview indexboolean
isSkipExternalLookup()
static ROI
scaleROI(RenderedImage roiRaster, Rectangle bounds)
Returns aROI
object based on the inputRenderedImage
representing ROI
-
-
-
Field Detail
-
OVR_EXTENSION
public static final String OVR_EXTENSION
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MaskOverviewProvider
public MaskOverviewProvider(DatasetLayout layout, File inputFile) throws IOException
- Throws:
IOException
-
MaskOverviewProvider
public MaskOverviewProvider(DatasetLayout layout, File inputFile, ImageReaderSpi suggestedSPI) throws IOException
- Throws:
IOException
-
MaskOverviewProvider
public MaskOverviewProvider(DatasetLayout layout, URL inputUrl) throws IOException
- Throws:
IOException
-
MaskOverviewProvider
public MaskOverviewProvider(DatasetLayout layout, URL inputUrl, ImageReaderSpi suggestedSPI) throws IOException
- Throws:
IOException
-
MaskOverviewProvider
public MaskOverviewProvider(DatasetLayout layout, File inputFile, MaskOverviewProvider.SpiHelper spiHelper) throws IOException
- Throws:
IOException
-
MaskOverviewProvider
public MaskOverviewProvider(DatasetLayout layout, URL inputUrl, MaskOverviewProvider.SpiHelper spiHelper) throws IOException
- Throws:
IOException
-
MaskOverviewProvider
public MaskOverviewProvider(DatasetLayout dtLayout, File inputFile, boolean skipOverviews) throws IOException
- Throws:
IOException
-
MaskOverviewProvider
public MaskOverviewProvider(DatasetLayout layout, URL inputFile, MaskOverviewProvider.SpiHelper spiHelper, boolean skipExternalLookup) throws IOException
- Throws:
IOException
-
-
Method Detail
-
getNumOverviews
public int getNumOverviews(SourceSPIProvider sourceSpiProvider)
-
getNumOverviews
public int getNumOverviews(URL inputFile, ImageInputStreamSpi streamSpi, ImageReaderSpi readerSpi)
-
getOverviewIndex
public int getOverviewIndex(int imageIndex)
Returns the external/internal overview image index based on the initial imageindex value
-
getMaskInfo
public MaskOverviewProvider.MaskInfo getMaskInfo(int imageIndex, Rectangle imageBounds, ImageReadParam originalParams)
Returns a newMaskOverviewProvider.MaskInfo
instance containing all the parameters to set for accessing the desired image index
-
hasMaskIndexForOverview
public boolean hasMaskIndexForOverview(int imageIndex)
Returns true if there is a mask at the same resolution of the requested one
-
isExternalOverview
public boolean isExternalOverview(int imageIndex)
Returns true if the defined index is related to an external image overview index
-
isExternalMask
public boolean isExternalMask(int imageIndex)
Returns true if the defined index is related to an external image mask index
-
isExternalMaskOverviews
public boolean isExternalMaskOverviews(int imageIndex)
Returns true if the defined index is related to an external image mask overview index
-
hasExternalMasks
public boolean hasExternalMasks()
-
hasExternalMasksOverviews
public boolean hasExternalMasksOverviews()
-
getOverviewResolutions
public double[][] getOverviewResolutions(double span0, double span1)
Returns a double[][] containing the resolutions for all the overviews
-
getExternalOverviewReaderSpi
public ImageReaderSpi getExternalOverviewReaderSpi()
-
getImageReaderSpi
public ImageReaderSpi getImageReaderSpi()
-
getExternalOverviewInputStreamSpi
public ImageInputStreamSpi getExternalOverviewInputStreamSpi()
-
getInputStreamSpi
public ImageInputStreamSpi getInputStreamSpi()
-
getSourceSpiProvider
public SourceSPIProvider getSourceSpiProvider()
-
getMaskStreamSpi
public ImageInputStreamSpi getMaskStreamSpi()
-
getMaskReaderSpi
public ImageReaderSpi getMaskReaderSpi()
-
getMaskOvrStreamSpi
public ImageInputStreamSpi getMaskOvrStreamSpi()
-
getMaskOvrReaderSpi
public ImageReaderSpi getMaskOvrReaderSpi()
-
getLayout
public DatasetLayout getLayout()
-
getNumOverviews
public int getNumOverviews()
-
getNumInternalOverviews
public int getNumInternalOverviews()
-
getNumExternalOverviews
public int getNumExternalOverviews()
-
getNumInternalMasks
public int getNumInternalMasks()
-
getNumExternalMasks
public int getNumExternalMasks()
-
getNumExternalMasksOverviews
public int getNumExternalMasksOverviews()
-
getFileURL
public URL getFileURL()
-
getOvrURL
public URL getOvrURL()
-
getMaskURL
public URL getMaskURL()
-
getMaskOvrURL
public URL getMaskOvrURL()
-
isSkipExternalLookup
public boolean isSkipExternalLookup()
-
getInputStreamSPIFromURL
public static ImageInputStreamSpi getInputStreamSPIFromURL(URL fileURL) throws IOException
Returns anImageInputStreamSpi
instance for the inputURL
- Throws:
IOException
-
getReaderSpiFromStream
public static ImageReaderSpi getReaderSpiFromStream(ImageReaderSpi suggestedSPI, ImageInputStream inStream) throws IOException
Returns anImageReaderSpi
instance for the inputImageInputStream
and the optional suggested spi.- Throws:
IOException
-
scaleROI
public static ROI scaleROI(RenderedImage roiRaster, Rectangle bounds)
Returns aROI
object based on the inputRenderedImage
representing ROI
-
-