colour_clf_io.Array#

class colour_clf_io.Array(values: list[float], dim: tuple[int, ...])[source]#

Bases: XMLParsable, XMLWritable

Represent an Array element.

Attributes

Methods

References

Parameters:
values: list[float]#

Values contained by the element.

dim: tuple[int, ...]#

Specifies the dimension of the LUT or the matrix and the number of colour components.

static from_xml(xml: _Element | None, config: ParserConfig) Array | None[source]#

Parse and return a colour_clf_io.Array class instance from the given XML element. Returns None` if the given XML element is None.

Expects the XML element to be a valid element according to the CLF specification.

Parameters:
  • xml (_Element | None) – XML element to parse.

  • config (ParserConfig) – XML parser config.

Returns:

class – Parsed XML node.

Return type:

colour_clf_io.Array or None

Raises:

colour_clf_io.errors.ParsingError – If the node does not conform to the specification, a ParsingError exception will be raised. The error message will indicate the details of the issue that was encountered.

to_xml() _Element[source]#

Serialise this object as an XML object.

Return type:

lxml.etree._Element

as_array() npt.NDArray[source]#

Convert the CLF element into a numpy array.

Returns:

Array of shape dim with the data from values.

Return type:

numpy`ndarray`

__eq__(other)#

Return self==value.

__hash__ = None#
__init__(values: list[float], dim: tuple[int, ...]) None#
Parameters:
Return type:

None

__repr__()#

Return repr(self).