Class SampleDimensions

java.lang.Object
org.apache.sis.util.Static
org.apache.sis.internal.coverage.SampleDimensions

public final class SampleDimensions extends Static
Utility methods working on SampleDimension instances.
Since:
1.2
Version:
1.2
  • Constructor Details

    • SampleDimensions

      private SampleDimensions()
      Do not allow instantiation of this class.
  • Method Details

    • backgrounds

      public static Number[] backgrounds(List<SampleDimension> bands)
      Returns the background values of all bands in the given list. The length of the returned array is the number of sample dimensions. If a sample dimension does not declare a background value, the corresponding array element is null.
      Parameters:
      bands - the bands for which to get background values, or null.
      Returns:
      the background values, or null if the given argument was null. Otherwise the returned array is never null but may contain null elements.
    • toSampleFilters

      public static DoubleUnaryOperator[] toSampleFilters(ImageProcessor processor, List<SampleDimension> bands)
      Returns the sampleFilters arguments to use in a call to ImageProcessor.statistics(…) for excluding no-data values. If the given sample dimensions are converted to units of measurement, then all "no data" values are already NaN values and this method returns an array of null operators. Otherwise this method returns an array of operators that covert "no data" values to Double.NaN.

      This method is not in public API because it partially duplicates the work of transfer function.

      Parameters:
      processor - the processor to use for creating DoubleUnaryOperator.
      bands - the sample dimensions for which to create sampleFilters, or null.
      Returns:
      the filters, or null if bands was null. The array may contain null elements.