colour.models.log_encoding_FLog2#

colour.models.log_encoding_FLog2(in_r: Annotated[_Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str], 1], bit_depth: int = 10, out_normalised_code_value: bool = True, in_reflection: bool = True, constants: Structure | None = None) Annotated[ndarray[tuple[Any, ...], dtype[float16 | float32 | float64]], 1][source]#

Apply the Fujifilm F-Log2 log encoding opto-electronic transfer function (OETF).

Parameters:
  • in_r (Annotated[_Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str], 1]) – Linear reflection data \(in\).

  • bit_depth (int) – Bit-depth used for conversion.

  • out_normalised_code_value (bool) – Whether the Fujifilm F-Log2 non-linear data \(out\) is encoded as normalised code values.

  • in_reflection (bool) – Whether the light level \(in\) to a camera is reflection.

  • constants (Structure | None) – Fujifilm F-Log2 constants.

Returns:

Fujifilm F-Log2 non-linear encoded data \(out\).

Return type:

numpy.floating or numpy.ndarray

Notes

Domain

Scale - Reference

Scale - 1

in_r

1

1

Range

Scale - Reference

Scale - 1

out_r

1

1

References

[Fujifilm22b]

Examples

>>> log_encoding_FLog2(0.18)
0.3910072...

The values of 2-2. F-Log2 Code Value table in [Fujifilm22b] are obtained as follows:

>>> x = np.array([0, 18, 90]) / 100
>>> np.around(log_encoding_FLog2(x, 10, False) * 100, 1)
array([  3.5,  38.4,  57.8])
>>> np.around(log_encoding_FLog2(x) * (2**10 - 1)).astype(np.int_)
array([ 95, 400, 570])