luz: tune spectra towards using e305 and freiefarbe dataset as anchor

parent 9f5baf97
......@@ -713,12 +713,12 @@ luz_parse_spectrum (Luz *luz, char *spectrum)
}
else
{
float num_array [100];
float num_array [1000];
int band;
band = 0;
do {
num_array[band++] = strtod (spectrum, &spectrum);
} while (spectrum && band <= 100);
} while (spectrum && band <= 1000);
if (band > 3)
{
......@@ -731,7 +731,7 @@ luz_parse_spectrum (Luz *luz, char *spectrum)
float nm = nm_start;
for (i = 3; i < band; i++)
{
j = (int) ( (nm - LUZ_SPECTRUM_START) / LUZ_SPECTRUM_GAP);
j = (int) ( (nm - LUZ_SPECTRUM_START) / LUZ_SPECTRUM_GAP + 0.5);
if (j >=0 && j < LUZ_SPECTRUM_BANDS)
{
int k;
......
......@@ -36,14 +36,23 @@ typedef struct _Luz Luz;
#define LUZ_MAX_COATS 16
/* This defines the internal computational spectral working space of luz
* for now it is also the range used for computing tristimulus values,
* this should change - since it is very useful to also have values beyond
* perceptual range for fluoresence and similar purposes.
*
* Initial anchoring for implementation is 360-780nm at 10nm intervals,
* for matching representation of HLC-Colour-Atlas-XL_SpectralData_v1-2.cxf
* and thus get a decent result with nearest-neighbor spectral resampling,
* since our illuminants and observers are given at higher resolution in
* internal configuration.
*/
#define LUZ_SPECTRUM_START 360
#define LUZ_SPECTRUM_GAP 5
#define LUZ_SPECTRUM_GAP 10
#define LUZ_SPECTRUM_END 780 // only used on line below
#define LUZ_SPECTRUM_BANDS (((LUZ_SPECTRUM_END-LUZ_SPECTRUM_START)/LUZ_SPECTRUM_GAP)+1)
Luz *luz_new (const char *config);
void luz_destroy (Luz *luz);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment