colour.utilities.orient#
- colour.utilities.orient(a: ArrayLike, orientation: Union[Literal['Ignore', 'Flip', 'Flop', '90 CW', '90 CCW', '180'], str] = 'Ignore') numpy.ndarray[Any, numpy.dtype[numpy._typing._array_like._ScalarType_co]] [source]#
Orient given array \(a\) according to given orientation.
- Parameters
- Returns
Oriented array.
- Return type
Examples
>>> a = np.tile(np.arange(5), (5, 1)) >>> a array([[0, 1, 2, 3, 4], [0, 1, 2, 3, 4], [0, 1, 2, 3, 4], [0, 1, 2, 3, 4], [0, 1, 2, 3, 4]]) >>> orient(a, "90 CW") array([[ 0., 0., 0., 0., 0.], [ 1., 1., 1., 1., 1.], [ 2., 2., 2., 2., 2.], [ 3., 3., 3., 3., 3.], [ 4., 4., 4., 4., 4.]]) >>> orient(a, "Flip") array([[ 4., 3., 2., 1., 0.], [ 4., 3., 2., 1., 0.], [ 4., 3., 2., 1., 0.], [ 4., 3., 2., 1., 0.], [ 4., 3., 2., 1., 0.]])