|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |
java.lang.Objectjava.lang.Enum<ViewType>
org.geotools.coverage.grid.ViewType
public 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.
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 |
---|
public static final ViewType NATIVE
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.
public static final ViewType PACKED
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
.
public static final ViewType RENDERED
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.
public static final ViewType GEOPHYSICS
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.
public static final ViewType PHOTOGRAPHIC
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.
public static final ViewType SAME
Field Detail |
---|
@Deprecated public static final ViewType DISPLAYABLE
RENDERED
.Method Detail |
---|
public static ViewType[] values()
for (ViewType c : ViewType.values()) System.out.println(c);
public static ViewType valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.
java.lang.IllegalArgumentException
- if this enum type has no constant
with the specified name
java.lang.NullPointerException
- if the argument is nullpublic boolean isInterpolationAllowed()
true
if interpolations other than nearest neighbor are allowed. Those interpolations require the following conditions:
NaN
values}.
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.
JAI.KEY_INTERPOLATION
@Deprecated public boolean isColorSpaceConversionAllowed()
isReplaceIndexColorModelAllowed()
.
public boolean isReplaceIndexColorModelAllowed()
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.
JAI.KEY_REPLACE_INDEX_COLOR_MODEL
public boolean isTransformOnColormapAllowed()
true
if operations can be performed on the colormap rather than the values.
JAI.KEY_TRANSFORM_ON_COLORMAP
public java.awt.RenderingHints getRenderingHints(java.awt.image.RenderedImage image)
JAI.KEY_INTERPOLATION
is sets to "nearest neighbor" if
isInterpolationAllowed()
returns false
, and left unchanged otherwise.JAI.KEY_REPLACE_INDEX_COLOR_MODEL
is sets to the value returned by
isReplaceIndexColorModelAllowed()
.JAI.KEY_TRANSFORM_ON_COLORMAP
is sets to the value returned by
isTransformOnColormapAllowed()
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |