public abstract class AbstractBand extends RasterDataNode
AbstractBand class provides a set of pixel access methods but does not provide an implementation of
the actual reading and writing of pixel data from or into a raster.RasterDataNode.RasterDataDoubleList, RasterDataNode.RasterDataProcessor| Modifier and Type | Field and Description |
|---|---|
static String |
VIEW_MODE_FORWARD |
static String |
VIEW_MODE_NADIR |
static String |
VIEW_MODE_ORTHO |
INVALID_POS_TEXT, IO_ERROR_TEXT, NO_DATA_TEXT, PROPERTY_NAME_GEOCODING, PROPERTY_NAME_IMAGE_INFO, PROPERTY_NAME_LOG_10_SCALED, PROPERTY_NAME_NO_DATA_VALUE, PROPERTY_NAME_NO_DATA_VALUE_USED, PROPERTY_NAME_ROI_DEFINITION, PROPERTY_NAME_SCALING_FACTOR, PROPERTY_NAME_SCALING_OFFSET, PROPERTY_NAME_STX, PROPERTY_NAME_VALID_PIXEL_EXPRESSIONPROPERTY_NAME_DATA, PROPERTY_NAME_READ_ONLY, PROPERTY_NAME_SYNTHETIC, PROPERTY_NAME_UNITPROPERTY_NAME_DESCRIPTION, PROPERTY_NAME_NAME| Constructor and Description |
|---|
AbstractBand(String name,
int dataType,
int width,
int height) |
| Modifier and Type | Method and Description |
|---|---|
int |
computeBand(String expression,
String validMaskExpression,
Product[] sourceProducts,
int defaultProductIndex,
boolean checkInvalids,
boolean useInvalidValue,
double noDataValue,
com.bc.ceres.core.ProgressMonitor pm)
Deprecated.
Since BEAM 4.10. Use
VirtualBand or VirtualBandOpImage. |
protected static double[] |
ensureMinLengthArray(double[] array,
int length) |
protected static float[] |
ensureMinLengthArray(float[] array,
int length) |
protected static int[] |
ensureMinLengthArray(int[] array,
int length) |
void |
ensureRasterData()
Ensures that raster data exists
|
double |
getPixelDouble(int x,
int y)
Gets the sample for the pixel located at (x,y) as a double value.
|
float |
getPixelFloat(int x,
int y)
Gets the sample for the pixel located at (x,y) as a float value.
|
int |
getPixelInt(int x,
int y)
Gets the sample for the pixel located at (x,y) as an integer value.
|
double[] |
getPixels(int x,
int y,
int w,
int h,
double[] pixels,
com.bc.ceres.core.ProgressMonitor pm)
Retrieves the range of pixels specified by the coordinates as double array.
|
float[] |
getPixels(int x,
int y,
int w,
int h,
float[] pixels,
com.bc.ceres.core.ProgressMonitor pm)
Retrieves the range of pixels specified by the coordinates as float array.
|
int[] |
getPixels(int x,
int y,
int w,
int h,
int[] pixels,
com.bc.ceres.core.ProgressMonitor pm)
Retrieves the range of pixels specified by the coordinates as integer array.
|
abstract long |
getRawStorageSize(ProductSubsetDef subsetDef)
Gets an estimated raw storage size in bytes of this product node.
|
ProductData |
getSceneRasterData()
Gets a raster data holding this band's pixel data for an entire product scene.
|
String |
getViewModeId(String bandName) |
void |
loadRasterData(com.bc.ceres.core.ProgressMonitor pm)
Deprecated.
since BEAM 4.11. No replacement.
|
double[] |
readPixels(int x,
int y,
int w,
int h,
double[] pixels,
com.bc.ceres.core.ProgressMonitor pm)
Retrieves the band data at the given offset (x, y), width and height as double data.
|
float[] |
readPixels(int x,
int y,
int w,
int h,
float[] pixels,
com.bc.ceres.core.ProgressMonitor pm)
Retrieves the band data at the given offset (x, y), width and height as float data.
|
int[] |
readPixels(int x,
int y,
int w,
int h,
int[] pixels,
com.bc.ceres.core.ProgressMonitor pm)
Retrieves the band data at the given offset (x, y), width and height as integer data.
|
void |
setPixelDouble(int x,
int y,
double pixelValue)
Sets the pixel value at the given pixel coordinate to the given pixel value.
|
void |
setPixelFloat(int x,
int y,
float pixelValue)
Sets the pixel at the given pixel coordinate to the given pixel value.
|
void |
setPixelInt(int x,
int y,
int pixelValue)
Sets the pixel at the given pixel co-ordinate to the given pixel value.
|
void |
setPixels(int x,
int y,
int w,
int h,
double[] pixels)
Sets a range of pixels specified by the coordinates as double array.
|
void |
setPixels(int x,
int y,
int w,
int h,
float[] pixels)
Sets a range of pixels specified by the coordinates as float array.
|
void |
setPixels(int x,
int y,
int w,
int h,
int[] pixels)
Sets a range of pixels specified by the coordinates as integer array.
|
void |
unloadRasterData()
Deprecated.
since BEAM 4.11. No replacement.
|
void |
writePixels(int x,
int y,
int w,
int h,
double[] pixels,
com.bc.ceres.core.ProgressMonitor pm)
Retrieves the range of pixels specified by the coordinates as double array.
|
void |
writePixels(int x,
int y,
int w,
int h,
float[] pixels,
com.bc.ceres.core.ProgressMonitor pm)
Retrieves the range of pixels specified by the coordinates as float array.
|
void |
writePixels(int x,
int y,
int w,
int h,
int[] pixels,
com.bc.ceres.core.ProgressMonitor pm)
Retrieves the range of pixels specified by the coordinates as integer array.
|
acceptVisitor, canBeOrthorectified, checkCompatibleRasterData, clearNoDataValue, computeStxImpl, createColorIndexedImage, createCompatibleRasterData, createCompatibleRasterData, createCompatibleSceneRasterData, createDefaultImageInfo, createDefaultImageInfo, createPixelValidator, createPointing, createRgbImage, createSourceImage, createTransectProfileData, dispose, fireImageInfoChanged, getGeoCoding, getGeophysicalDataType, getGeophysicalImage, getGeophysicalNoDataValue, getImageInfo, getImageInfo, getImageInfo, getNoDataValue, getOverlayMaskGroup, getPixels, getPixels, getPixels, getPixelString, getPointing, getRasterData, getRasterHeight, getRasterWidth, getRoiMaskGroup, getSampleFloat, getSampleInt, getScalingFactor, getScalingOffset, getSceneRasterHeight, getSceneRasterWidth, getSourceImage, getStx, getStx, getValidMaskExpression, getValidMaskImage, getValidPixelExpression, getValidShape, hasIntPixels, hasRasterData, isCompatibleRasterData, isFloatingPointType, isGeophysicalImageSet, isLog10Scaled, isNoDataValueSet, isNoDataValueUsed, isPixelValid, isPixelValid, isPixelValid, isScalingApplied, isSourceImageSet, isStxSet, isValidMaskImageSet, isValidMaskProperty, isValidMaskUsed, loadRasterData, processRasterData, quantizeRasterData, quantizeRasterData, readPixels, readPixels, readPixels, readRasterData, readRasterData, readRasterDataFully, readRasterDataFully, readValidMask, resetValidMask, scale, scaleInverse, setGeoCoding, setGeophysicalNoDataValue, setImageInfo, setImageInfo, setLog10Scaled, setModified, setNoDataValue, setNoDataValueUsed, setRasterData, setScalingFactor, setScalingOffset, setSourceImage, setSourceImage, setStx, setValidPixelExpression, updateExpression, writePixels, writePixels, writePixels, writeRasterData, writeRasterData, writeRasterDataFully, writeRasterDataFullycheckDataCompatibility, createCompatibleProductData, fireProductNodeDataChanged, getData, getDataElems, getDataElemSize, getDataType, getNumDataElems, getUnit, isReadOnly, isSynthetic, setData, setDataElems, setReadOnly, setSynthetic, setUnitfireProductNodeChanged, fireProductNodeChanged, getDescription, getDisplayName, getName, getOwner, getProduct, getProductReader, getProductReaderSafe, getProductRefString, getProductSafe, getProductWriter, getProductWriterSafe, getRawStorageSize, isModified, isPartOfSubset, isValidNodeName, removeFromFile, setDescription, setName, setOwner, toStringpublic static final String VIEW_MODE_ORTHO
public static final String VIEW_MODE_FORWARD
public static final String VIEW_MODE_NADIR
public AbstractBand(String name, int dataType, int width, int height)
public void writePixels(int x,
int y,
int w,
int h,
int[] pixels,
com.bc.ceres.core.ProgressMonitor pm)
throws IOException
writePixels in class RasterDataNodex - x offset into the bandy - y offset into the bandw - width of the pixel array to be readh - height of the pixel array to be read.pixels - integer array to be filled with datapm - a monitor to inform the user about progressIOExceptionpublic void writePixels(int x,
int y,
int w,
int h,
float[] pixels,
com.bc.ceres.core.ProgressMonitor pm)
throws IOException
writePixels in class RasterDataNodex - x offset into the bandy - y offset into the bandw - width of the pixel array to be readh - height of the pixel array to be read.pixels - float array to be filled with datapm - a monitor to inform the user about progressIOExceptionpublic void writePixels(int x,
int y,
int w,
int h,
double[] pixels,
com.bc.ceres.core.ProgressMonitor pm)
throws IOException
writePixels in class RasterDataNodex - x offset into the bandy - y offset into the bandw - width of the pixel array to be readh - height of the pixel array to be read.pixels - double array to be filled with datapm - a monitor to inform the user about progressIOExceptionpublic abstract long getRawStorageSize(ProductSubsetDef subsetDef)
getRawStorageSize in class DataNodesubsetDef - if not null the subset may limit the size returnedprotected static int[] ensureMinLengthArray(int[] array,
int length)
protected static float[] ensureMinLengthArray(float[] array,
int length)
protected static double[] ensureMinLengthArray(double[] array,
int length)
@Deprecated public int computeBand(String expression, String validMaskExpression, Product[] sourceProducts, int defaultProductIndex, boolean checkInvalids, boolean useInvalidValue, double noDataValue, com.bc.ceres.core.ProgressMonitor pm) throws IOException, ParseException
expression - the arithmetic expression string, e.g. "1 + log(radiance_5 / radiance_13)"validMaskExpression - the arithmetic expression identifying valid source pixels, e.g. "radiance_5 > 0.0 && radiance_13 > 0.0"sourceProducts - the list of source products possibly referenced in the expressiondefaultProductIndex - the index of the product for which also symbols without the
product prefix $ref-no are registered in the namespacecheckInvalids - if true, the method recognizes numerically invalid values (NaN, Infinity)useInvalidValue - if true, numerically invalid values (NaN, Infinity) are set to invalidValue,
ignored if checkInvalids = falsenoDataValue - the value used in place of numerically invalid values if useInvalidValue =
true, ignored if checkInvalids = falsepm - a monitor to inform the user about progresscheckInvalids = falseIOException - if an I/O error occursParseException - if the expression syntax is invalidpublic ProductData getSceneRasterData()
null.
In opposite to the getRasterData method, this method returns raster data that has at least
getBandOutputRasterWidth()*getBandOutputRasterHeight() elements of the given data type to store the
scene's pixels.
getSceneRasterData in class RasterDataNodeRasterDataNode.getRasterData(),
RasterDataNode.getSceneRasterWidth(),
RasterDataNode.getSceneRasterHeight()public int getPixelInt(int x,
int y)
getPixelInt in class RasterDataNodex - The X co-ordinate of the pixel locationy - The Y co-ordinate of the pixel locationNullPointerException - if this band has no raster dataArrayIndexOutOfBoundsException - if the co-ordinates are not in boundspublic float getPixelFloat(int x,
int y)
getPixelFloat in class RasterDataNodex - The X co-ordinate of the pixel locationy - The Y co-ordinate of the pixel locationNullPointerException - if this band has no raster dataArrayIndexOutOfBoundsException - if the co-ordinates are not in boundspublic double getPixelDouble(int x,
int y)
getPixelDouble in class RasterDataNodex - The X co-ordinate of the pixel locationy - The Y co-ordinate of the pixel locationNullPointerException - if this band has no raster dataArrayIndexOutOfBoundsException - if the co-ordinates are not in boundspublic void setPixelInt(int x,
int y,
int pixelValue)
setPixelInt in class RasterDataNodex - The X co-ordinate of the pixel locationy - The Y co-ordinate of the pixel locationpixelValue - the new pixel valueNullPointerException - if this band has no raster datapublic void setPixelFloat(int x,
int y,
float pixelValue)
setPixelFloat in class RasterDataNodex - The X co-ordinate of the pixel locationy - The Y co-ordinate of the pixel locationpixelValue - the new pixel valueNullPointerException - if this band has no raster datapublic void setPixelDouble(int x,
int y,
double pixelValue)
setPixelDouble in class RasterDataNodex - The X co-ordinate of the pixel locationy - The Y co-ordinate of the pixel locationpixelValue - the new pixel valueNullPointerException - if this band has no raster datapublic int[] readPixels(int x,
int y,
int w,
int h,
int[] pixels,
com.bc.ceres.core.ProgressMonitor pm)
throws IOException
null a new one was created and
returned.readPixels in class RasterDataNodex - x offest of upper left cornery - y offset of upper left cornerw - width of the desired data arrayh - height of the desired data arraypixels - array of integer pixels to be filled with datapm - a monitor to inform the user about progressIllegalArgumentException - if the length of the given array is less than w*h.IOExceptionpublic float[] readPixels(int x,
int y,
int w,
int h,
float[] pixels,
com.bc.ceres.core.ProgressMonitor pm)
throws IOException
null a new one was created and
returned.readPixels in class RasterDataNodex - x offest of upper left cornery - y offset of upper left cornerw - width of the desired data arrayh - height of the desired data arraypixels - array of float pixels to be filled with data.pm - a monitor to inform the user about progressIllegalArgumentException - if the length of the given array is less than w*h.IOExceptionpublic double[] readPixels(int x,
int y,
int w,
int h,
double[] pixels,
com.bc.ceres.core.ProgressMonitor pm)
throws IOException
null a new one was created and
returned.readPixels in class RasterDataNodex - x offest of upper left cornery - y offset of upper left cornerw - width of the desired data arrayh - height of the desired data arraypixels - array of double pixels to be filled with datapm - a monitor to inform the user about progressIllegalArgumentException - if the length of the given array is less than w*h.IOExceptionpublic int[] getPixels(int x,
int y,
int w,
int h,
int[] pixels,
com.bc.ceres.core.ProgressMonitor pm)
null a new one was created and returned.getPixels in class RasterDataNodex - x offset into the bandy - y offset into the bandw - width of the pixel array to be readh - height of the pixel array to be read.pixels - integer array to be filled with datapm - a monitor to inform the user about progressNullPointerException - if this band has no raster dataIllegalArgumentException - if the length of the given array is less than w*h.public float[] getPixels(int x,
int y,
int w,
int h,
float[] pixels,
com.bc.ceres.core.ProgressMonitor pm)
null a new one was created and returned.getPixels in class RasterDataNodex - x offset into the bandy - y offset into the bandw - width of the pixel array to be readh - height of the pixel array to be read.pixels - float array to be filled with datapm - a monitor to inform the user about progressNullPointerException - if this band has no raster dataIllegalArgumentException - if the length of the given array is less than w*h.public double[] getPixels(int x,
int y,
int w,
int h,
double[] pixels,
com.bc.ceres.core.ProgressMonitor pm)
null a new one was created and returned.getPixels in class RasterDataNodex - x offset into the bandy - y offset into the bandw - width of the pixel array to be readh - height of the pixel array to be read.pixels - double array to be filled with datapm - a monitor to inform the user about progressNullPointerException - if this band has no raster dataIllegalArgumentException - if the length of the given array is less than w*h.public void setPixels(int x,
int y,
int w,
int h,
int[] pixels)
setPixels in class RasterDataNodex - x offset into the bandy - y offset into the bandw - width of the pixel array to be writtenh - height of the pixel array to be written.pixels - integer array to be writtenNullPointerException - if this band has no raster datapublic void setPixels(int x,
int y,
int w,
int h,
float[] pixels)
setPixels in class RasterDataNodex - x offset into the bandy - y offset into the bandw - width of the pixel array to be writtenh - height of the pixel array to be written.pixels - float array to be writtenpublic void setPixels(int x,
int y,
int w,
int h,
double[] pixels)
setPixels in class RasterDataNodex - x offset into the bandy - y offset into the bandw - width of the pixel array to be writtenh - height of the pixel array to be written.pixels - double array to be writtenpublic void ensureRasterData()
@Deprecated public void loadRasterData(com.bc.ceres.core.ProgressMonitor pm) throws IOException
After this method has been called successfully, hasRasterData() should always return
true and getRasterData() should always return a valid ProductData instance
with at least getRasterWidth()*getRasterHeight() elements (samples).
In opposite to the readRasterDataFully method, loadRasterData will only read data
if this has not already been done.
loadRasterData in class RasterDataNodepm - a monitor to inform the user about progressIOException - if an I/O error occursRasterDataNode.readRasterDataFully(ProgressMonitor)@Deprecated public void unloadRasterData()
After this method has been called successfully, the hasRasterData() method returns
false and getRasterData() returns null.
unloadRasterData in class RasterDataNodeRasterDataNode.loadRasterData()Copyright © 2002–2014 Brockmann Consult GmbH. All rights reserved.