Module org.apache.sis.feature
Package org.apache.sis.image

# Class Colorizer.Target

Object
Target

Enclosing interface:
  `Colorizer`

public static class Colorizer.Target extends Object
Information about the computed image to colorize. The most important information is the `SampleModel`, as the inferred color model must be compatible with the sample model. A `Target` instance may also contain contextual information such as the `SampleDimension`s of the target coverage.

Since:
  1.4

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Target(SampleModel model, List<SampleDimension> ranges, int visibleBand)`
  Creates a new target with the sample model of the image to colorize.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Optional<List<SampleDimension>>`
  `getRanges()`
  Returns a description of the bands of the image to colorize.
  `SampleModel`
  `getSampleModel()`
  Returns the sample model of the computed image to colorize.
  `OptionalInt`
  `getVisibleBand()`
  Returns the band to colorize if the colorization algorithm uses only one band.

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### Target

    public Target(SampleModel model, List<SampleDimension> ranges, int visibleBand)
    Creates a new target with the sample model of the image to colorize.
    Parameters:
      `model` - sample model of the computed image to colorize (mandatory).
      `ranges` - description of the bands of the computed image to colorize, or `null` if none.
      `visibleBand` - the band to colorize if the colorization algorithm uses only one band, or -1 if none.

- ## Method Details

  - ### getSampleModel

    public SampleModel getSampleModel()
    Returns the sample model of the computed image to colorize. The color model created by `Colorizer​.apply(Target)` must be compatible with this sample model.
    Returns:
      computed image sample model (never null).
    See Also:
      - `ColorModel​.isCompatibleSampleModel(SampleModel)`

  - ### getRanges

    public Optional<List<SampleDimension>> getRanges()
    Returns a description of the bands of the image to colorize. This information may be present if the image operation is invoked by a `GridCoverageProcessor` operation, or if the source image contains the "org.apache.sis.SampleDimensions" property
    Returns:
      description of the bands of the image to colorize.
    See Also:
      - `GridCoverage​.getSampleDimensions()`

  - ### getVisibleBand

    public OptionalInt getVisibleBand()
    Returns the band to colorize if the colorization algorithm uses only one band. The value is always positive and less than the number of bands of the sample model. This information is ignored if the colorization uses many bands (e.g. `Colorizer​.ARGB`).
    Returns:
      the band to colorize if the colorization algorithm uses only one band.
    See Also:
      - `ImageRenderer​.setVisibleBand(int)`