rot90#

rlemasklib.RLEMask.rot90(k=1, inplace=False)[source]#

Rotate the mask by a multiple of 90 degrees.

Parameters:
  • k – the number of counter-clockwise 90-degree rotations to apply

  • inplace – whether to perform the operation in place or to return a new object

Returns:

The RLEMask object representing the rotated mask (self if inplace=True)

Return type:

RLEMask

Examples

90 degrees counter-clockwise:

.rot90(1) ==

180 degrees:

.rot90(2) ==

See also

warp_affine() for arbitrary affine transformations including arbitrary rotations.