Open doug-walker opened 1 month ago
The flags
property of a NumPy array shows the storage order.
C_CONTIGUOUS : True
F_CONTIGUOUS : False
OWNDATA : False
WRITEABLE : True
ALIGNED : True
WRITEBACKIFCOPY : False
Currently applyRGB()
will only work correctly if C_CONTIGUOUS
is True
.
Easiest is wrapping the array with np.ascontiguousarray
before using ApplyRGB
. I modified Colour for now with this.
Numpy matrices may be stored in either row-major or column-major order. The user is typically not aware of the order being used, especially since some Numpy operators swap the order if it is more efficient for them. For example, transpose simply swaps the ordering flag rather than moving numeric values.
The applyRGB function in OCIO essentially just flattens the input and expects channel-interleaved ordering. Ideally, applyRGB would check the storage order and transpose values, if needed. At a minimum, it should issue a warning if the storage order is not as expected.