Show / Hide Table of Contents

# Class SpectralData

Class describing spectral reflectance data

##### Inheritance

object
SpectralData

##### Implements

ISpectralData

##### Inherited Members

object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()

###### Namespace: NixUniversalSDK

###### Assembly: NixUniversalSDK.dll

##### Syntax

    public class SpectralData : ISpectralData

### Constructors

#### SpectralData(int[], float[], ScanMode)

Constructs a SpectralData instance from 10 nm spectral reflectance values.

##### Declaration

    public SpectralData(int[] lambda, float[] value, ScanMode mode = ScanMode.M2)

##### Parameters

Type | Name | Description
--- | --- | ---
int[] | lambda | Wavelength values
float[] | value | Spectral reflectance values. Each entry `i` in this array corresponds to a wavelength value in `lambda` at the same index.
ScanMode | mode | Scan mode for this measurement.

### Properties

#### Interval

Wavelength spacing (e.g. - 10 nm)

##### Declaration

    public int Interval { get; }

##### Property Value

Type | Description
--- | ---
int |

#### Lambda

Wavelength values. Each entry `i` in this array corresponds to a spectral value in Value at the same index.

##### Declaration

    public int[] Lambda { get; }

##### Property Value

Type | Description
--- | ---
int[] |

#### Mode

Scan mode for this measurement.

##### Declaration

    public ScanMode Mode { get; }

##### Property Value

Type | Description
--- | ---
ScanMode |

#### Value

Spectral reflectance values. Each entry `i` in this array corresponds to a wavelength value in Lambda at the same index.

##### Declaration

    public float[] Value { get; }

##### Property Value

Type | Description
--- | ---
float[] |

### Methods

#### Interpolate(float)

Provides an interpolated reflectance value at a specified wavelength value using natural cubic spines. The cubic splines are evaluated at the points specified by Lambda and Value. Interpolated values are evaluated using natural cubic splines.

##### Declaration

    public float Interpolate(float lT)

##### Parameters

Type | Name | Description
--- | --- | ---
float | lT | Wavelength (nm) at which to query the interpolated reflectance

##### Returns

Type | Description
--- | ---
float | Interpolated reflectance value at lT

#### ToColorData(ReferenceWhite, ColorType)

Provides color data from this measurement for the specified illuminant and observer white point. Result is `null` if an invalid white point is specified.

##### Declaration

    public IColorData ToColorData(ReferenceWhite reference = ReferenceWhite.D50_2, ColorType type = ColorType.CIEXYZ)

##### Parameters

Type | Name | Description
--- | --- | ---
ReferenceWhite | reference | Selected reference white (defaults to D50_2)
ColorType | type | Output color type (defaults to CIEXYZ)

##### Returns

Type | Description
--- | ---
IColorData | Color data, or `null` if an invalid white point is specified

### Implements

ISpectralData

### Extension Methods

ISpectralDataExtensions.ToColorData(ISpectralData, Illuminant, Observer, ColorType)
ISpectralDataExtensions.ToDensityData(ISpectralData, DensityStatus)
ISpectralDataExtensions.ToRgbValue(ISpectralData, Illuminant, Observer)
ISpectralDataExtensions.ToRgbValue(ISpectralData, ReferenceWhite)