colour_visuals.common.as_contiguous_array#

class colour_visuals.common.as_contiguous_array(a: NDArray, dtype: Type[DType] = DEFAULT_FLOAT_DTYPE_WGPU)[source]#

Bases:

Convert given array to a contiguous array (ndim >= 1) in memory (C order).

Parameters:
  • a (numpy.ndarray[Any, numpy.dtype[numpy._typing._array_like._ScalarType_co]]) – Variable \(a\) to convert.

  • dtype (Type[DType]) – numpy.dtype to use for conversion, default to the numpy.dtype defined by the colour.constant.DEFAULT_FLOAT_DTYPE_WGPU attribute.

Returns:

Converted variable \(a\).

Return type:

numpy.ndarray