| colord Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | ||||
CdSpectrum * cd_spectrum_new (void); CdSpectrum * cd_spectrum_sized_new (guint reserved_size); CdSpectrum * cd_spectrum_planckian_new (gdouble temperature); void cd_spectrum_free (CdSpectrum *spectrum); CdSpectrum * cd_spectrum_dup (const CdSpectrum *spectrum); void cd_spectrum_normalize (CdSpectrum *spectrum,gdouble wavelength,gdouble value); void cd_spectrum_normalize_max (CdSpectrum *spectrum,gdouble value); const gchar * cd_spectrum_get_id (const CdSpectrum *spectrum); GArray * cd_spectrum_get_data (const CdSpectrum *spectrum); gdouble cd_spectrum_get_start (const CdSpectrum *spectrum); gdouble cd_spectrum_get_end (const CdSpectrum *spectrum); gdouble cd_spectrum_get_norm (const CdSpectrum *spectrum); gdouble cd_spectrum_get_resolution (const CdSpectrum *spectrum); guint cd_spectrum_get_size (const CdSpectrum *spectrum); gdouble cd_spectrum_get_value (const CdSpectrum *spectrum,guint idx); gdouble cd_spectrum_get_value_raw (const CdSpectrum *spectrum,guint idx); gdouble cd_spectrum_get_wavelength (const CdSpectrum *spectrum,guint idx); gdouble cd_spectrum_get_value_for_nm (const CdSpectrum *spectrum,gdouble wavelength); void cd_spectrum_set_id (CdSpectrum *spectrum,const gchar *id); void cd_spectrum_set_data (CdSpectrum *spectrum,GArray *value); void cd_spectrum_set_start (CdSpectrum *spectrum,gdouble start); void cd_spectrum_set_end (CdSpectrum *spectrum,gdouble end); void cd_spectrum_set_norm (CdSpectrum *spectrum,gdouble norm); void cd_spectrum_set_value (CdSpectrum *spectrum,guint idx,gdouble data); void cd_spectrum_add_value (CdSpectrum *spectrum,gdouble data); CdSpectrum * cd_spectrum_multiply (CdSpectrum *s1,CdSpectrum *s2,gdouble resolution);
CdSpectrum * cd_spectrum_new (void);
Allocates a spectrum.
Returns : |
A newly allocated CdSpectrum object |
Since 1.1.6
CdSpectrum * cd_spectrum_sized_new (guint reserved_size);
Allocates a spectrum with a preallocated size.
|
the future size of the spectrum |
Returns : |
A newly allocated CdSpectrum object |
Since 1.1.6
CdSpectrum * cd_spectrum_planckian_new (gdouble temperature);
Allocates a Planckian spectrum at a specific temperature.
|
the temperature in Kelvin |
Returns : |
A newly allocated CdSpectrum object |
Since 1.1.6
void cd_spectrum_free (CdSpectrum *spectrum);
Deallocates a color spectrum.
|
the spectrum |
Since 1.1.6
CdSpectrum * cd_spectrum_dup (const CdSpectrum *spectrum);
|
a CdSpectrum instance. |
Since 1.1.6
void cd_spectrum_normalize (CdSpectrum *spectrum,gdouble wavelength,gdouble value);
Normalizes a spectrum to a specific value at a specific wavelength.
|
a CdSpectrum instance |
|
the wavelength in nm |
|
the value to normalize to |
Since 1.1.6
void cd_spectrum_normalize_max (CdSpectrum *spectrum,gdouble value);
Normalizes a spectrum to a specific value at its maximum value.
|
a CdSpectrum instance |
|
the value to normalize to |
Since 1.2.6
const gchar * cd_spectrum_get_id (const CdSpectrum *spectrum);
Gets the spectral data.
|
a CdSpectrum instance. |
Returns : |
the textual ID of the sample |
Since 1.1.6
GArray * cd_spectrum_get_data (const CdSpectrum *spectrum);
Gets the spectral data. NOTE: This is not normalized
|
a CdSpectrum instance. |
Returns : |
spectral data. [transfer none][element-type gdouble] |
Since 1.1.6
gdouble cd_spectrum_get_start (const CdSpectrum *spectrum);
Gets the start value of the spectral data.
|
a CdSpectrum instance. |
Returns : |
the value in nm |
Since 1.1.6
gdouble cd_spectrum_get_end (const CdSpectrum *spectrum);
Gets the end value of the spectral data.
|
a CdSpectrum instance. |
Returns : |
the value in nm |
Since 1.1.6
gdouble cd_spectrum_get_norm (const CdSpectrum *spectrum);
Gets the normalization value of the spectral data. NOTE: This affects every value in the spectrum.
|
a CdSpectrum instance. |
Returns : |
the value |
Since 1.1.6
gdouble cd_spectrum_get_resolution (const CdSpectrum *spectrum);
Gets the divisor of the spectra, for instance a .
|
a CdSpectrum instance. |
Returns : |
the value |
Since 1.2.6
guint cd_spectrum_get_size (const CdSpectrum *spectrum);
Gets the size of the spectrum data.
|
a CdSpectrum instance. |
Returns : |
number of data items in this spectrum |
Since 1.1.6
gdouble cd_spectrum_get_value (const CdSpectrum *spectrum,guint idx);
Gets the spectrum data at a specified index.
|
a CdSpectrum instance. |
|
an index into the data |
Returns : |
spectral data value, or -1 for invalid |
Since 1.1.6
gdouble cd_spectrum_get_value_raw (const CdSpectrum *spectrum,guint idx);
Gets the spectrum data at a specified index, without any normalization
applied. Most people should use cd_spectrum_get_value() instead.
|
a CdSpectrum instance. |
|
an index into the data |
Returns : |
spectral data value, or -1 for invalid |
Since 1.2.6
gdouble cd_spectrum_get_wavelength (const CdSpectrum *spectrum,guint idx);
Gets the wavelenth that corresponds to the specified index.
|
a CdSpectrum instance. |
|
an index into the data |
Returns : |
wavelenth value in nm, or -1 for invalid |
Since 1.1.6
gdouble cd_spectrum_get_value_for_nm (const CdSpectrum *spectrum,gdouble wavelength);
Gets the value from the spectral data for a given wavelength.
|
a CdSpectrum instance. |
|
the wavelength in nm |
Returns : |
the value for the wavelength |
Since 1.1.6
void cd_spectrum_set_id (CdSpectrum *spectrum,const gchar *id);
Sets a spectrum id.
|
the destination spectrum |
|
component id |
Since 1.1.6
void cd_spectrum_set_data (CdSpectrum *spectrum,GArray *value);
Sets the spectrum data.
|
the destination spectrum |
|
component value. [element-type gdouble] |
Since 1.1.6
void cd_spectrum_set_start (CdSpectrum *spectrum,gdouble start);
Set the start value of the spectal data in nm.
|
a CdSpectrum instance. |
|
the start value of the spectral data |
Since 1.1.6
void cd_spectrum_set_end (CdSpectrum *spectrum,gdouble end);
Set the end value of the spectal data in nm.
|
a CdSpectrum instance. |
|
the end value of the spectral data |
Since 1.1.6
void cd_spectrum_set_norm (CdSpectrum *spectrum,gdouble norm);
Set the normalization value of the spectrum. NOTE: This affects every value in the spectrum.
|
a CdSpectrum instance. |
|
the end value of the spectral data |
Since 1.1.6
void cd_spectrum_set_value (CdSpectrum *spectrum,guint idx,gdouble data);
Overwrites the spectrum data at a specified index.
|
a CdSpectrum instance. |
|
an index into the data |
|
a data value |
Since 1.2.6
void cd_spectrum_add_value (CdSpectrum *spectrum,gdouble data);
Adds a value in nm to the spectrum.
|
the spectrum |
Since 1.1.6
CdSpectrum * cd_spectrum_multiply (CdSpectrum *s1,CdSpectrum *s2,gdouble resolution);
Multiplies two spectra together.
|
a CdSpectrum instance, possibly an illuminant. |
|
a CdSpectrum instance, possibly an absorption spectrum. |
|
the step size in nm |
Returns : |
a CdSpectrum instance |
Since 1.1.6