computeCCT {colorSpec} | R Documentation |
Compute Correlated Color Temperature (CCT) of Light Spectra
Description
Compute the CCT, in K,
of a colorSpec object with type
equal to 'light'
Usage
## S3 method for class 'colorSpec'
computeCCT( x, isotherms='robertson', locus='robertson', strict=FALSE )
Arguments
x |
an colorSpec R object with |
isotherms |
A character vector whose elements match one
of the available isotherm families:
|
locus |
valid values are |
strict |
The CIE considers the CCT of a chromaticity |
Details
In computeCCT()
, for each spectrum,
XYZ is computed using xyz1931.1nm
,
and the result passed to spacesXYZ::CCTfromXYZ()
.
If the quantity
of x
is 'photons'
(actinometric) each spectrum is
converted to 'energy'
(radiometric) on the fly.
Value
computeCCT()
returns a numeric vector of length M,
where M is the number of spectra in x
.
The vector's names
is set to specnames(x)
.
If the type
of x
is not 'light'
,
then a warning is issued and all values are NA_real_
.
References
McCamy, C. S. Correlated color temperature as an explicit function of chromaticity coordinates. Color Research & Application. Volume 17. Issue 2. pages 142-144. April 1992.
Robertson, A. R. Computation of correlated color temperature and distribution temperature. Journal of the Optical Society of America. 58. pp. 1528-1535 (1968).
Wyszecki, Günther and W. S. Stiles. Color Science: Concepts and Methods, Quantitative Data and Formulae, Second Edition. John Wiley & Sons, 1982. Table 1(3.11). pp. 227-228.
See Also
type()
,
quantity()
,
xyz1931
,
planckSpectra()
,
specnames()
,
spacesXYZ::CCTfromXYZ()
Examples
computeCCT( D65.1nm ) # returns 6502.068
computeCCT( D65.1nm, isotherms='native' ) # returns 6503.323
computeCCT( A.1nm ) # returns 2855.656
computeCCT( A.1nm, isotherms='native' ) # returns 2855.662
computeCCT( A.1nm, isotherms='mccamy' ) # returns 2857.188
moon = readSpectra( system.file( "extdata/sources/moonlight.txt", package='colorSpec' ) )
computeCCT( moon ) # returns 4482.371