colour.models.logarithmic_function_quasilog

colour.models.logarithmic_function_quasilog(x, style='linToLog', base=2, log_side_slope=1, lin_side_slope=1, log_side_offset=0, lin_side_offset=0)[source]

Defines the quasilog logarithmic function.

Parameters
  • x (numeric) – Linear/non-linear data to undergo encoding/decoding.

  • style (str, optional) –

    {‘linToLog’, ‘logToLin’}, Defines the behaviour for the logarithmic function to operate:

    • linToLog: Applies a logarithm to convert linear data to logarithmic data.

    • logToLin: Applies an anti-logarithm to convert logarithmic data to linear data.

  • base (numeric, optional) – Logarithmic base used for the conversion.

  • log_side_slope (numeric, optional) – Slope (or gain) applied to the log side of the logarithmic function. The default value is 1.

  • lin_side_slope (numeric, optional) – Slope of the linear side of the logarithmic function. The default value is 1.

  • log_side_offset (numeric, optional) – Offset applied to the log side of the logarithmic function. The default value is 0.

  • lin_side_offset (numeric, optional) – Offset applied to the linear side of the logarithmic function. The default value is 0.

Returns

Encoded/Decoded data.

Return type

numeric or ndarray

Raises

ValueError – If the style is not defined.

Examples

>>> logarithmic_function_quasilog(  
...    0.18, 'linToLog')
-2.4739311...
>>> logarithmic_function_quasilog(  
...    -2.473931188332412, 'logToLin')
0.18000000...