colour.utilities.orient¶
- colour.utilities.orient(a: ArrayLike, orientation: Union[Literal['Flip', 'Flop', '90 CW', '90 CCW', '180'], str]) Optional[numpy.ndarray] [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]])