org.geotools.coverage.grid
Enum ViewType

java.lang.Object
  extended by java.lang.Enum<ViewType>
      extended by org.geotools.coverage.grid.ViewType
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<ViewType>

public enum ViewType
extends java.lang.Enum<ViewType>

Enumerates different "views" over a given coverage. Coverage views represent the same data in different ways. Some views are more appropriate than others depending of the kind of work to be performed. For example numerical computations on meteorological or oceanographical data should be performed on the geophysics view, while renderings are better performed with the rendered view.

Different views are sometime synonymous for a given coverage. For example the native and rendered views are identical when the coverage values are unsigned 8 or 16 bits integers, but distincts if the native values are 32 bits integers. This is because in the later case, the 32 bits integer values can not be processed directly by an index color model.

Since:
2.4
Version:
$Id: ViewType.java 30643 2008-06-12 18:27:03Z acuster $
Author:
Martin Desruisseaux
See Also:
GridCoverage2D.view(org.geotools.coverage.grid.ViewType)

Enum Constant Summary
GEOPHYSICS
          Coverage data are the values of some geophysics phenomenon, for example an elevation in metres or a temperature in Celsius degrees.
NATIVE
          Coverage data come directly from some source (typically a file) and are unprocessed.
PACKED
          Coverage data are packed, usually as integers convertible to geophysics values.
PHOTOGRAPHIC
          Coverage data have no meaning other than visual color.
RENDERED
          Coverage data are compatible with common Java2D color models.
SAME
          Special value for returning the same coverage unchanged.
 
Field Summary
static ViewType DISPLAYABLE
          Deprecated. Renamed as RENDERED.
 
Method Summary
 java.awt.RenderingHints getRenderingHints(java.awt.image.RenderedImage image)
          Returns suggested rendering hints for a JAI operation on the given image.
 boolean isColorSpaceConversionAllowed()
          Deprecated. Renamed isReplaceIndexColorModelAllowed().
 boolean isInterpolationAllowed()
          Returns true if interpolations other than nearest neighbor are allowed.
 boolean isReplaceIndexColorModelAllowed()
          Returns true if the replacement of index color model is allowed.
 boolean isTransformOnColormapAllowed()
          Returns true if operations can be performed on the colormap rather than the values.
static ViewType valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static ViewType[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

NATIVE

public static final ViewType NATIVE
Coverage data come directly from some source (typically a file) and are unprocessed. This view doesn't have any of the restrictions imposed by other views: values may be integers or floating point values, negative values are allowed, and missing data may be represented by "pad values" like -9999. This view is generally not suitable for renderings or numerical computations. However in some special cases, this view may be identical to an other view (see those other views for a more exhaustive list of their conditions):

Interpolations other than nearest neighbor are not allowed. Conversions to the RGB color space are not allowed neither, for the same reasons than the rendered view.


PACKED

public static final ViewType PACKED
Coverage data are packed, usually as integers convertible to geophysics values. The conversion is performed by the sample to geophysics transform.

This view is often synonymous to RENDERED, but may be different for some data types that are incompatible with index color model (e.g. 32 bits integer). This view is always exclusive with GEOPHYSICS.

Since:
2.5

RENDERED

public static final ViewType RENDERED
Coverage data are compatible with common Java2D color models. This usually imply that values are restricted to unsigned integers. This view is often identical to the native view if the values on the originating device were already unsigned.

Conversions to the RGB color space are not allowed, because the data are often related to geophysics values in some way. For example the coverage may contains Sea Surface Temperature (SST) data packed as 8 bits integers and convertible to degrees Celsius using the following formula: temperature = pixel_value × 0.15 - 3. A conversion to RGB space would lose this relationship, and any oceanographical calculation accidentaly performed on this space would produce wrong results.

Interpolations other than nearest neighbor are not allowed, because some special values are often used as pad values for missing data. An interpolation between a "real" value (for example a value convertible to the above-cited SST) and "pad" value would produce a wrong result.


GEOPHYSICS

public static final ViewType GEOPHYSICS
Coverage data are the values of some geophysics phenomenon, for example an elevation in metres or a temperature in Celsius degrees. Values are typically floating point numbers (float or double primitive type), but this is not mandatory if there is never fractional parts or missing values in a particular coverage.

If the coverage contains some "no data" values, then those missing values must be represented by Float.NaN or Double.NaN constant, or any other value in the NaN range as explained there. Real numbers used as "pad values" like -9999 are not allowed.

Interpolations (bilinear, bicubic, etc.) are allowed. If there is some missing values around the interpolation point, then the result is a NaN value.

Conversions to RGB color space is not allowed. All computations (including interpolations) must be performed in this geophysics space.


PHOTOGRAPHIC

public static final ViewType PHOTOGRAPHIC
Coverage data have no meaning other than visual color. It is not an elevation map for example (in which case the coverage would rather be described as geophysics).

Conversions to the RGB color space are allowed. Because the coverage has no geophysics meaning other than visual color, there is no significant data lose in the replacement of index color model.

Interpolation are not allowed on indexed values. They must be performed on the RGB or similar color space instead.


SAME

public static final ViewType SAME
Special value for returning the same coverage unchanged. This value can be used as a "no operation" instruction.

Since:
2.5
Field Detail

DISPLAYABLE

@Deprecated
public static final ViewType DISPLAYABLE
Deprecated. Renamed as RENDERED.
Method Detail

values

public static ViewType[] 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 (ViewType c : ViewType.values())
    System.out.println(c);

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

valueOf

public static ViewType valueOf(java.lang.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:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

isInterpolationAllowed

public boolean isInterpolationAllowed()
Returns true if interpolations other than nearest neighbor are allowed. Those interpolations require the following conditions:

This method may conservatively returns false if unsure. If interpolations are wanted but not allowed, then users should try to convert the coverage to the geophysics space, which supports interpolations. If no geophysics view is available, then users may convert the image to the RGB space if color space conversion is allowed. Interpolations in the RGB space produce nice-looking images, but the pixel values lose all geophysical meaning. If the color space conversion is not allowed, then then users should stick with nearest neighbor interpolation.

See Also:
JAI.KEY_INTERPOLATION

isColorSpaceConversionAllowed

@Deprecated
public boolean isColorSpaceConversionAllowed()
Deprecated. Renamed isReplaceIndexColorModelAllowed().


isReplaceIndexColorModelAllowed

public boolean isReplaceIndexColorModelAllowed()
Returns true if the replacement of index color model is allowed. Such replacements may occurs during some operations requirying interpolations, like scale, in order to produce images that look nicer. However such replacements should be attempted only in last resort (interpolations in the geophysics space should be preferred) and only if the coverage data don't have any meaning other than visual color, as in photographic images.

Since:
2.5
See Also:
JAI.KEY_REPLACE_INDEX_COLOR_MODEL

isTransformOnColormapAllowed

public boolean isTransformOnColormapAllowed()
Returns true if operations can be performed on the colormap rather than the values.

Since:
2.5
See Also:
JAI.KEY_TRANSFORM_ON_COLORMAP

getRenderingHints

public java.awt.RenderingHints getRenderingHints(java.awt.image.RenderedImage image)
Returns suggested rendering hints for a JAI operation on the given image.

Since:
2.5


Copyright © 1996-2010 Geotools. All Rights Reserved.