colour.models.logarithmic_function_quasilog

colour.models.logarithmic_function_quasilog(x: FloatingOrArrayLike, style: Union[Literal['linToLog', 'logToLin'], str] = 'linToLog', base: int = 2, log_side_slope: float = 1, lin_side_slope: float = 1, log_side_offset: float = 0, lin_side_offset: float = 0) FloatingOrNDArray[source]

Define the quasilog logarithmic function.

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

  • style (Union[Literal['linToLog', 'logToLin'], str]) –

    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 (int) – Logarithmic base used for the conversion.

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

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

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

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

Returns

Encoded/Decoded data.

Return type

numpy.floating or numpy.ndarray

Examples

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