colour.algebra.table_interpolation_trilinear#

colour.algebra.table_interpolation_trilinear(V_xyz: ArrayLike, table: ArrayLike) NDArrayFloat[source]#

Perform the trilinear interpolation of given \(V_{xyz}\) values using given interpolation table.

Parameters:
  • V_xyz (ArrayLike) – \(V_{xyz}\) values to interpolate.

  • table (ArrayLike) – 4-Dimensional (NxNxNx3) interpolation table.

Returns:

Interpolated \(V_{xyz}\) values.

Return type:

numpy.ndarray

References

[Boub]

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)  
[[ 0.9670298...  0.7148159...  0.9762744...]
 [ 0.5472322...  0.6977288...  0.0062302...]
 [ 0.9726843...  0.2160895...  0.2529823...]]
>>> table_interpolation_trilinear(V_xyz, table)  
array([[ 1.0120664...,  0.7539146...,  1.0228540...],
       [ 0.5075794...,  0.6479459...,  0.1066404...],
       [ 1.0976519...,  0.1785998...,  0.2299897...]])