colour.models.exponent_function_basic

colour.models.exponent_function_basic(x, exponent=1, style='basicFwd')[source]

Defines the basic exponent transfer function.

Parameters
  • x (numeric or array_like) – Data to undergo the basic exponent conversion.

  • exponent (numeric or array_like, optional) – Exponent value used for the conversion.

  • style (unicode, optional) –

    {‘basicFwd’, ‘basicRev’, ‘basicMirrorFwd’, ‘basicMirrorRev’, ‘basicPassThruFwd’, ‘basicPassThruRev’}, Defines the behaviour for the transfer 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

numeric or ndarray

Raises

ValueError – If the style is not defined.

Examples

>>> exponent_function_basic(0.18, 2.2)  
0.0229932...
>>> exponent_function_basic(-0.18, 2.2)
0.0
>>> exponent_function_basic(0.18, 2.2, 'basicRev')  
0.4586564...
>>> exponent_function_basic(-0.18, 2.2, 'basicRev')
0.0
>>> exponent_function_basic(  
...     0.18, 2.2, 'basicMirrorFwd')
0.0229932...
>>> exponent_function_basic(  
...     -0.18, 2.2, 'basicMirrorFwd')
-0.0229932...
>>> exponent_function_basic(  
...     0.18, 2.2, 'basicMirrorRev')
0.4586564...
>>> exponent_function_basic(  
...     -0.18, 2.2, 'basicMirrorRev')
-0.4586564...
>>> exponent_function_basic(  
...     0.18, 2.2, 'basicPassThruFwd')
0.0229932...
>>> exponent_function_basic(  
...     -0.18, 2.2, 'basicPassThruFwd')
-0.1799999...
>>> exponent_function_basic(  
...     0.18, 2.2, 'basicPassThruRev')
0.4586564...
>>> exponent_function_basic(  
...     -0.18, 2.2, 'basicPassThruRev')
-0.1799999...