📄 gridcoverage.java
字号:
* @see Raster#getPixels(int,int,int,int,float[]) * @see javax.media.jai.UnpackedImageData#getFloatData() */ float[] getDataBlock(GridRange gridRange, float[] destination) throws InvalidRangeException, ArrayIndexOutOfBoundsException; /** * Return a sequence of double values for a block. * A value for each sample dimension will be returned. * * The return value is an <VAR>N</VAR>+1 dimensional safe-array, with dimensions * (sample dimension, dimension <var>n</var>, dimension <var>n</var>-1, ... dimension 1). * * For 2 dimensional grid coverages, this safe array will be accessed as * (sample dimension, column, row). * * The index values will be based from 0. The indices in the returned <VAR>N</VAR> dimensional * safe array will need to be offset by <code>gridRange</code> {@linkplain GridRange#getLower() * minimum coordinates} to get equivalent grid coordinates. * <br><br> * The requested grid range must satisfy the following rules for each dimension of the grid * coverage: * <center> * minimum grid coordinate <= {@linkplain GridRange#getLower() grid range mimimun} <= * {@linkplain GridRange#getUpper() grid range maximum} <= maximum grid coordinate * </center> * * The number of values returned will equal: * <center> * (max<sub>1</sub> � min<sub>1</sub> + 1) * * (max<sub>2</sub> � min<sub>2</sub> + 1) ... * * (max<sub>n</sub> � min<sub>n</sub> + 1) * * {@link #getNumSampleDimensions numSampleDimensions} * </center> * * Where <var>min</var> is the minimum ordinate in the grid range, * <var>max</var> is the maximum ordinate in the grid range and * <VAR>N</VAR> is the number of dimensions in the grid coverage. * * @param gridRange Grid range for block of data to be accessed. * @param destination An optionally preallocated array in which to store the values, * or <code>null</code> if none. * @return A sequence of double values for a given block in the coverage. * If <code>destination</code> was non-null, then it is returned. * Otherwise, a new array is allocated and returned. * @throws InvalidRangeException if <code>gridRange</code> is out of this grid range bounds. * @throws ArrayIndexOutOfBoundsException if the <code>destination</code> array is not null * and too small to hold the output. * @UML operation getValueBlockAsDouble * * @rename Renamed <code>getValueBlockAsDouble</code> as <code>getDataBlockAsDouble</code> * for consistency with all others <code>getDataBlock...</code> methods and * <code>setDataBlockAsDouble</code>. * * @revisit Which indices vary fastest? * * @see #setDataBlock(GridRange, double[]) * @see Raster#getPixels(int,int,int,int,double[]) * @see javax.media.jai.UnpackedImageData#getDoubleData() */ double[] getDataBlock(GridRange gridRange, double[] destination) throws InvalidRangeException, ArrayIndexOutOfBoundsException; /** * Return a block of grid coverage data for all sample dimensions. * A value for each sample dimension will be returned. * This operation provides efficient access of the grid values. * The sequencing order of the values in the sequence will follow the rules * given by <code>valueInBytePacking</code> and <code>bandPacking</code> * defined in {@link GridPacking}. * * The requested grid range must satisfy the following rules for each dimension * of the grid coverage: * * <center> * minimum grid coordinate <= {@linkplain GridRange#getLower() grid range mimimun} <= * {@linkplain GridRange#getUpper() grid range maximum} <= maximum grid coordinate * </center> * * The sequence of bytes returned will match the data type of * the dimension. For example, a grid with one 16 bit unsigned * ({@link org.opengis.coverage.SampleDimensionType#UNSIGNED_16BITS UNSIGNED_16BITS}) * sample dimension will return 2 bytes for every cell in the block. * <br><br> * <strong>Byte padding rules for grid values of less than 8 bits</strong><br> * For 2D grid coverages, padding is to the nearest byte for the following cases: * * <table cellpadding=6 border=0> * <tr> <td>For PixelInterleaved</td> * <td>For grids with multiple sample dimensions, padding occurs between * pixels for each change in dimension type.</td> * </tr> * <tr> <td>For LineInterleaved</td> * <td>Padding occurs at the end of each row or column (depending on the * valueSequence of the grid).</td> * </tr> * <tr> <td>For BandSequencial</td> * <td>Padding occurs at the end of every sample dimension.</td> * </tr> * </table> * * For grid values smaller than 8 bits, their order within each byte is given by the * value defined in {@link GridPacking#getValueInBytePacking valueInBytePacking}. * For grid values bigger than 8 bits, the order of their bytes is given by the * value defined in {@link GridPacking#getByteInValuePacking byteInValuePacking}. * * @param gridRange Grid range for block of data to be accessed. * @return a block of grid coverage data for all sample dimensions. * @throws InvalidRangeException if <code>gridRange</code> is out of this grid range bounds. * @UML operation #getPackedDataBlock * * @revisit This operation can't be implemented efficiently in Java with a <code>byte[]</code> * return type, since there is no way to cast an array of arbitrary type to an array * of type <code>byte[]</code>. Even the <code>java.nio.Buffer</code> doesnt allow * that (it allows the opposite way however). */ byte[] getPackedDataBlock(GridRange gridRange) throws InvalidRangeException; /** * Set a block of boolean values for all sample dimensions. * The semantic is the same as {@link #setDataBlock(GridRange, double[])}. * * @param gridRange Grid range for block of data to be accessed. * @param values Sequence of grid values for the given region. * @throws InvalidRangeException if <code>gridRange</code> is out of this grid range bounds. * @throws GridNotEditableException if the grid coverage is not {@linkplain #isDataEditable editable}. * @throws ArrayIndexOutOfBoundsException if the <code>values</code> array is too small. * @UML operation setDataBlockAsBoolean * * @see #isDataEditable * @see #getDataBlock(GridRange, boolean[]) */ void setDataBlock(GridRange gridRange, boolean[] values) throws InvalidRangeException, GridNotEditableException, ArrayIndexOutOfBoundsException; /** * Set a block of 8 bits values for all sample dimensions. * The semantic is the same as {@link #setDataBlock(GridRange, double[])}. * * @param gridRange Grid range for block of data to be accessed. * @param values Sequence of grid values for the given region. * @throws InvalidRangeException if <code>gridRange</code> is out of this grid range bounds. * @throws GridNotEditableException if the grid coverage is not {@linkplain #isDataEditable editable}. * @throws ArrayIndexOutOfBoundsException if the <code>values</code> array is too small. * @UML operation setDataBlockAsByte * * @see #isDataEditable * @see #getDataBlock(GridRange, byte[]) */ void setDataBlock(GridRange gridRange, byte[] values) throws InvalidRangeException, GridNotEditableException, ArrayIndexOutOfBoundsException; /** * Set a block of 16 bits values for all sample dimensions. * The semantic is the same as {@link #setDataBlock(GridRange, double[])}. * * @param gridRange Grid range for block of data to be accessed. * @param values Sequence of grid values for the given region. * @throws InvalidRangeException if <code>gridRange</code> is out of this grid range bounds. * @throws GridNotEditableException if the grid coverage is not {@linkplain #isDataEditable editable}. * @throws ArrayIndexOutOfBoundsException if the <code>values</code> array is too small. * @UML operation setDataBlockAsByte * * @see #isDataEditable * @see #getDataBlock(GridRange, short[]) */ void setDataBlock(GridRange gridRange, short[] values) throws InvalidRangeException, GridNotEditableException, ArrayIndexOutOfBoundsException; /** * Set a block of 32 bits values for all sample dimensions. * The semantic is the same as {@link #setDataBlock(GridRange, double[])}. * * @param gridRange Grid range for block of data to be accessed. * @param values Sequence of grid values for the given region. * @throws InvalidRangeException if <code>gridRange</code> is out of this grid range bounds. * @throws GridNotEditableException if the grid coverage is not {@linkplain #isDataEditable editable}. * @throws ArrayIndexOutOfBoundsException if the <code>values</code> array is too small. * @UML operation setDataBlockAsInteger * * @see #isDataEditable * @see #getDataBlock(GridRange, int[]) * @see WritableRaster#setPixels(int,int,int,int,int[]) */ void setDataBlock(GridRange gridRange, int[] values) throws InvalidRangeException, GridNotEditableException, ArrayIndexOutOfBoundsException; /** * Set a block of float values for all sample dimensions. * The semantic is the same as {@link #setDataBlock(GridRange, double[])}. * * @param gridRange Grid range for block of data to be accessed. * @param values Sequence of grid values for the given region. * @throws InvalidRangeException if <code>gridRange</code> is out of this grid range bounds. * @throws GridNotEditableException if the grid coverage is not {@linkplain #isDataEditable editable}. * @throws ArrayIndexOutOfBoundsException if the <code>values</code> array is too small. * @UML operation setDataBlockAsInteger * * @see #isDataEditable * @see #getDataBlock(GridRange, float[]) * @see WritableRaster#setPixels(int,int,int,int,float[]) */ void setDataBlock(GridRange gridRange, float[] values) throws InvalidRangeException, GridNotEditableException, ArrayIndexOutOfBoundsException; /** * Set a block of double values for all sample dimensions. * The requested grid range must satisfy the following rules for each * dimension of the grid coverage: * * <center> * minimum grid coordinate <= {@linkplain GridRange#getLower() grid range mimimun} <= * {@linkplain GridRange#getUpper() grid range maximum} <= maximum grid coordinate * </center> * * The number of values must equal: * * <center> * (max<sub>1</sub> � min<sub>1</sub> + 1) * * (max<sub>2</sub> � min<sub>2</sub> + 1) ... * * (max<sub>n</sub> � min<sub>n</sub> + 1) * * {@link #getNumSampleDimensions numSampleDimensions} * </center> * * Where <var>min</var> is the minimum ordinate in the grid range, * <var>max</var> is the maximum ordinate in the grid range and * <VAR>N</VAR> is the number of dimensions in the grid coverage. * * @param gridRange Grid range for block of data to be accessed. * @param values Sequence of grid values for the given region. * @throws InvalidRangeException if <code>gridRange</code> is out of this grid range bounds. * @throws GridNotEditableException if the grid coverage is not {@linkplain #isDataEditable editable}. * @throws ArrayIndexOutOfBoundsException if the <code>values</code> array is too small. * @UML operation setDataBlockAsDouble * * @see #isDataEditable * @see #getDataBlock(GridRange, double[]) * @see WritableRaster#setPixels(int,int,int,int,double[]) */ void setDataBlock(GridRange gridRange, double[] values) throws InvalidRangeException, GridNotEditableException, ArrayIndexOutOfBoundsException; /** * Set a block of grid coverage data for all sample dimensions. * See {@link #getPackedDataBlock} for details on how to pack the values. * * @param gridRange Grid range for block of data to be accessed. * @param values Sequence of grid values for the given region. * @throws InvalidRangeException if <code>gridRange</code> is out of this grid range bounds. * @throws GridNotEditableException if the grid coverage is not {@linkplain #isDataEditable editable}. * @throws ArrayIndexOutOfBoundsException if the <code>values</code> array is too small. * @UML operation setPackedDataBlock * * @revisit This operation can hardly be implemented efficiently in Java with a * <code>byte[]</code> argument type, since we can't easily cast an array * of <code>byte[]</code> to an array of arbitrary type. */ void setPackedDataBlock(GridRange gridRange, byte[] values) throws InvalidRangeException, GridNotEditableException, ArrayIndexOutOfBoundsException;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -