composition: The composition of TransferFunction objects

Description Usage Arguments Details Value References See Also Examples

View source: R/TransferFunction.R

Description

The function composition(TF1,TF2) returns a TransferFunction that is TF1 followed by TF2. Four equivalent infix operators are also available.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## S3 method for class 'TransferFunction'
composition( TF1, TF2 )

## S3 method for class 'TransferFunction'
 TF1 * TF2 
## S3 method for class 'TransferFunction'
 TF1 %;% TF2 
## S3 method for class 'TransferFunction'
 TF1 %X% TF2 
## S3 method for class 'TransferFunction'
 TF2 %O% TF1 

identity.TF

## S3 method for class 'TransferFunction'
is.identity( TF )

Arguments

TF1

a TransferFunction object

TF2

a TransferFunction object

TF

a TransferFunction object

Details

In order to be composed, the dimensions of TF1 and TF2 must be equal, or the dimension of one of them must be 1. In the latter case, the function is applied to each coordinate in exactly the same way.

All the above represent the function TF1 followed by TF2. In mathematics this operation is usually called composition of functions (and composition of morphisms in category theory), and in computer science and BT.2100 and BT.2390 it is called the concatenation. In BT.2390 it is also called the cascade.

The ACES literature uses infix notation with the symbol '+' which is unfortunate because in mathematics the plus symbol is only used for commutative operations, which composition certainly is not. The symbol '*' is offered here as an alternative, since '*' does not imply commutativity (e.g. as in MATLAB's matrix multiplication). In computer science the symbol ';' is common, and so %;% is offered as an alternative. In BT.2100 and BT.2390 the symbol \otimes is used, and so %X% is offered as an alternative. And finally, in mathematics \circ is used but in the opposite order, so that TF2 %O% TF1 is identical to composition(TF1,TF2).
Each TransferFunction object is actually a list of so-called elementary transfer functions. If TF1 has M_1 elementary functions and TF2 has M_2 elementary functions, then composition(TF1,TF2) has ≤ M_1 + M_2 elementary functions. It can be strictly less if there is cancellation of elementary functions at the end of TF1 and the beginning of TF2.

Value

composition(TF1,TF2) returns a TransferFunction object, which applies TF1 followed by TF2. The individual objects TF1 and TF2 are stored inside the returned object. In case of ERROR it returns NULL. The 4 infix operators above all invoke composition().

identity.TF is a built-in global TransferFunction object which is a universal identity for composition. This means that for any TransferFunction TF, TF*identity.TF = identity.TF*TF = TF. Moreover, TF*TF^-1 = TF^1*TF = identity.TF. This is *not* the same as base::identity().

is.identity(TF) tests whether TF is the universal identity, and returns TRUE or FALSE.

References

Technical Bulletin. TB-2018-002. ACES Output Transform Details. June 2018 (draft).

ACES Retrospective and Enhancements March 2017.

BT.2100. Image parameter values for high dynamic range television for use in production and international programme exchange. June 2017.

BT.2390. High dynamic range television for production and international programme exchange. April 2018.

See Also

TransferFunction, transfer(), inverse()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
comp = power.OOTF(2.2) * power.OOTF(1.4)
x = 0:100 / 100
max( abs( transfer(comp,x) - transfer(power.OOTF(2.2*1.4),x) ) )  #  1.110223e-16

comp * comp^-1
## This is a universal identity TransferFunction.

is.identity(comp * comp^-1)          # TRUE

identical( comp * identity.TF, comp )  # TRUE

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