57
The following table gives the CIE color matching functions
58
\f$\bar{x}(\lambda)\f$, \f$\bar{y}(\lambda)\f$, and
59
\f$\bar{z}(\lambda)\f$, for wavelengths \f$\lambda\f$ at 5 nanometer
60
increments from 380 nm through 780 nm. This table is used in conjunction
61
with Planck's law for the energy spectrum of a black body at a given
62
temperature to plot the black body curve on the CIE chart.
57
The following table gives the CIE color matching functions
58
\f$\bar{x}(\lambda)\f$, \f$\bar{y}(\lambda)\f$, and
59
\f$\bar{z}(\lambda)\f$, for wavelengths \f$\lambda\f$ at 5 nanometer
60
increments from 380 nm through 780 nm. This table is used in conjunction
61
with Planck's law for the energy spectrum of a black body at a given
62
temperature to plot the black body curve on the CIE chart.
64
The following table gives the spectral chromaticity co-ordinates
65
\f$x(\lambda)\f$ and \f$y(\lambda)\f$ for wavelengths in 5 nanometer
66
increments from 380 nm through 780 nm. These coordinates represent the
67
position in the CIE x-y space of pure spectral colors of the given
68
wavelength, and thus define the outline of the CIE "tongue" diagram.
70
static const double spectral_chromaticity[81][3] =
72
{ 0.1741, 0.0050 }, // 380 nm
152
{ 0.7347, 0.2653 } // 780 nm
64
The following table gives the spectral chromaticity co-ordinates
65
\f$x(\lambda)\f$ and \f$y(\lambda)\f$ for wavelengths in 5 nanometer
66
increments from 380 nm through 780 nm. These coordinates represent the
67
position in the CIE x-y space of pure spectral colors of the given
68
wavelength, and thus define the outline of the CIE "tongue" diagram.
70
static const double spectral_chromaticity[81][3] =
72
{ 0.1741, 0.0050 }, // 380 nm
152
{ 0.7347, 0.2653 } // 780 nm
155
155
class CIETongueWidget::CIETongueWidgetPriv
211
211
CIETongueWidget::CIETongueWidget(int w, int h, QWidget* parent, cmsHPROFILE hMonitor)
212
: QWidget(parent), d(new CIETongueWidgetPriv)
212
: QWidget(parent), d(new CIETongueWidgetPriv)
214
214
d->progressTimer = new QTimer(this);
215
215
setMinimumSize(w, h);
384
384
if (cmsTakeCharTargetData(hProfile, &CharTarget, &CharTargetSize))
386
386
LCMSHANDLE hSheet = cmsxIT8LoadFromMem(CharTarget, CharTargetSize);
387
388
if (hSheet != NULL)
389
390
cmsxPCollLoadFromSheet(&(d->Measurement), hSheet);
441
442
int ix = (x - 380) / 5;
443
444
cmsCIExyY p = {spectral_chromaticity[ix][0],
444
spectral_chromaticity[ix][1], 1};
445
spectral_chromaticity[ix][1], 1
447
449
mapPoint(icx, icy, &p);
574
576
int ix = (x - 380) / 5;
576
578
cmsCIExyY p = {spectral_chromaticity[ix][0],
577
spectral_chromaticity[ix][1], 1};
579
spectral_chromaticity[ix][1], 1
580
583
mapPoint(icx, icy, &p);
675
678
hsRGB = cmsCreate_sRGBProfile();
677
680
cmsHTRANSFORM xform = cmsCreateTransform(hsRGB, TYPE_RGB_16, hXYZ, TYPE_XYZ_16,
678
INTENT_ABSOLUTE_COLORIMETRIC, cmsFLAGS_NOTPRECALC);
681
INTENT_ABSOLUTE_COLORIMETRIC, cmsFLAGS_NOTPRECALC);
679
682
WORD RGB[3], XYZ[3];
680
683
cmsCIEXYZ xyz, MediaWhite;
681
684
cmsCIExyY xyY, WhitePt;
691
694
for (b=0; b < 65536; b += 1024)
693
RGB[0] = r; RGB[1] = g; RGB[2] = b;
694
699
cmsDoTransform(xform, RGB, XYZ, 1);
695
700
cmsXYZEncoded2Float(&xyz, XYZ);
696
701
cmsXYZ2xyY(&xyY, &xyz);
855
861
if (d->uncalibratedColor)
857
863
p.drawText(0, 0, width(), height(), Qt::AlignCenter,
858
i18n("Uncalibrated color space"));
864
i18n("Uncalibrated color space"));
862
868
p.setPen(Qt::red);
863
869
p.drawText(0, 0, width(), height(), Qt::AlignCenter,
864
i18n("No profile available..."));
870
i18n("No profile available..."));