Class ImageFileDirectory
- All Implemented Interfaces:
ResourceOnFileSystem,StoreResource,DataSet,GridCoverageResource,Resource
Thread-safety
Public methods should be synchronized because they can be invoked directly by users. Package-private methods are not synchronized; synchronization is caller's responsibility.- Since:
- 0.8
- Version:
- 1.3
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.sis.internal.storage.TiledGridResource
TiledGridResource.Subset -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate shortNumber of bits per component.private VectorA color map for palette color images (photometricInterpretation= 3).private ColorModelThe image color model, created when first needed.private CompressionThe compression method, ornullif unspecified.private VectorSpecifies that each pixel hasextraSamples.size()extra components whose interpretation is defined by one of the values listed below.private static final bytePossible value forsampleFormatspecifying how to interpret each data sample in a pixel.private GridGeometryThe grid geometry created byGridGeometryBuilder.build(Reader, long, long).(package private) booleantrueif thisImageFileDirectoryhas not yet read all deferred entries.private org.opengis.util.GenericNameThe identifier as a sequence number in the namespace of theGeoTiffStore.private longThe size of the image described by this FID, or -1 if the information has not been found.private longThe size of the image described by this FID, or -1 if the information has not been found.private final intIndex of the (potentially pyramided) image containing this Image File Directory (IFD).private booleanWhether the bit order should be reversed.private booleantrueifminValuesandmaxValueshave been explicitly specified in the TIFF file, orfalseif they have been inferred frombitsPerSample.private booleantrueifminValuesandmaxValueshave been explicitly specified in the TIFF file, orfalseif they have been inferred frombitsPerSample.private booleanIftrue, the components are stored in separate “component planes”.private booleantrueifvalidateMandatoryTags()has already been invoked.private static final bytePossible value for thetileTagFamilyfield.private VectorThe minimum or maximum sample value found in the image, with one value per band.private ImageMetadataBuilderBuilder for the metadata.private VectorThe minimum or maximum sample value found in the image, with one value per band.private doubleThe "no data" or background pixel value, or NaN if undefined.private byteThe color space of the image data, or -1 if unspecified.private PredictorMathematical operator that is applied to the image data before an encoding scheme is applied.private GridGeometryBuilderA helper class for building Coordinate Reference System and complete related metadata.private List<SampleDimension>The sample dimensions, ornullif not yet created.private byteHow to interpret each data sample in a pixel.private SampleModelThe image sample model, created when first needed.private shortThe number of components per pixel.private static final bytePossible value forsampleFormatspecifying how to interpret each data sample in a pixel.private static final bytePossible value for thetileTagFamilyfield.private intA general indication of the kind of data contained in this subfile, mainly useful when there are multiple subfiles in a single TIFF file.private static final bytePossible value for thetileTagFamilyfield.private VectorFor each tile, the number of (compressed) bytes in that tile.private intThe size of each tile, or -1 if the information has not be found.private VectorFor each tile, the byte offset of that tile, as compressed and stored on disk.private byteWhether the tiling was specified using theTile*family of TIFF tags or theStrip*family of tags.private intThe size of each tile, or -1 if the information has not be found.private static final bytePossible value forsampleFormatspecifying how to interpret each data sample in a pixel.Fields inherited from class org.apache.sis.storage.AbstractResource
listeners -
Constructor Summary
ConstructorsConstructorDescriptionImageFileDirectory(Reader reader, int index) Creates a new image file directory. -
Method Summary
Modifier and TypeMethodDescription(package private) ObjectAdds the value read from the current position in the given stream for the entry identified by the given GeoTIFF tag.private intcomputeTileSize(int knownSize) Computes the tile width or height from the other size, or returns a negative number if the size cannot be computed.protected org.opengis.metadata.MetadataBuilds the metadata with the information stored in the fields of this IFD.private Charsetencoding()Shortcut for a frequently requested information.private voidensureSameLength(short tag1, short tag2, int actual, int expected) Verifies that the given tags have the same length and reports a warning if they do not.private static VectorComputes the minimal or maximal values of the given vector.protected ColorModelReturns the Java2D color model.(package private) CompressionReturns the compression method, ornullif unspecified.private DataTypeReturns the type of raster data.(package private) final GridExtentReturns the image width and height without building the full grid geometry.protected NumberReturns the value to use for filling empty spaces in the raster, ornullif none, not different than zero or not valid for the target data type.private NumbergetFillValue(boolean acceptZero) Returns the value to use for filling empty spaces in the raster, ornullif none, The exclusion of zero value is optional, controlled by theacceptZeroargument.Returns an object containing the image size, the CRS and the conversion from pixel indices to CRS coordinates.Optional<org.opengis.util.GenericName>Returns the identifier in the namespace of theGeoTiffStore.(package private) final StringReturns the image index used in the default identifier.protected intReturns the number of components per pixel.(package private) final longReturns the total number of tiles.(package private) PredictorReturns the mathematical operator that is applied to the image data before an encoding scheme is applied.Returns the ranges of sample values together with the conversion from samples to real values.protected SampleModelReturns the Java2D sample model describing pixel type and layout.(package private) Vector[]Gets the stream position or the length in bytes of compressed tile arrays in the GeoTIFF file.protected int[]Returns the size of tiles.(package private) final voidinitReducedResolution(ImageFileDirectory fullResolution, double[] scales) If this IFD has no grid geometry information, derives a grid geometry by applying a scale factor on the grid geometry of another IFD.private ChannelDataInputinput()Shortcut for a frequently requested information.(package private) booleanReturnstrueifInteger.reverseBytes(int)should be invoked on each byte read.(package private) final booleanReturnstrueif this image is a reduced resolution (overview) version of another image in this TIFF file.private DataStoreContentExceptionmissingTag(short missing) Builds an exception for a missing TIFF tag for which no default value can be computed.private voidmissingTag(short missing, Object value, boolean computed, boolean warning) Reports a warning for a missing TIFF tag for which a default value can be computed.private longpixelToByteCount(long value) Multiplies the given value by the number of bytes in one pixel, or return 0 if the result is not an integer.private GridGeometryBuilderReturnsreferencing, created when first needed.(package private) final voidsetOverviewIdentifier(org.opengis.util.NameSpace base, int overview) Sets the identifier for an overview level.private voidsetTileTagFamily(byte family) Sets thetileTagFamilyfield to the given value if it does not conflict with previous value.private voidunsupportedTagValue(short tag, Object value) Reports a warning for an unsupported TIFF tag value.(package private) final booleanVerifies that the mandatory tags are present and consistent with each others.private voidReports a warning with a message created from the given resource keys and parameters.Methods inherited from class org.apache.sis.storage.geotiff.DataCube
filename, getComponentFiles, getOriginator, getSynchronizationLock, listeners, readMethods inherited from class org.apache.sis.internal.storage.TiledGridResource
getAtomSize, getDissociableBands, getLoadingStrategy, preload, setLoadingStrategyMethods inherited from class org.apache.sis.storage.AbstractGridCoverageResource
canNotRead, getEnvelope, logReadOperationMethods inherited from class org.apache.sis.storage.AbstractResource
addListener, clearCache, getMetadata, removeListenerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.sis.storage.GridCoverageResource
getResolutions, subsetMethods inherited from interface org.apache.sis.storage.Resource
addListener, getMetadata, removeListener
-
Field Details
-
TILE
private static final byte TILEPossible value for thetileTagFamilyfield. That field tells whether image tiling was specified using theTile*family of TIFF tags or theStrip*family. JPEG was also used to have its own set of tags.- See Also:
-
STRIP
private static final byte STRIPPossible value for thetileTagFamilyfield. That field tells whether image tiling was specified using theTile*family of TIFF tags or theStrip*family. JPEG was also used to have its own set of tags.- See Also:
-
JPEG
private static final byte JPEGPossible value for thetileTagFamilyfield. That field tells whether image tiling was specified using theTile*family of TIFF tags or theStrip*family. JPEG was also used to have its own set of tags.- See Also:
-
SIGNED
private static final byte SIGNEDPossible value forsampleFormatspecifying how to interpret each data sample in a pixel. Those values are not necessarily the same than the ones documented inTags.SampleFormat. Default value isUNSIGNED.- See Also:
-
UNSIGNED
private static final byte UNSIGNEDPossible value forsampleFormatspecifying how to interpret each data sample in a pixel. Those values are not necessarily the same than the ones documented inTags.SampleFormat. Default value isUNSIGNED.- See Also:
-
FLOAT
private static final byte FLOATPossible value forsampleFormatspecifying how to interpret each data sample in a pixel. Those values are not necessarily the same than the ones documented inTags.SampleFormat. Default value isUNSIGNED.- See Also:
-
index
private final int indexIndex of the (potentially pyramided) image containing this Image File Directory (IFD). All reduced-resolution (overviews) images are ignored when computing this index value. If the TIFF file does not contain reduced-resolution (overview) images, thenindexvalue is the same as the index of this IFD in the TIFF file.If this IFD is a reduced-resolution (overview) image, then this index is off by one. It has the value of the next pyramid. This is an artifact of the way index is computed but should be invisible to user because they should not handle overviews directly.
-
identifier
private org.opengis.util.GenericName identifierThe identifier as a sequence number in the namespace of theGeoTiffStore. The first image has the sequence number "1". This is computed when first needed.- See Also:
-
metadata
Builder for the metadata. This field is reset tonullwhen not needed anymore. -
hasDeferredEntries
boolean hasDeferredEntriestrueif thisImageFileDirectoryhas not yet read all deferred entries. When this flag istrue, theImageFileDirectoryis not yet ready for use. -
isValidated
private boolean isValidatedtrueifvalidateMandatoryTags()has already been invoked. -
subfileType
private int subfileTypeA general indication of the kind of data contained in this subfile, mainly useful when there are multiple subfiles in a single TIFF file. This field is made up of a set of 32 flag bits. Bit 0 is 1 if the image is a reduced-resolution version of another image in this TIFF file. Bit 1 is 1 if the image is a single page of a multi-page image (see PageNumber). Bit 2 is 1 if the image defines a transparency mask for another image in this TIFF file (see PhotometricInterpretation). Bit 4 indicates MRC imaging model as described in ITU-T recommendation T.44 [T.44] (See ImageLayer tag) - RFC 2301.- See Also:
-
imageWidth
private long imageWidthThe size of the image described by this FID, or -1 if the information has not been found. The image may be much bigger than the memory capacity, in which case the image shall be tiled.Note: the
imageHeightattribute is namedImageLengthin TIFF specification.- See Also:
-
imageHeight
private long imageHeightThe size of the image described by this FID, or -1 if the information has not been found. The image may be much bigger than the memory capacity, in which case the image shall be tiled.Note: the
imageHeightattribute is namedImageLengthin TIFF specification.- See Also:
-
tileWidth
private int tileWidthThe size of each tile, or -1 if the information has not be found. Tiles shall be small enough for fitting in memory, typically in aRasterobject. The TIFF specification requires that tile width and height must be a multiple of 16, but the SIS reader implementation works for any size. Tiles need not be square.Assuming integer arithmetic, the number of tiles in an image can be computed as below (these computed values are not TIFF fields):
Note thatimageWidthcan be less thantileWidthand/orimageHeightcan be less thantileHeight. Such case means that the tiles are too large or that the tiled image is too small, neither of which is recommended.Note: the
tileHeightattribute is namedTileLengthin TIFF specification.Strips considered as tiles
The TIFF specification also defines aRowsPerStriptag, which is equivalent to the height of tiles having the same width than the image. While the TIFF specification handles "tiles" and "strips" separately, Apache SIS handles strips as a special kind of tiles where onlytileHeightis specified andtileWidthdefaults toimageWidth.- See Also:
-
tileHeight
private int tileHeightThe size of each tile, or -1 if the information has not be found. Tiles shall be small enough for fitting in memory, typically in aRasterobject. The TIFF specification requires that tile width and height must be a multiple of 16, but the SIS reader implementation works for any size. Tiles need not be square.Assuming integer arithmetic, the number of tiles in an image can be computed as below (these computed values are not TIFF fields):
Note thatimageWidthcan be less thantileWidthand/orimageHeightcan be less thantileHeight. Such case means that the tiles are too large or that the tiled image is too small, neither of which is recommended.Note: the
tileHeightattribute is namedTileLengthin TIFF specification.Strips considered as tiles
The TIFF specification also defines aRowsPerStriptag, which is equivalent to the height of tiles having the same width than the image. While the TIFF specification handles "tiles" and "strips" separately, Apache SIS handles strips as a special kind of tiles where onlytileHeightis specified andtileWidthdefaults toimageWidth.- See Also:
-
tileOffsets
For each tile, the byte offset of that tile, as compressed and stored on disk. The offset is specified with respect to the beginning of the TIFF file. Each tile has a location independent of the locations of other tilesOffsets are ordered left-to-right and top-to-bottom. If
isPlanaristrue(i.e. components are stored in separate “component planes”), then the offsets for the first component plane are stored first, followed by all the offsets for the second component plane, and so on.Strips considered as tiles
The TIFF specification also defines aStripOffsetstag, which contains the byte offset of each strip. In Apache SIS implementation, strips are considered as a special kind of tiles having a width equals toimageWidth. -
tileByteCounts
For each tile, the number of (compressed) bytes in that tile. SeetileOffsetsfor a description of how the byte counts are ordered.Strips considered as tiles
The TIFF specification also defines aRowsPerStriptag, which is the number of bytes in the strip after compression. In Apache SIS implementation, strips are considered as a special kind of tiles having a width equals toimageWidth. -
tileTagFamily
private byte tileTagFamily -
isPlanar
private boolean isPlanarIftrue, the components are stored in separate “component planes”. The default isfalse, which stands for the "chunky" format (for example RGB data stored as RGBRGBRGB). -
sampleFormat
private byte sampleFormat -
isBitOrderReversed
private boolean isBitOrderReversedWhether the bit order should be reversed. This boolean value is determined from theFillOrderTIFF tag.- Value 1 (mapped to
false) means that pixels with lower column values are stored in the higher-order bits of the byte. This is the default value. - Value 2 (mapped to
true) means that pixels with lower column values are stored in the lower-order bits of the byte. In practice, this order is very uncommon and is not recommended.
falseand 2 is mapped totrue. - Value 1 (mapped to
-
bitsPerSample
private short bitsPerSampleNumber of bits per component. The TIFF specification allows a different number of bits per component for each component corresponding to a pixel. For example, RGB color data could use a different number of bits per component for each of the three color planes. However, current Apache SIS implementation requires that all components have the sameBitsPerSamplevalue. -
samplesPerPixel
private short samplesPerPixelThe number of components per pixel. ThesamplesPerPixelvalue is usually 1 for bilevel, grayscale and palette-color images, and 3 for RGB images. If this value is higher, then theExtraSamplesTIFF tag should give an indication of the meaning of the additional channels.- See Also:
-
extraSamples
Specifies that each pixel hasextraSamples.size()extra components whose interpretation is defined by one of the values listed below. When this field is used, thesamplesPerPixelfield has a value greater than what thephotometricInterpretationfield suggests. For example, full-color RGB data normally hassamplesPerPixel= 3. IfsamplesPerPixelis greater than 3, then thisextraSamplesfield describes the meaning of the extra samples. IfsamplesPerPixelis, say, 5 then thisextraSamplesfield will contain 2 values, one for each extra sample.Extra components that are present must be stored as the last components in each pixel. For example if
samplesPerPixelis 4 and there is 1 extra component, then it is located in the last component location in each pixel.ExtraSamples is typically used to include non-color information, such as opacity, in an image. The possible values for each item are:
- 0 = Unspecified data.
- 1 = Associated alpha data (with pre-multiplied color).
- 2 = Unassociated alpha data.
If an extra sample is used to encode information that has little or nothing to do with alpha, then
extraSample= 0 (EXTRASAMPLE_UNSPECIFIED) is recommended. -
photometricInterpretation
private byte photometricInterpretationThe color space of the image data, or -1 if unspecified.Color space codes Value Label Description 0 WhiteIsZero For bilevel and grayscale images. 0 is imaged as white. 1 BlackIsZero For bilevel and grayscale images. 0 is imaged as black. 2 RGB RGB value of (0,0,0) represents black, and (255,255,255) represents white. 3 PaletteColor The value of the component is used as an index into the RGB values of the colorMap.4 TransparencyMask Defines an irregularly shaped region of another image in the same TIFF file. -
colorMap
A color map for palette color images (photometricInterpretation= 3). This vector defines a Red-Green-Blue color map (often called a lookup table) for palette-color images. In a palette-color image, a pixel value is used to index into an RGB lookup table. For example, a palette-color pixel having a value of 0 would be displayed according to the 0th Red, Green, Blue triplet.In a TIFF ColorMap, all the Red values come first, followed by all Green values, then all Blue values. The number of values for each color is 1 <<
bitsPerSample. Therefore, theColorMapvector for an 8-bit palette-color image would have 3 * 256 values. 0 represents the minimum intensity and 65535 represents the maximum intensity. Black is represented by 0,0,0 and white by 65535, 65535, 65535.ColorMapmust be included in all palette-color images. In Specification Supplement 1, support was added for color maps containing other then RGB values. This scheme includes theIndexedtag, with value 1, and aphotometricInterpretationdifferent fromPaletteColor. -
minValues
The minimum or maximum sample value found in the image, with one value per band. May be a vector of length 1 if the same single value applies to all bands. -
maxValues
The minimum or maximum sample value found in the image, with one value per band. May be a vector of length 1 if the same single value applies to all bands. -
isMinSpecified
private boolean isMinSpecifiedtrueifminValuesandmaxValueshave been explicitly specified in the TIFF file, orfalseif they have been inferred frombitsPerSample. -
isMaxSpecified
private boolean isMaxSpecifiedtrueifminValuesandmaxValueshave been explicitly specified in the TIFF file, orfalseif they have been inferred frombitsPerSample. -
noData
private double noDataThe "no data" or background pixel value, or NaN if undefined.- See Also:
-
compression
The compression method, ornullif unspecified. If the compression method is unknown or unsupported we cannot read the image, but we still can read the metadata.- See Also:
-
predictor
Mathematical operator that is applied to the image data before an encoding scheme is applied. This is used mostly with LZW compression. Current values are:- 1: No prediction scheme used before coding.
- 2: Horizontal differencing.
- See Also:
-
referencing
A helper class for building Coordinate Reference System and complete related metadata. Contains the following information:- See Also:
-
gridGeometry
The grid geometry created byGridGeometryBuilder.build(Reader, long, long). It has 2 or 3 dimensions, depending on whether the CRS declares a vertical axis or not.- See Also:
-
sampleDimensions
The sample dimensions, ornullif not yet created.- See Also:
-
sampleModel
The image sample model, created when first needed. The raster size is the tile size. Sample models with different size and number of bands can be derived from this model.- See Also:
-
colorModel
The image color model, created when first needed.- See Also:
-
-
Constructor Details
-
ImageFileDirectory
ImageFileDirectory(Reader reader, int index) Creates a new image file directory. The index arguments is used for metadata identifier only.- Parameters:
reader- information about the input stream to read, the metadata and the character encoding.index- the pyramided image index as a sequence number starting with 0 for the first pyramid.
-
-
Method Details
-
referencing
Returnsreferencing, created when first needed. We delay its creation since this object is not needed for ordinary TIFF files (i.e. without the GeoTIFF extension). This method is invoked only during the parsing of TIFF tags. If no GeoTIFF information is found, then this field keeps thenullvalue. -
input
Shortcut for a frequently requested information. -
encoding
Shortcut for a frequently requested information. -
getImageIndex
Returns the image index used in the default identifier. -
getIdentifier
Returns the identifier in the namespace of theGeoTiffStore. The first image has the sequence number "1", optionally customized. If this image is an overview, then its namespace should be the name of the base image and the tip should be "overview-level" where "level" is a number starting at 1.The returned value should never be empty. An empty value would be a failure to initialize overviews.
- Specified by:
getIdentifierin interfaceResource- Specified by:
getIdentifierin classDataCube- Returns:
- a persistent identifier unique within the data store, or absent if this resource has no such identifier.
- See Also:
-
setOverviewIdentifier
final void setOverviewIdentifier(org.opengis.util.NameSpace base, int overview) Sets the identifier for an overview level. This is used only for a pyramid. The image with finest resolution is used as the namespace for all overviews.- Parameters:
base- name of the image with finest resolution.overview- 1 for the first overview, 2 for the next one, etc.
-
addEntry
Adds the value read from the current position in the given stream for the entry identified by the given GeoTIFF tag. This method may store the value either in a field of this class, or directly in theImageMetadataBuilder. However, in the latter case, this method should not write anything under the"metadata/contentInfo"node.- Parameters:
tag- the GeoTIFF tag to decode.type- the GeoTIFF type of the value to read.count- the number of values to read.- Returns:
nullon success, or the unrecognized value otherwise.- Throws:
IOException- if an error occurred while reading the stream.ParseException- if the value need to be parsed as date and the parsing failed.NumberFormatException- if the value need to be parsed as number and the parsing failed.ArithmeticException- if the value cannot be represented in the expected Java type.IllegalArgumentException- if a value which was expected to be a singleton is not.UnsupportedOperationException- if the given type isType.UNDEFINED.DataStoreException- if a logical error is found or an unsupported TIFF feature is used.Exception
-
setTileTagFamily
Sets thetileTagFamilyfield to the given value if it does not conflict with previous value.- Parameters:
family- eitherTILEorSTRIP.- Throws:
DataStoreContentException- iftileTagFamilyis already set to another value.
-
extremum
Computes the minimal or maximal values of the given vector. Those vectors do not need to have the same length. One of those two vector will be modified in-place.- Parameters:
a- the first vector, ornullif none.b- the new vector to combine with the existing one. Cannot be null.max-truefor computing the maximal values, orfalsefor the minimal value.
-
pixelToByteCount
private long pixelToByteCount(long value) Multiplies the given value by the number of bytes in one pixel, or return 0 if the result is not an integer.- Throws:
ArithmeticException- if the result overflows.
-
computeTileSize
private int computeTileSize(int knownSize) Computes the tile width or height from the other size, or returns a negative number if the size cannot be computed.- Parameters:
knownSize- the tile width or height.- Returns:
- the tile width if the known size was height, or the tile height if the known size was width, or a negative number if the width or height cannot be computed.
- Throws:
ArithmeticException- if the result overflows.
-
validateMandatoryTags
Verifies that the mandatory tags are present and consistent with each others. If a mandatory tag is absent, then there is a choice:- If the tag can be inferred from other tag values, performs that computation and logs a warning.
- Otherwise throws an exception.
- Returns:
trueif the method has been invoked for the first time.- Throws:
DataStoreContentException- if a mandatory tag is missing and cannot be inferred.
-
createMetadata
Builds the metadata with the information stored in the fields of this IFD. This method is invoked only if the user requested the ISO 19115 metadata.- Overrides:
createMetadatain classAbstractGridCoverageResource- Returns:
- the newly created metadata, or
nullif unknown. - Throws:
DataStoreException- if an error occurred while reading metadata from the data store.
-
isReducedResolution
final boolean isReducedResolution()Returnstrueif this image is a reduced resolution (overview) version of another image in this TIFF file. -
initReducedResolution
final void initReducedResolution(ImageFileDirectory fullResolution, double[] scales) throws DataStoreException, org.opengis.referencing.operation.TransformException If this IFD has no grid geometry information, derives a grid geometry by applying a scale factor on the grid geometry of another IFD. Information about bands are also copied if compatible. This method should be invoked only whenisReducedResolution()istrue.- Parameters:
fullResolution- the full-resolution image.scales- size of full resolution image / size of this image for each grid axis.- Throws:
DataStoreExceptionorg.opengis.referencing.operation.TransformException
-
getGridGeometry
Returns an object containing the image size, the CRS and the conversion from pixel indices to CRS coordinates. The grid geometry has 2 or 3 dimensions, depending on whether the CRS declares a vertical axis or not.Thread-safety
This method is thread-safe because it can be invoked directly by user.- Returns:
- extent of grid coordinates together with their mapping to "real world" coordinates.
- Throws:
DataStoreContentException- See Also:
-
getExtent
Returns the image width and height without building the full grid geometry.- See Also:
-
getSampleDimensions
Returns the ranges of sample values together with the conversion from samples to real values.Thread-safety
This method is thread-safe because it can be invoked directly by user.- Returns:
- ranges of sample values together with their mapping to "real values".
- Throws:
DataStoreContentException- See Also:
-
getSampleModel
Returns the Java2D sample model describing pixel type and layout. The raster size is the tile size and the number of bands issamplesPerPixel. A sample model of different size or number of bands can be derived after construction by call to one ofSampleModel.create…methods.- Specified by:
getSampleModelin classTiledGridResource- Returns:
- the sample model for tiles at full resolution with all their bands.
- Throws:
DataStoreContentException- if the data type is not supported.- See Also:
-
getNumBands
protected int getNumBands()Returns the number of components per pixel.- Specified by:
getNumBandsin classDataCube- See Also:
-
getTileSize
protected int[] getTileSize()Returns the size of tiles. This is also the size of the image sample model. The number of dimensions is always 2 forImageFileDirectory.- Specified by:
getTileSizein classTiledGridResource- Returns:
- the size of tiles (in pixels) in this resource.
- See Also:
-
getNumTiles
final long getNumTiles()Returns the total number of tiles. The formulas used in this method are derived from the formulas documented in the TIFF specification and reproduced intileWidthandtileHeightfields javadoc.- Specified by:
getNumTilesin classDataCube
-
getDataType
Returns the type of raster data. The enumeration values are restricted to types compatible with Java2D, at the cost of using more bits thanbitsPerSampleif there is no exact match.- Throws:
DataStoreContentException- if the type is not recognized.
-
getColorModel
Returns the Java2D color model.- Specified by:
getColorModelin classTiledGridResource- Returns:
- a color model compatible with
TiledGridResource.getSampleModel(), ornullif none. - Throws:
DataStoreContentException- if the data type is not supported.- See Also:
-
getFillValue
Returns the value to use for filling empty spaces in the raster, ornullif none, not different than zero or not valid for the target data type. The zero value is excluded because tiles are already initialized to zero by default.- Specified by:
getFillValuein classTiledGridResource- Returns:
- the value to use for filling empty spaces in rasters.
-
getFillValue
Returns the value to use for filling empty spaces in the raster, ornullif none, The exclusion of zero value is optional, controlled by theacceptZeroargument.- Parameters:
acceptZero- whether to return a number for the zero value.
-
getTileArrayInfo
Vector[] getTileArrayInfo()Gets the stream position or the length in bytes of compressed tile arrays in the GeoTIFF file. Values in the returned vector arelongprimitive type.- Specified by:
getTileArrayInfoin classDataCube- Returns:
- stream position (relative to file beginning) and length of compressed tile arrays, in bytes.
-
isBitOrderReversed
boolean isBitOrderReversed()ReturnstrueifInteger.reverseBytes(int)should be invoked on each byte read. This mode is very rare and should apply only to uncompressed image or CCITT 1D/2D compressions.- Specified by:
isBitOrderReversedin classDataCube
-
getCompression
Compression getCompression()Returns the compression method, ornullif unspecified.- Specified by:
getCompressionin classDataCube
-
getPredictor
Predictor getPredictor()Returns the mathematical operator that is applied to the image data before an encoding scheme is applied.- Specified by:
getPredictorin classDataCube
-
warning
Reports a warning with a message created from the given resource keys and parameters. Note that the log record will not necessarily be sent to the logging framework; if the user has registered at least one listener, then the record will be sent to the listeners instead.This method sets the source class name and source method name to hard-coded values. Those values assume that the warnings occurred indirectly from a call to
GeoTiffStore.components(). We do not report private classes or methods as the source of warnings.- Parameters:
level- the logging level for the message to log.key- theResourceskey of the message to format.parameters- the parameters to put in the message.
-
ensureSameLength
private void ensureSameLength(short tag1, short tag2, int actual, int expected) Verifies that the given tags have the same length and reports a warning if they do not.- Parameters:
tag1- the TIFF tag with inconsistent length.tag2- the TIFF tag used as a reference.actual- length of list associated totag1.expected- length of list associated totag2.
-
missingTag
Reports a warning for a missing TIFF tag for which a default value can be computed.- Parameters:
missing- the numerical value of the missing tag.value- the default value or the computed value.computed- whether the default value has been computed.warning- whether the problem should be reported as a warning.
-
unsupportedTagValue
Reports a warning for an unsupported TIFF tag value.- Parameters:
tag- the numerical value of the tag.value- the unsupported value.
-
missingTag
Builds an exception for a missing TIFF tag for which no default value can be computed.- Parameters:
missing- the numerical value of the missing tag.
-