colour.LUT3x1D

class colour.LUT3x1D(table=None, name=None, domain=None, size=10, comments=None)[source]

Defines the base class for a 3x1D LUT.

Parameters:
  • table (array_like, optional) – Underlying LUT table.
  • name (unicode, optional) – LUT name.
  • domain (unicode, optional) – LUT domain, also used to define the instantiation time default table domain.
  • size (int, optional) – Size of the instantiation time default table.
  • comments (array_like, optional) – Comments to add to the LUT.
is_domain_explicit()[source]
linear_table()[source]
apply()[source]
as_LUT()[source]

Examples

Instantiating a unity LUT with a table with 16x3 elements:

>>> print(LUT3x1D(size=16))
LUT3x1D - Unity 16
------------------
<BLANKLINE>
Dimensions : 2
Domain     : [[ 0.  0.  0.]
              [ 1.  1.  1.]]
Size       : (16, 3)

Instantiating a LUT using a custom table with 16x3 elements:

>>> print(LUT3x1D(LUT3x1D.linear_table(16) ** (1 / 2.2)))
... # doctest: +ELLIPSIS
LUT3x1D - ...
----------...
<BLANKLINE>
Dimensions : 2
Domain     : [[ 0.  0.  0.]
              [ 1.  1.  1.]]
Size       : (16, 3)

Instantiating a LUT using a custom table with 16x3 elements, custom name, custom domain and comments:

>>> from colour.algebra import spow
>>> domain = np.array([[-0.1, -0.2, -0.4], [1.5, 3.0, 6.0]])
>>> print(LUT3x1D(
...     spow(LUT3x1D.linear_table(16), 1 / 2.2),
...     'My LUT',
...     domain,
...     comments=['A first comment.', 'A second comment.']))
LUT3x1D - My LUT
----------------
<BLANKLINE>
Dimensions : 2
Domain     : [[-0.1 -0.2 -0.4]
              [ 1.5  3.   6. ]]
Size       : (16, 3)
Comment 01 : A first comment.
Comment 02 : A second comment.
__init__(table=None, name=None, domain=None, size=10, comments=None)[source]

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__([table, name, domain, size, comments]) Initialize self.
apply(RGB[, interpolator, interpolator_args]) Applies the LUT to given RGB colourspace array using given method.
arithmetical_operation(a, operation[, in_place]) Performs given arithmetical operation with \(a\) operand, the operation can be either performed on a copy or in-place, must be reimplemented by sub-classes.
as_LUT(cls[, force_conversion]) Converts the LUT to given cls class instance.
copy() Returns a copy of the sub-class instance.
is_domain_explicit() Returns whether the LUT domain is explicit (or implicit).
linear_table([size, domain]) Returns a linear table, the number of output samples \(n\) is equal to size * 3 or size[0] + size[1] + size[2].

Attributes

comments Getter and setter property for the LUT comments.
dimensions Getter and setter property for the LUT dimensions.
domain Getter and setter property for the LUT domain.
name Getter and setter property for the LUT name.
size Getter property for the LUT size.
table Getter and setter property for the underlying LUT table.