colour.models.logarithmic_function_camera

colour.models.logarithmic_function_camera(x, style='cameraLinToLog', base=2, log_side_slope=1, lin_side_slope=1, log_side_offset=0, lin_side_offset=0, lin_side_break=0.005, linear_slope=None)[source]

Defines the camera logarithmic function.

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

  • style (unicode, optional) –

    {‘cameraLinToLog’, ‘cameraLogToLin’}, Defines the behaviour for the logarithmic function to operate:

    • cameraLinToLog: Applies a piece-wise function with logarithmic and linear segments on linear values, converting them to non-linear values.

    • cameraLogToLin: Applies a piece-wise function with logarithmic and linear segments on non-linear values, converting them to linear values.

  • 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 segment. The default value is 1.

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

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

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

  • lin_side_break (numeric) – Break-point, defined in linear space, at which the piece-wise function transitions between the logarithmic and linear segments.

  • linear_slope (numeric, optional) – Slope of the linear portion of the curve. The default value is None.

Returns

Encoded/Decoded data.

Return type

numeric or ndarray

Raises

ValueError – If the style is not defined.

Examples

>>> logarithmic_function_camera(  
...    0.18, 'cameraLinToLog')
-2.4739311...
>>> logarithmic_function_camera(  
...    -2.4739311883324122, 'cameraLogToLin')
0.1800000...