|
deegree-core-3.0-pre-nightly (2010/03/05 00:01) - official | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.deegree.rendering.r2d.utils.RasterDataUtility
public class RasterDataUtility
Utility class to interpret raster data in a consistent way. It should be used in raster lookup operations (for example in Categorize or Interpolate). This class can read 1, 2, 3 and 4-band rasters, and combines band values into a single pixel value. RGB bands are combined and their average value is returned (yielding the overall gray-pixel intensity of a pixel), and alpha bands are ignored. This class can perform contrast enhancement on-the-fly. If channel mappings are provided, this class can process rasters with any number of bands.
Constructor Summary | |
---|---|
RasterDataUtility(AbstractRaster raster)
|
|
RasterDataUtility(AbstractRaster raster,
RasterChannelSelection style)
Create a RasterDataUtility object, where channels are mapped according to the RasterStyle options |
|
RasterDataUtility(RasterData d)
|
Method Summary | |
---|---|
float |
get(int col,
int row)
|
float |
get(int col,
int row,
int band)
|
float |
getEnhanced(int col,
int row,
int band)
Return a pixel value in a particular band, after performing contrastEnhancements. |
void |
precomputeContrastEnhancements(int index,
RasterStyling.ContrastEnhancement enhancement)
Precomputes weight factors for applying contrast enhancements to the current raster. |
void |
setContrastEnhancement(RasterStyling.ContrastEnhancement ce)
Update the contrast enhancement. |
void |
setGamma(double g)
Update the gamma value |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RasterDataUtility(AbstractRaster raster)
raster
- abstract raster data sourcepublic RasterDataUtility(AbstractRaster raster, RasterChannelSelection style)
raster
- style
- public RasterDataUtility(RasterData d)
d
- raster dataMethod Detail |
---|
public void setContrastEnhancement(RasterStyling.ContrastEnhancement ce)
ce
- public float get(int col, int row)
col
- column indexrow
- row index
public float get(int col, int row, int band)
col
- column indexrow
- row indexband
- band index
public float getEnhanced(int col, int row, int band)
setGamma(double)
or
setContrastEnhancements(...)
before calling this function.
col
- column indexrow
- row indexband
- band index
public void setGamma(double g)
g
- new gamma valuepublic void precomputeContrastEnhancements(int index, RasterStyling.ContrastEnhancement enhancement)
index
is less than 0) or to a particular channel (if index
is
non-negative). This function is relevant for normalize or histogram enhancements, where the operation is
dependent on the input raster data. All subsequent calls to getEnhanced(col,row)
will use this
contrast enhancement.
NOTE: This function overrides the effects of setGamma()
.
index
- target channel number.enhancement
- desired contrast enhancement
|
deegree-core-3.0-pre-nightly (2010/03/05 00:01) - official | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |