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]#
Apply a camera logarithmic function to the specified array.
Apply a piece-wise function with logarithmic and linear segments for encoding or decoding camera data.
- Parameters:
x (ArrayLike) – Logarithmically encoded data \(x\).
style (Literal['cameraLinToLog', 'cameraLogToLin'] | str) –
Specifies 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 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.
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" ... ) np.float64(-2.4739311...) >>> logarithmic_function_camera( ... -2.4739311883324122, "cameraLogToLin" ... ) np.float64(0.1800000...)