Top |
CdSpectrum *
cd_spectrum_sized_new (guint reserved_size
);
Allocates a spectrum with a preallocated size.
Since: 1.1.6
CdSpectrum *
cd_spectrum_planckian_new (gdouble temperature
);
Allocates a Planckian spectrum at a specific temperature.
Since: 1.1.6
CdSpectrum * cd_spectrum_planckian_new_full (gdouble temperature
,gdouble start
,gdouble end
,gdouble resolution
);
Allocates a Planckian spectrum at a specific temperature.
temperature |
the temperature in Kelvin |
|
start |
the new spectrum start |
|
end |
the new spectrum end |
|
resolution |
the resolution to use when resampling |
Since: 1.3.1
void
cd_spectrum_free (CdSpectrum *spectrum
);
Deallocates a color spectrum.
Since: 1.1.6
void cd_spectrum_limit_min (CdSpectrum *spectrum
,gdouble value
);
Ensures no values in the spectrum fall below a set limit. If they
are found, set them to value
.
Since: 1.3.1
void cd_spectrum_limit_max (CdSpectrum *spectrum
,gdouble value
);
Ensures no values in the spectrum fall above a set limit. If they
are found, set them to value
.
Since: 1.3.1
void cd_spectrum_normalize (CdSpectrum *spectrum
,gdouble wavelength
,gdouble value
);
Normalizes a spectrum to a specific value at a specific wavelength.
spectrum |
a CdSpectrum instance |
|
wavelength |
the wavelength in nm |
|
value |
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.
Since: 1.2.6
CdSpectrum * cd_spectrum_subtract (CdSpectrum *s1
,CdSpectrum *s2
,gdouble resolution
);
Subtracts one spectral plot from another. If the spectra have the same start, end and the same number of data points they are not resampled.
s1 |
a CdSpectrum instance, e.g. a sample |
|
s2 |
a CdSpectrum instance, e.g. a dark calibration |
|
resolution |
the resolution to use when resampling |
Since: 1.3.1
gchar * cd_spectrum_to_string (CdSpectrum *spectrum
,guint max_width
,guint max_height
);
Returns a graphical representation of the spectrum.
spectrum |
a CdSpectrum instance |
|
max_width |
the terminal width |
|
max_height |
the terminal height |
Since: 1.3.1
const gchar *
cd_spectrum_get_id (const CdSpectrum *spectrum
);
Gets the spectral data.
Since: 1.1.6
GArray *
cd_spectrum_get_data (const CdSpectrum *spectrum
);
Gets the spectral data. NOTE: This is not normalized
Since: 1.1.6
gdouble
cd_spectrum_get_start (const CdSpectrum *spectrum
);
Gets the start value of the spectral data.
Since: 1.1.6
gdouble
cd_spectrum_get_end (const CdSpectrum *spectrum
);
Gets the end value of the spectral data.
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.
Since: 1.1.6
gdouble
cd_spectrum_get_resolution (const CdSpectrum *spectrum
);
Gets the divisor of the spectra, for instance a .
Since: 1.2.6
guint
cd_spectrum_get_size (const CdSpectrum *spectrum
);
Gets the size of the spectrum data.
Since: 1.1.6
gdouble
cd_spectrum_get_value_max (const CdSpectrum *spectrum
);
Gets the largest normalised value in the spectrum.
Since: 1.3.1
gdouble
cd_spectrum_get_value_min (const CdSpectrum *spectrum
);
Gets the smallest normalised value in the spectrum.
Since: 1.3.1
gdouble cd_spectrum_get_value (const CdSpectrum *spectrum
,guint idx
);
Gets the spectrum data at a specified index.
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.
Since: 1.2.6
gdouble cd_spectrum_get_wavelength (const CdSpectrum *spectrum
,guint idx
);
Gets the wavelenth that corresponds to the specified index.
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.
Since: 1.1.6
void cd_spectrum_set_id (CdSpectrum *spectrum
,const gchar *id
);
Sets a spectrum id.
Since: 1.1.6
void cd_spectrum_set_data (CdSpectrum *spectrum
,GArray *value
);
Sets the spectrum data.
Since: 1.1.6
void cd_spectrum_set_start (CdSpectrum *spectrum
,gdouble start
);
Set the start value of the spectal data in nm.
Since: 1.1.6
void cd_spectrum_set_end (CdSpectrum *spectrum
,gdouble end
);
Set the end value of the spectal data in nm.
If there is already spectral data, the wavelength calibration will also be set automatically.
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.
Since: 1.1.6
void cd_spectrum_set_value (CdSpectrum *spectrum
,guint idx
,gdouble data
);
Overwrites the spectrum data at a specified index.
Since: 1.2.6
void cd_spectrum_add_value (CdSpectrum *spectrum
,gdouble data
);
Adds a value in nm to the spectrum.
Since: 1.1.6
void cd_spectrum_set_wavelength_cal (CdSpectrum *spectrum
,gdouble c1
,gdouble c2
,gdouble c3
);
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()
.
spectrum |
a CdSpectrum instance |
|
c1 |
the 1st coefficient |
|
c2 |
the 2nd coefficient |
|
c3 |
the 3rd coefficient |
Since: 1.3.1
void cd_spectrum_get_wavelength_cal (CdSpectrum *spectrum
,gdouble *c1
,gdouble *c2
,gdouble *c3
);
Gets the calibration coefficients used to map pixel indexes to wavelengths.
spectrum |
a CdSpectrum instance |
|
c1 |
the 1st coefficient |
|
c2 |
the 2nd coefficient |
|
c3 |
the 3rd coefficient |
Since: 1.3.1
CdSpectrum * cd_spectrum_multiply (CdSpectrum *s1
,CdSpectrum *s2
,gdouble resolution
);
Multiplies two spectra together.
s1 |
a CdSpectrum instance, possibly an illuminant. |
|
s2 |
a CdSpectrum instance, possibly an absorption spectrum. |
|
resolution |
the step size in nm |
Since: 1.1.6
CdSpectrum * cd_spectrum_resample (CdSpectrum *spectrum
,gdouble start
,gdouble end
,gdouble resolution
);
Resample a new spectrum with linear index to wavelength coefficients.
spectrum |
a CdSpectrum instance |
|
start |
the new spectrum start |
|
end |
the new spectrum end |
|
resolution |
the resolution to use when resampling |
Since: 1.3.1
CdSpectrum * cd_spectrum_resample_to_size (CdSpectrum *spectrum
,guint size
);
Resample a new spectrum with the desired number of points.
Since: 1.3.4