org.geotoolkit.image.io
Enum SampleConversionType

Object
  extended by Enum<SampleConversionType>
      extended by SampleConversionType
All Implemented Interfaces:
Serializable, Comparable<SampleConversionType>

public enum SampleConversionType
extends Enum<SampleConversionType>

Kind of conversions which are allowed on sample values during the read process. This enum is given to SpatialImageReadParam in order to give to the reading process some flexibility about the values to be stored in the Raster objects.

By default, the reading process performed by SpatialImageReader is strict and will store the same values than the ones read from the stream. However more efficient storage can sometime be achieved if some conversions are allowed, for example replacing fill values by 0 and applying an offset for avoiding negative numbers. The ImageCoverageReader class in particular allows some changes based on the additional knowledge inferred from image metadata.

Since:
3.11
Version:
3.12
Author:
Martin Desruisseaux (Geomatys)
See Also:
SampleConverter, SpatialImageReadParam.setSampleConversionAllowed(SampleConversionType, boolean)
Module:
coverage/geotk-coverageio (download)    View source code for this class

Enum Constant Summary
REPLACE_FILL_VALUES
          Indicates that SpatialImageReader is allowed to replace fill values by NaN.
SHIFT_SIGNED_INTEGERS
          Indicates that SpatialImageReader is allowed to apply an offset on signed integer values in order to get unsigned integers.
STORE_AS_FLOATS
          Indicates that SpatialImageReader is allowed to store samples as floating point values instead than integer values.
 
Method Summary
static SampleConversionType valueOf(String name)
          Returns the enum constant of this type with the specified name.
static SampleConversionType[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

SHIFT_SIGNED_INTEGERS

public static final SampleConversionType SHIFT_SIGNED_INTEGERS
Indicates that SpatialImageReader is allowed to apply an offset on signed integer values in order to get unsigned integers. More specifically, if the SpatialImageReader getRawDataType(int) method returns DataBuffer.TYPE_SHORT and this conversion type is allowed, then SpatialImageReader will process as if the getRawDataType(int) method returned TYPE_USHORT. Consequently, an offset may be added to every sample values in order to avoid negative values.

See SpatialImageReader.getRawDataType(int) for more information and an example.

See Also:
SampleConverter.createOffset(double, double)

REPLACE_FILL_VALUES

public static final SampleConversionType REPLACE_FILL_VALUES
Indicates that SpatialImageReader is allowed to replace fill values by NaN. This replacement is possible only if the raw data type is DataBuffer.TYPE_FLOAT or TYPE_DOUBLE.

Since:
3.12
See Also:
SampleConverter.createPadValueMask(double)

STORE_AS_FLOATS

public static final SampleConversionType STORE_AS_FLOATS
Indicates that SpatialImageReader is allowed to store samples as floating point values instead than integer values. When provided, this enum ensures that fill values can be replaced by NaN if the REPLACE_FILL_VALUES enum is also provided.

Since:
3.12
Method Detail

values

public static SampleConversionType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (SampleConversionType c : SampleConversionType.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static SampleConversionType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null


Copyright © 2009-2012 Geotoolkit.org. All Rights Reserved.