colour.algebra.table_interpolation_tetrahedral

colour.algebra.table_interpolation_tetrahedral(V_xyz, table)[source]

Performs tetrahedral interpolation of given \(V_{xyz}\) values using given interpolation table.

Parameters:
  • V_xyz (array_like) – \(V_{xyz}\) values to interpolate.
  • table (array_like) – 4-Dimensional (NxNxNx3) interpolation table.
Returns:

Interpolated \(V_{xyz}\) values.

Return type:

ndarray

References

[Kir06]

Examples

>>> import os
>>> import colour
>>> path = os.path.join(
...     os.path.dirname(__file__),'..', 'io', 'luts', 'tests', 'resources',
...     'iridas_cube', 'Colour_Correct.cube')
>>> LUT = colour.read_LUT(path)
>>> table = LUT.table
>>> prng = np.random.RandomState(4)
>>> V_xyz = colour.algebra.random_triplet_generator(3, random_state=prng)
>>> print(V_xyz)  # doctest: +ELLIPSIS
[[ 0.9670298...  0.7148159...  0.9762744...]
 [ 0.5472322...  0.6977288...  0.0062302...]
 [ 0.9726843...  0.2160895...  0.2529823...]]
>>> table_interpolation_tetrahedral(V_xyz, table)  # doctest: +ELLIPSIS
array([[ 1.0196197...,  0.7674062...,  1.0311751...],
       [ 0.5105603...,  0.6466722...,  0.1077296...],
       [ 1.1178206...,  0.1762039...,  0.2209534...]])