colour.models.exponent_function_basic#

colour.models.exponent_function_basic(x: ArrayLike, exponent: ArrayLike = 1, style: Literal['basicFwd', 'basicRev', 'basicMirrorFwd', 'basicMirrorRev', 'basicPassThruFwd', 'basicPassThruRev'] | str = 'basicFwd') NDArrayFloat[source]#

Apply a basic exponent transfer function to the specified array.

Parameters:
  • x (ArrayLike) – Exponentially encoded data \(x\).

  • exponent (ArrayLike) – Exponent value used for the conversion.

  • style (Literal['basicFwd', 'basicRev', 'basicMirrorFwd', 'basicMirrorRev', 'basicPassThruFwd', 'basicPassThruRev'] | str) –

    Specifies the behaviour for the exponentiation function to operate:

    • basicFwd: Basic Forward exponential behaviour where the definition applies a basic power law using the exponent. Values less than zero are clamped.

    • basicRev: Basic Reverse exponential behaviour where the definition applies a basic power law using the exponent. Values less than zero are clamped.

    • basicMirrorFwd: Basic Mirror Forward exponential behaviour where the definition applies a basic power law using the exponent for values greater than or equal to zero and mirrors the function for values less than zero (i.e., rotationally symmetric around the origin).

    • basicMirrorRev: Basic Mirror Reverse exponential behaviour where the definition applies a basic power law using the exponent for values greater than or equal to zero and mirrors the function for values less than zero (i.e., rotationally symmetric around the origin).

    • basicPassThruFwd: Basic Pass Forward exponential behaviour where the definition applies a basic power law using the exponent for values greater than or equal to zero and passes values less than zero unchanged.

    • basicPassThruRev: Basic Pass Reverse exponential behaviour where the definition applies a basic power law using the exponent for values greater than or equal to zero and passes values less than zero unchanged.

Returns:

Exponentially converted data.

Return type:

numpy.ndarray

Examples

>>> exponent_function_basic(0.18, 2.2)
np.float64(0.0229932...)
>>> exponent_function_basic(-0.18, 2.2)
np.float64(0.0)
>>> exponent_function_basic(0.18, 2.2, "basicRev")
np.float64(0.4586564...)
>>> exponent_function_basic(-0.18, 2.2, "basicRev")
np.float64(0.0)
>>> exponent_function_basic(
...     0.18, 2.2, "basicMirrorFwd"
... )
np.float64(0.0229932...)
>>> exponent_function_basic(
...     -0.18, 2.2, "basicMirrorFwd"
... )
np.float64(-0.0229932...)
>>> exponent_function_basic(
...     0.18, 2.2, "basicMirrorRev"
... )
np.float64(0.4586564...)
>>> exponent_function_basic(
...     -0.18, 2.2, "basicMirrorRev"
... )
np.float64(-0.4586564...)
>>> exponent_function_basic(
...     0.18, 2.2, "basicPassThruFwd"
... )
np.float64(0.0229932...)
>>> exponent_function_basic(
...     -0.18, 2.2, "basicPassThruFwd"
... )
np.float64(-0.18)
>>> exponent_function_basic(
...     0.18, 2.2, "basicPassThruRev"
... )
np.float64(0.4586564...)
>>> exponent_function_basic(
...     -0.18, 2.2, "basicPassThruRev"
... )
np.float64(-0.18)