Adds a value in nm to the spectrum.
Deallocates a color spectrum.
Gets the spectral data. NOTE: This is not normalized
Gets the end value of the spectral data.
Gets the spectral data.
Gets the normalization value of the spectral data. NOTE: This affects every value in the spectrum.
Gets the divisor of the spectra, for instance a .
Gets the size of the spectrum data.
Gets the start value of the spectral data.
Gets the spectrum data at a specified index.
an index into the data
Gets the value from the spectral data for a given wavelength.
the wavelength in nm
Gets the largest normalised value in the spectrum.
Gets the smallest normalised value in the spectrum.
Gets the spectrum data at a specified index, without any normalization applied. Most people should use cd_spectrum_get_value() instead.
an index into the data
Gets the wavelenth that corresponds to the specified index.
an index into the data
Gets the calibration coefficients used to map pixel indexes to wavelengths.
the 1st coefficient
the 2nd coefficient
the 3rd coefficient
Ensures no values in the spectrum fall above a set limit. If they
are found, set them to value
.
the threshold value to limit the spectrum
Ensures no values in the spectrum fall below a set limit. If they
are found, set them to value
.
the threshold value to limit the spectrum
Multiplies a spectra with a scalar value.
a scalar value
Normalizes a spectrum to a specific value at a specific wavelength.
the wavelength in nm
the value to normalize to
Normalizes a spectrum to a specific value at its maximum value.
the value to normalize to
Resample a new spectrum with linear index to wavelength coefficients.
the new spectrum start
the new spectrum end
the resolution to use when resampling
Resample a new spectrum with the desired number of points.
the output spectrum size
Sets the spectrum data.
component value
Set the end value of the spectal data in nm.
If there is already spectral data, the wavelength calibration will also be set automatically.
the end value of the spectral data
Sets a spectrum id.
component id
Set the normalization value of the spectrum. NOTE: This affects every value in the spectrum.
the end value of the spectral data
Set the start value of the spectal data in nm.
the start value of the spectral data
Overwrites the spectrum data at a specified index.
an index into the data
a data value
Sets the calibration coefficients used to map pixel indexes to wavelengths.
This function will set the 'end' wavelength automatically, potentially overwriting the value set by cd_spectrum_set_end().
the 1st coefficient
the 2nd coefficient
the 3rd coefficient
Returns a graphical representation of the spectrum.
the terminal width
the terminal height
Allocates a spectrum.
Allocates a Planckian spectrum at a specific temperature.
the temperature in Kelvin
Allocates a Planckian spectrum at a specific temperature.
the temperature in Kelvin
the new spectrum start
the new spectrum end
the resolution to use when resampling
Allocates a spectrum with a preallocated size.
the future size of the spectrum
Allocates a spectrum.