create

fun create(iterable: Iterable<Iterable<*>>): RasterData

Creates RasterData from 2D or 3D collection.

Parameters

iterable

2D or 3D collection.

  • (M, N): an image with scalar data. The values are mapped to colors (greys by default) using normalization. See parameters norm, vmin, vmax.

  • (M, N, 3): an image with RGB values (0-1 float or 0-255 int).

  • (M, N, 4): an image with RGBA values (0-1 float or 0-255 int).


fun create(arr: Array<out Array<*>>): RasterData

Creates RasterData from 2D or 3D array.

Parameters

arr

2D or 3D array.

  • (M, N): an image with scalar data. The values are mapped to colors (greys by default) using normalization. See parameters norm, vmin, vmax.

  • (M, N, 3): an image with RGB values (0-1 float or 0-255 int).

  • (M, N, 4): an image with RGBA values (0-1 float or 0-255 int).


fun create(arr: ByteArray, width: Int, height: Int, nChannels: Int): RasterData

Creates RasterData from 1D array with pixel data.

Parameters

arr

Array of Numbers (0-1 float or 0-255 int). Expected size width * height * nChannels.

width

Width of the image in pixels.

height

Height of the image in pixels.

nChannels

Number of channels per pixel.

  • 1: an image with scalar data. The values are mapped to colors (greys by default) using normalization. See parameters norm, vmin, vmax.

  • 3: an image with RGB values (0-1 float or 0-255 int).

  • 4: an image with RGBA values (0-1 float or 0-255 int).


fun create(arr: IntArray, width: Int, height: Int, nChannels: Int): RasterData
fun create(arr: FloatArray, width: Int, height: Int, nChannels: Int): RasterData
fun create(arr: DoubleArray, width: Int, height: Int, nChannels: Int): RasterData
fun create(arr: Array<Number>, width: Int, height: Int, nChannels: Int): RasterData

Creates RasterData from 1D array with pixel data.

Parameters

arr

Array of numbers (0-1 float or 0-255 int). Expected size width * height * nChannels.

width

Width of the image in pixels.

height

Height of the image in pixels.

nChannels

Number of channels per pixel.

  • 1: an image with scalar data. The values are mapped to colors (greys by default) using normalization. See parameters norm, vmin, vmax.

  • 3: an image with RGB values (0-1 float or 0-255 int).

  • 4: an image with RGBA values (0-1 float or 0-255 int).