computeADL: compute ADL coordinates by ray tracing

View source: R/colorSpec.optimal.R

computeADLR Documentation

compute ADL coordinates by ray tracing

Description

Consider a colorSpec object x with type equal to responsivity.material. The set of all possible material reflectance functions (or transmittance functions) that take the value 0 or 1, and with 2 or 0 transitions is called the 2-transition spectrum space. When there are 2 transitions, there are 2 types of spectra: bandpass and bandstop. When there are 0 transitions, the spectrum is either identically 0 or identically 1. When x is applied to this space, the corresponding surface in response space is called the 2-transition surface. The special points 0 and W (the response to the perfect reflecting diffuser) are on this surface. The surface is symmetrical about the neutral gray midpoint G=W/2. Following West and Brill, colors on the surface are called Schrödinger colors. For details see: zonohedra::raytrace2trans().

This surface is a subset of the object-color solid or Rösch Farbkörper for x. Points on the boundary of of the solid are called optimal colors, see probeOptimalColors(). In most cases, a point on the 2-transition surface (a Schrödinger color) is an optimal color, but this is not always true, see the vignette Convexity and Transitions.

Now consider a color response R not equal to G. There is a ray based at G and passing through R that intersects the 2-transition surface at a Schrödinger color B with Logvinenko coordinates (\delta,\omega). If these 2 coordinates are combined with \alpha, where R = G + \alpha(B-G), it yields the Logvinenko coordinates (\alpha,\delta,\omega) of R. These coordinates are also denoted by ADL; see References. A color is Schrödinger iff \alpha{=}1.

The coordinates of 0 are (\alpha,\delta,\omega)=(1,0,NA). The coordinates of W are (\alpha,\delta,\omega)=(1,1,NA). The coordinates of G are (\alpha,\delta,\omega)=(0,NA,NA).

Usage

## S3 method for class 'colorSpec'
computeADL( x, response )

Arguments

x

a colorSpec object with type equal to responsivity.material and 3 spectra

response

a numeric Nx3 matrix with responses in the rows, or a numeric vector that can be converted to such a matrix, by row.

Details

For each response, a ray is computed and the ray tracing is done by probeOptimalColors().

Value

computeADL() returns a data.frame with a row for each response. The columns in the data frame are:

response

the input response vector

lambda

lambda.1 and lambda.2 at the 2 transitions, in nm. lambda.1 < lambda.2 => bandpass, and lambda.1 > lambda.2 => bandstop.

ADL

the computed ADL coordinates of the response vector

omega

the reparameterized \lambda in the interval [0,1]; see Logvinenko

If an individual ray could not be traced, the row contains NA in appropriate columns.
In case of global error, the function returns NULL.

WARNING

Since this function is really a simple wrapper around zonohedra::raytrace2trans(). Please see the warnings about star-shaped regions there.

References

Logvinenko, A. D. An object-color space. Journal of Vision. 9(11):5, 1-23, (2009).
https://jov.arvojournals.org/article.aspx?articleid=2203976. doi:10.1167/9.11.5.

Godau, Christoph and Brian Funt. XYZ to ADL: Calculating Logvinenko's Object Color Coordinates. Proceedings Eighteenth IS&T Color Imaging Conference. San Antonio. Nov 2009.

West, G. and M. H. Brill. Conditions under which Schrödinger object colors are optimal. Journal of the Optical Society of America. 73. pp. 1223-1225. 1983.

See Also

type(), probeOptimalColors(), zonohedra::raytrace2trans(), vignette Convexity and Transitions

Examples

D50.eye = product( D50.5nm, 'varmat', xyz1931.1nm, wave=seq(360,830,by=5) )
computeADL( D50.eye, c(30,50,70) )

##    response.X response.Y response.Z lambda.1 lambda.2 ADL.alpha ADL.delta  ADL.lambda
##  1         30         50         70 427.2011 555.5262 0.7371480 0.5384106 473.3594244

##     omega
## 0.3008816
 
## since alpha < 1, XYZ=c(30,50,70) is *inside* the Schrodinger color surface of D50.eye

colorSpec documentation built on April 4, 2025, 1:59 a.m.