colour.models.logarithmic_function_camera#
- colour.models.logarithmic_function_camera(x: ArrayLike, style: Literal['cameraLinToLog', 'cameraLogToLin'] | str = 'cameraLinToLog', base: int = 2, log_side_slope: float = 1, lin_side_slope: float = 1, log_side_offset: float = 0, lin_side_offset: float = 0, lin_side_break: float = 0.005, linear_slope: float | None = None) NDArrayFloat [source]#
Define the camera logarithmic function.
- Parameters:
x (ArrayLike) – Linear/non-linear data to undergo encoding/decoding.
style (Literal['cameraLinToLog', 'cameraLogToLin'] | str) –
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 (int) – Logarithmic base used for the conversion.
log_side_slope (float) – Slope (or gain) applied to the log side of the logarithmic segment. The default value is 1.
lin_side_slope (float) – Slope of the linear side of the logarithmic segment. The default value is 1.
log_side_offset (float) – Offset applied to the log side of the logarithmic segment. The default value is 0.
lin_side_offset (float) – Offset applied to the linear side of the logarithmic segment. The default value is 0.
lin_side_break (float) – Break-point, defined in linear space, at which the piece-wise function transitions between the logarithmic and linear segments.
linear_slope (float | None) – Slope of the linear portion of the curve. The default value is None.
- Returns:
Encoded/Decoded data.
- Return type:
Examples
>>> logarithmic_function_camera( ... 0.18, "cameraLinToLog" ... ) -2.4739311... >>> logarithmic_function_camera( ... -2.4739311883324122, "cameraLogToLin" ... ) 0.1800000...