Show:

An encapsulation of a RasterBand's color table.

var colorTable = band.colorTable;

band.colorTable = new gdal.ColorTable(gdal.GPI_RGB);

Methods

clone () gdal.ColorTable

Clones the instance. The newly created ColorTable is not owned by any RasterBand.

Returns:

count () Number

Returns the number of color entries.

Returns:

Number
forEach
(
  • callback
)

Iterates through all color entries using a callback function.

Parameters:

  • callback forEachCb

    The callback to be called with each Color

Example:

band.colorTable.forEach(function(array, i) { ... });`
get
(
  • index
)
Color

Returns the color with the given ID.

Parameters:

  • index Number

Returns:

Color
isSame
(
  • other
)
Boolean

Compares two ColorTable objects for equality

Parameters:

Returns:

Boolean
map<U>
(
  • callback
)
U[]

Iterates through color entries using a callback function and builds an array of the returned values.

Parameters:

  • callback mapCb

    The callback to be called with each Color

Returns:

U[]

Example:

var result = band.colorTable.map(function(array, i) {
    return value;
});`
ramp
(
  • start_index
  • start_color
  • end_index
  • end_color
)
Number

Creates a color ramp from one color entry to another.

Parameters:

  • start_index Number
  • start_color Color
  • end_index Number
  • end_color Color

Returns:

Number:

total number of color entries

set
(
  • index
  • color
)
Void

Sets the color entry with the given ID.

Parameters:

  • index Number
  • color Color

Returns:

Void
Symbol.iterator ()

Iterates through all color entries using an iterator

Example:

for (const array of band.colorTable) {
}

Attributes

band

gdal.RasterBand | Undefined readonly

Parent band

interpretation

String readonly

Color interpretation of the palette