RGBspaces: Query RGB Spaces

Description Usage Arguments Details Value References See Also Examples

Description

Query and summarize the installed RGB spaces. The RGB spaces are stored in a dictionary, which comes with 8 RGB spaces pre-installed.

Usage

1
2
3
4
summaryRGB( verbosity=1 )

getRGB( space )
getWhiteXYZ( space, which='scene' )

Arguments

space

name of the RGB space to query. The name matching is partial and case-insensitive.

verbosity

an integer that controls the return value of summaryRGB(), see Value.

which

the source of the whitepoint, either 'scene' or 'display'. Matching is partial and case-insensitive.

Details

The function getWhiteXYZ() is provided because some applications only need the whitepoint for chromatic adaptation purposes, and this function is faster than getRGB().

Value

summaryRGB(), with the default verbosity=1, returns a data.frame with a row for each RGB space. The row contains primary, whitepoint, and transfer function information for each space. The primary/whitepoint data is for both scene and display; all the data is numerical and the columns are labeled. There are 22 columns so the display is very wide.
The transfer function data is a very short string. If the OETF is classical (pure 1/γ power law), the string is 1/γ. If the OETF is not classical, the string is 1/~γ, where γ is the best-fit (or approximate or effective) γ to the OETF in the L^1-norm.
Similarly, if the EOTF is classical (pure γ power law) the string is γ, and if the EOTF is not classical the string is ~γ.
The OOTF is the quotient (to 2 decimal places) of the gammas of EOTF and OETF (either true gamma or best-fit gamma). If either gamma is best-fit then the string is preceede by a '~', which means effective.
If the TransferFunction has dimension 1, but the domain and range are not the interval [0,1], the string is '1D'. If the TransferFunction has dimension 3, the string is '3D'.
If verbosity=0, summaryRGB() returns the names of all the RGB spaces.

getRGB() returns a list with these items:

space the full and original name of the RGB space
scene a list with items primaries, whiteXYZ, RGB2XYZ, and XYZ2RGB
display a list with items primaries, whiteXYZ, RGB2XYZ, and XYZ2RGB
EOTF Electro-Optical Transfer Function
OETF Opto-Electronic Transfer Function
OOTF Opto-Optical Transfer Function, and numerically equal to OETF*EOTF

The items in the lists scene and display are

primaries 4x2 matrix with the xy chromaticities of the RGB primaries and white
whiteXYZ XYZ of the display white point, which maps to RGB=(1,1,1)
RGB2XYZ 3x3 matrix taking RGB to XYZ
XYZ2RGB 3x3 matrix taking XYZ to RGB

All transfer functions are actual TransferFunctions objects, and not the numerical exponent or character string name. They are suitable for plotting with plot.TransferFunction(); see the Examples. In case of error, getRGB() returns NULL.

getWhiteXYZ() returns a numeric 3-vector with the XYZ of the whitepoint of the scene or the display. In case of error it returns NULL.

References

Lindbloom, Bruce. RGB/XYZ Matrices. http://brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html

See Also

installRGB(), plot.TransferFunction()

Examples

1
2
3
4
# make plot comparing three EOTFs
plot( getRGB('sRGB')$EOTF, col='black' )
plot( getRGB('BT.709')$EOTF, col='blue', add=TRUE )
plot( getRGB('ProPhotoRGB')$EOTF, col='red', add=TRUE )

spacesRGB documentation built on Dec. 11, 2021, 9:58 a.m.